Top Banner
The Department of Informatics The University of Fribourg and der Philosophisch-naturwissenschaftlichen Faculty at der Universitat Bern Master Thesis Go Green: Getting green through Social Networking Web Apps Written by Dhara Shah 16 April - 2013
91
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Master thesis

The Department of InformaticsThe University of Fribourg

andder Philosophisch-naturwissenschaftlichen Faculty at

der Universitat Bern

Master Thesis

Go Green: Getting green through SocialNetworking Web Apps

Written byDhara Shah

16 April - 2013

Page 2: Master thesis

Supervised byProf. Dr. Rolf Ingold

Department of Computer Science,University of Fribourg

Prof. Dr. Jean HennebertDepartment of Computer Science,University of Fribourg

Prof. Dr. Elena MugelliniDepartment of Computer Science,University of Friboug

Prof. Dr. Omar Abou KhaledDepartment of Computer Science,University of Friboug

ii

Page 3: Master thesis

iii

Page 4: Master thesis

Contents

Contents

Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2Dedication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1 Introduction 41.1 Objective . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 Purpose . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.3 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51.4 Scope of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2 State of the Art 82.1 Gamification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.1.1 Game Elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.2 Game Design Techniques . . . . . . . . . . . . . . . . . . . . . . . 102.1.3 Non-Game Context . . . . . . . . . . . . . . . . . . . . . . . . . . 102.1.4 Gamification in Context . . . . . . . . . . . . . . . . . . . . . . . 112.1.5 Serious Game . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.2 Recommender Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2.1 State of the Art: Recommender Systems . . . . . . . . . . . . . . 13

2.3 Social Network Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.3.1 State of the Art Social Network Platform . . . . . . . . . . . . . . 162.3.2 Facebook App Architecture . . . . . . . . . . . . . . . . . . . . . 16

2.4 NLI/NLP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192.5 Carbon Footprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

2.5.1 State of the art: Carbon Footprint Analysis . . . . . . . . . . . . 23

3 Master Thesis Contribution 253.1 Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3.1.1 What is Go Green Model? . . . . . . . . . . . . . . . . . . . . . . 253.1.2 Overview of Go Green Model . . . . . . . . . . . . . . . . . . . . 263.1.3 Scenario Explanation of Go Green Model . . . . . . . . . . . . . . 273.1.4 Use Case Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 293.1.5 ER-Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.2 Gamification and Go Green . . . . . . . . . . . . . . . . . . . . . . . . . 293.2.1 Concept of Go Green for Gamification . . . . . . . . . . . . . . . 293.2.2 Game Elements in Go Green . . . . . . . . . . . . . . . . . . . . . 313.2.3 Game Design in Go Green . . . . . . . . . . . . . . . . . . . . . . 31

iv

Page 5: Master thesis

List of Figures

3.2.4 Non Game context in Go Green . . . . . . . . . . . . . . . . . . . 343.2.5 Why Go Green is not Serious Game – My take . . . . . . . . . . . 34

3.3 Recommender System model for Go Green Model . . . . . . . . . . . . . 353.3.1 Why Recommender Systems for Go Green Model . . . . . . . . . 353.3.2 Correlation Based User-Suggestion Model . . . . . . . . . . . . . 363.3.3 Collaborative Filtering algorithm implementation for Go Green . 373.3.4 Regularized Cost Function . . . . . . . . . . . . . . . . . . . . . . 433.3.5 Regularized Gradient . . . . . . . . . . . . . . . . . . . . . . . . . 44

3.4 Social Network Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . 443.5 Use of NLI/NLP in Go Green Model . . . . . . . . . . . . . . . . . . . . 45

3.5.1 QR Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 453.6 My take on: Carbon Footprint Analysis . . . . . . . . . . . . . . . . . . . 46

3.6.1 Proposed Model of Carbon Accounting Analysis with Go Green . 48

4 Work Evaluation 504.1 Feasibility evaluation of the concept . . . . . . . . . . . . . . . . . . . . . 504.2 Mock Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524.3 Project Time line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524.4 Evaluation of Recommender Systems . . . . . . . . . . . . . . . . . . . . 52

4.4.1 Cost Function value . . . . . . . . . . . . . . . . . . . . . . . . . 544.4.2 Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . 564.4.3 Test Results of Latency of Collaborative Filtering Algorithm . . . 60

5 Discussions and Conclusion 645.1 Project Experience . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 645.2 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

6 Future Recommendations and Work 666.1 Future Work and recommendations . . . . . . . . . . . . . . . . . . . . . 66

List of Figures

1.1 Environmental Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . 61.2 Energy Jar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.3 Energy Battle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61.4 Fogg’s behaviour model . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.1 Cityville by Zygna . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Nike+ Application of Nike . . . . . . . . . . . . . . . . . . . . . . . . . . 102.3 Serious Game Model [1] . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

v

Page 6: Master thesis

List of Figures

2.4 Recommender System Model . . . . . . . . . . . . . . . . . . . . . . . . . 142.5 Characteristics of Social Network Sites is taken from [2] . . . . . . . . . . 172.6 Time line of Social Network Sites is taken from [3] . . . . . . . . . . . . . 182.7 Facebook Architecture is taken from [4] . . . . . . . . . . . . . . . . . . . 20

3.1 Go Green Model Overview . . . . . . . . . . . . . . . . . . . . . . . . . . 263.2 Proposed Use Case Diagram Green World . . . . . . . . . . . . . . . . . 293.3 Proposed Entity-Relationship Diagram . . . . . . . . . . . . . . . . . . . 303.4 Go Green Growth Model Icons . . . . . . . . . . . . . . . . . . . . . . . . 323.5 Go Green Growth Model Icons . . . . . . . . . . . . . . . . . . . . . . . . 333.6 Go Green App Icon . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333.7 Collaborative Filtering in Recommender Systems[5] . . . . . . . . . . . . 373.8 Heroku Dashboard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443.9 Heroku Resources and Database Management on Dashboard . . . . . . . 453.10 QR Code Go Green . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463.11 QR Code Go Green . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47

4.1 Percentage distribution of Social Networking Site as per survey . . . . . . 514.2 Activity distribution on Online Games by Students as per survey . . . . 514.3 Willingness of Students to play Go Green as per survey . . . . . . . . . . 514.4 Go Green Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524.5 Project Time line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534.6 Latency Output of Recommender Collaborative Filtering Algorithm . . . 614.7 Outliers pointed out in Latency Output of Recommender Collaborative

Filtering Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 614.8 Throughput calculation of the θ0 and θ1. . . . . . . . . . . . . . . . . . . 624.9 Outliers pointed out in Latency Output of Recommender Collaborative

Filtering Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63

vi

Page 7: Master thesis

List of Tables

List of Tables

3.1 User-Suggestion Significance Correlation Values Table . . . . . . . . . . 383.2 Suggestion Feature Vector . . . . . . . . . . . . . . . . . . . . . . . . . . 403.3 User paramter vector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

vii

Page 8: Master thesis

List of Equations

List of Equations

2.2.1 General Recommender System Equation . . . . . . . . . . . . . . . . . . . 153.3.1 Correlation Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363.3.2 Collaborative Filtering Cost Function (without Regularization) . . . . . . . 423.3.3 Collaborative Filtering Gradient with respect to x . . . . . . . . . . . . . . 423.3.4 Collaborative Filtering Gradient with respect to Theta . . . . . . . . . . . 423.3.5 Collaborative Filtering gradient derivatives . . . . . . . . . . . . . . . . . . 433.3.6 Collaborative Filtering gradient vectorized implementation . . . . . . . . . 433.3.7 Regularized Cost Function . . . . . . . . . . . . . . . . . . . . . . . . . . . 433.3.8 Regularized Gradient with respect to x . . . . . . . . . . . . . . . . . . . . 443.3.9 Regularized Gradient with respect to Theta . . . . . . . . . . . . . . . . . 44

viii

Page 9: Master thesis

Acknowledgements

Acknowledgements

I would like to acknowledge and appreciate Prof. Dr. Rolf Ingold for accepting me inhis Software Engineering group to do my Master Thesis.

I would like to pay my sincere gratitude to Prof. Dr. Jean Hennebert, Prof. Dr.Omar Abou Khaled and Prof. Dr. Elena Mugellini to give me opportunity, freedom andguidance to choose my thesis area and form my thesis proposal.

I owe a huge thanks to Prof. Dr. Jean Hennebert for helping me and guiding me toproperly organise my thinking process. Also keeping patience when I randomly presentedmy ideas. Brain storming sessions with him and his constant guidance has motivatedme immensely.

I would like to acknowledge my virtual professors specially Prof. Andrew Ng (MachineLearning), Prof. Kevin Werbach (Gamification) from various universities who guidedme via Coursera.

I would like to acknowledge my fiancee Ishan Shah for bearing with me and supportingme during my thesis.

1

Page 10: Master thesis

Dedication

Dedication

I would like to dedicate my thesis to my parents Manoj Shah and Dipti Shah. Also tohope of a greener and better world.

2

Page 11: Master thesis

Abstract

Abstract

Inspiring and obtaining energy conservation through gamification of the concept, pro-totyping recommender systems to implement contextual suggestions in social networkplatforms and exploring NLI/NLP concepts along with QR code technology to enhanceimpact on social network is the theme of this Master Thesis. The aim of this thesis is tofind people oriented solution to the burning question of motivating energy conservation.To do so we look into the problem of Climate change and meaning of Carbon Footprint.Then we design a model which is created on the basis Carbon Footprint, Gamification,Recommender Systems and NLI/NLP along with QR code technology. The aim of thethesis is to design a model which is people oriented and can be applied on industry level.Following are the topics which this thesis goes into detail:

• Understanding Carbon foot print calculation to come up with formula to calculate"green coins" which shall be awarded upon completion of the green suggestion.

• In depth research on Gamification and Serious Gaming to categorize the conceptand design a "gamified" model.

• Understanding Recommender Systems and concerned algorithms to implement acontext aware system designed for Go Green Model.

• In depth research on Facebook App Development and Heroku platform to imple-ment a part of Go Green Model.

• Exploring NLI/NLP concepts and QR code technologies to enhance Go GreenModel.

Keywords: Enery Conservation, Carbon Foot print, Recommender Systems, SocialNetwork Platform, Facebook App, NLI/NLP, QR Code.

3

Page 12: Master thesis

1 Introduction

1 Introduction

1.1 Objective

The biggest challenge we are facing is to stop drastic changes in environment. Thesechanges cause severe natural disasters like flooding, storms, heat-wave, cold wave etc.Humans play the biggest role in these changes. Primarily these disturbances result fromemissions related with energy use.[6].Many industries are trying to take some steps to make an environment “greener” andtry to compensate up to some extent for their huge energy use. For example Google’sproject Google green[7] is all about using resources efficiently and supporting renewablepower. As mentioned on the above website Google claims that their data centres use 50percentage less energy compared to conventional data centres. Also they have commit-ted over dollar 1 billion to renewable projects as per the information mentioned. Someof the highlights in designing efficient data centres are:

• Manage airflow (Keeping internal temperature at constant level)

• Adjusting temperature level (By raising the temperature up to 80 degrees the needfor energy-intensive air conditioning. They claim that it’s a myth to believe thatdata centres need to be kept in cold condition for proper operation.)

• Natural cooling (Using natural way to cool down the equipment.)

• Power optimization. (Decreasing the wastage of energy)

Apart from efficient data centres, Google is also focusing on renewable energy. As pertheir claim they power 30 percentage of their operations using renewable energy. Theyuse wind and solar energy prominently as a renewable energy.

Second example of such industry is My Climate[8] which is dedicated to carbon offset-ting. Myclimate develops carbon offset projects. Also it helps to assess carbon emissions,to make strategies and to educate about carbon emission and how to reduce it. It en-courages producing less CO2 and offsets the unavoidable CO2 emission. With the offsetdonations unavoidable CO2 is offset somewhere else on planet which helps to keep overallgreen house gas level in the limit.Examples above are some of the steps taken by industries towards environmental care.But the question I want to put here is what the contribution of an individual is? Ibelieve individuals can also make a substantial impact on environmental care. Human

4

Page 13: Master thesis

1.2 Purpose

behavior like how his or her efforts can make a difference is critical for an environmentand we want to fill that gap by giving a chance to each individual to participate in“green” efforts with a gaming on social network.Many of the environmental problems like noise pollution, air pollution, water shortageare linked with human behavior[9]. So changes in human behavior can impact envi-ronment broadly. I believe social network gaming will lead to behavioral changes inindividuals towards an environment. Gaming helps in behavioral changes. For examplevideo games can provide health related behavioral change.[10]. Internet and online gam-ing can be addictive and may lead to negative impacts[11]. But this kind of addictioncan also be channelized towards positive impact such as on environment.The most relevant work is being done by SimpleEnergy.[12]. It encourages people to saveenergy by online platform and scores them between friends via facebook and rewardsthem with real prize. SimpleEnergy work with its utility partners and encourage SimpleEnergy customers via platform to deliver measurable and verifiable energy efficiency.

1.2 Purpose

Motivating energy conservation would be more powerful through Social Network Web-sites because the Social Network websites are based on following Social Design:

• Utilize Community

• Curate Identities

• Engage in Conversations

Energy Conservation requires above 3 components of Social Design for it to become anecessity than a convenience.

1.3 Background

There are several existing websites, online games and dedicated hardware applicationsto motivate energy conservations. In this section I shall present the example of thiswebsites/applications, flaw in the concept and how Go Green is better implementing theconcept.

Environmental Dashboards

The growing availability of energy data has lent itself nicely to dashboards that letviewers keep track of how much energy is consumed at any given time. They are per-petuated by the idea of living buildings and devices[13].

5

Page 14: Master thesis

1.3 Background

Figure 1.1: Environmental Dashboard

Figure 1.2: Energy Jar

Energy Jar

This is an example of a dedicated hardware to indicate the consumption of the energy.Energy jar shows the consumption and actual energy rating of the electronic device it isattached too[14]

Energy BattleThis is an example of online gaming to motivate energy conservation.[15]

Figure 1.3: Energy Battle

6

Page 15: Master thesis

1.4 Scope of the Thesis

Figure 1.4: Fogg’s behaviour model

Flaw in the above designs to motivate energy conservation is the popularity and reachof the above applications to the youth. To access above mentioned games or hardwareon has to go the dedicated website or buy dedicated hardware. This reduces the reach-ability of the concept.

Go Green aims to remove the above flaw and expand its scope.

1.4 Scope of the Thesis

The Unique selling point of the Go Green model is its integration with Social Networkplatforms. Social comparisons are comparative Feedback which is described as feedbackabout individual performance relative to the performance of others[16]. It uses socialnorms which tell us what kind of behavior is performed by others (descriptive norms)as well as what behavior is appreciated by others (injunctive norms)[17].

Go Green model aims at providing the sufficient amount of motivation with gamifica-tion, recommender systems and social network platform which triggers good amount ofability as mentioned in fogg’s model.

7

Page 16: Master thesis

2 State of the Art

2 State of the Art

2.1 Gamification

Gamification defination is inspired by [18] which is as follows "Gamification involves ap-plying game like thinking to non-game context. This approach helps changing the uniqueselling point of the non game context and make it more fun. Gamification has becomea trendy subject with classes and subjects being taught on Gamification. Gamificationcan potentially be applied to any industry and to create fun experiences, enhancing userexperiences".[18]

Gamification has been defined in a number of different ways.

The Gamification Wiki defines "Gamification as the infusion of game design tech-niques, game mechanics, and/or game style into anything. This definition is purposelybroad to support the many uses of the word outside of the context of business"[18]. Afew other definitions of Gamification are: Gamification is a technique to convert nongame context into game like.

The term refers to incorporating game elements and mechanics into non-gaming web-sites and software.Examples of how to use the term Gamification:

• "To create lottery for people following rules"

• "Employee of the month concept to create fun environment at work place"

Gamification is “The use of game elements and game design techniques in non-gamecontexts”[1] . There are 3 aspects to this definition which are as follows:

• Game Elements

• Game Design Techniques

• Non game context

All the 3 aspects can be explained by using examples.

8

Page 17: Master thesis

2.1.1 Game Elements

Figure 2.1: Cityville by Zygna

2.1.1 Game Elements

Game elements basically mean toolbox to create a Game. Figure 2.1 is a screenshot ofonline game Cityville2 developed by Zygna.

As seen in figure 2.1 we can see it is a typical game with virtual graphical representa-tion, one can just look at it and decide it is a Game. So what are the components, theyare as follows:

• Points

• Rewards/Badges

• Resource Collection

• Social Graph – To show what his/her friends are doing and making game compet-itive.

• Levels

• Avatars – Virtual representation of one’s self online.

9

Page 18: Master thesis

2.1.2 Game Design Techniques

Figure 2.2: Nike+ Application of Nike

2.1.2 Game Design Techniques

One cannot make Game just by adding game elements listed in previous section andclaim it to be gamified. To support this statement, I would like to mention that mostused application in Windows is “Solitaire” . And if one looks at Solitaire would find ithas least amount of game elements. Reason of success of Solitaire is its design.

Hence designing a game is as essential as implementing it and its not only putting allgame elements together but putting them in a way that it makes sense.

2.1.3 Non-Game Context

Gamification is not about making everything like game or to have a virtual representa-tion in virtual world. But is more like connecting virtual world to real world context.To explain this more clearly I would like to give example of Nike+ . Nike created ac-celerometer so that they can track you and update you about your running distances,etc. Screenshot presented in figure 2.2

Now the above game developed by Nike can be termed as gamification because it hasbasic game elements mentioned in Game elements section. It is not traditional game asit is neither completely virtual as people are actually running and it is not completelyout of the virtual world as people compete on this app to see how runs fastest.

This is a classic example of applying game elements and game design techniques onnon game context to make it more appealing.

10

Page 19: Master thesis

2.1.4 Gamification in Context

2.1.4 Gamification in Context

Gamification can be summarized as follows:

• Applying sense of game whether it is by giving game elements or by its design, toa Non- Game context.

• Applying any kind of game elements or game design techniques to a non-gamecontext doesn’t mean gamification is done. There should be feasibility testing andproper context to why gamification would work in particular scenario.

• Gamification cannot be entirely in virtual world or real world. As we are gamifyinga non-game context or rather a real world problem, gamification should connectthe real world to virtual world to enhance the experience of real world. This is themost basic and essential part of gamification.

2.1.5 Serious Game

Serious game can be said alike Gamification. The concept of Serious Game was devel-oped before Gamification. Serious Game can be defined as games which are used toteach or bring positive change via a game environment.

Serious Game and Gamification have the model for behaviour change which is same.This model is already existing since 1995 as shown in the figure.

For e.g. U.S. Army developed Battle Field games to train soldiers to give them feel tobattlefield and try and train them. Also Serious Games are usually simulations whichcreate virtual environment to give the player feel about real world.

Hence Serious Game doesn’t really combine virtual world and real world but rathercreate a bridge between them to make transition of the participant easier.

2.2 Recommender Systems

In the present era of internet and abundance information, user has the opportunityto select which music to listen to, which consumer product to consume, which serviceprovider to select, etc. But he also faces endless possibilities to make a choice.

One can go by literal sense and assume that it is a system that provides recommenda-tions. Of course this will be true but the unique selling point of recommender system is"personalization". Recommender systems allows businesses, concepts and organizationsto study individual’s choice and present them suggestions based on their likings.

11

Page 20: Master thesis

2.2 Recommender Systems

Figure 2.3: Serious Game Model [1]

12

Page 21: Master thesis

2.2.1 State of the Art: Recommender Systems

Recommender Systems doesn’t work on query based operations but it works on inputcriteria and learning algorithm to provide maximum likelihood suggestions customizedfor the user.

Computational Recommender Systems addresses this issue. I believe this systems areinspired from the social behaviour of the human beings. We live in a society and ourchoices are highly influenced by the people and environment surrounding us. Recom-mender Systems tend to use and exploit this scenario, it studies individual’s and hisfriends choices to suggest him most probable product he would choose.

The factor of friends is added to the recommender systems due to recent boom insocial networking platforms thanks to Facebook, Orkut, Google plus and many more.

Before the era of Social Networking platforms, Recommender Systems worked on theconcept of similar consumer items bought by the people. For example in Amazon aconsumer trying to buy a product is presented with products other users bought afterbuying the product a consumer is viewing presently. Similar concept is used by Super-market owners in order to arrange the products in best optimal way so that they canget maximum sales.

Point being here is as human beings we have natural desire to follow current trends,getting inspired by people and society around us. Recommender Systems and its algo-rithms which are being implemented currently are highly sophisticated as the amountof the data available for a user is immense which allows to give a very personalize sug-gestion to a user.

2.2.1 State of the Art: Recommender Systems

Figure 4.1 present the model of the recommender system. The block of RecommenderSystems consists of various types of algorithms which defines the type of the recom-mender system.

Before going into the Major types of recommender systems, it would be appropriateto understand the history behind it. Recommender Systems came into the limelight inthe research area since the publish of papers on Collaborative Filtering in mid 1990s.[[19],[20],[21]] The roots of recommender systems can be traced back to the extensivework in cognitive science[22],approximation theory[23], information retrieval[24], fore-casting theories[25], and also have links to management science[26] and to consumerchoice modelling in marketing[27], recommender systems emerged as an independentresearch area in the mid-1990s when researchers started focusing on recommendationproblems that explicitly rely on the ratings structure[5].

13

Page 22: Master thesis

2.2.1 State of the Art: Recommender Systems

Flow Diagram-Recommender System.png

Figure 2.4: Recommender System Model

14

Page 23: Master thesis

2.2.1 State of the Art: Recommender Systems

More formal defination is taken from [5], "the recommendation problem can be for-mulated as follows: Let C be the set of all users and let S be the set of all possibleitems that can be recommended, such as books, movies, or restaurants, in our case greensuggestions. The space S of possible items can be very large, ranging in hundreds ofthousands or even millions of items in some applications,such as recommending booksor CDs. Similarly, the user space can also be very large—millions in some cases. Letu be a utility function that measures the usefulness of item s to user c, i.e., u : C xS→R, where R is a totally ordered set (e.g., nonnegative integers or real numbers withina certain range). Then, for each user c ∈ C, we want to choose such item s ∈ S thatmaximizes the user’s utility". More formally:

∀c ∈ C, s′c = argmaxs∈Su(c, s) (2.2.1)

Recommender systems are usually classified according to their approach to ratingestimation[5]. The commonly accepted formulation of the recommendation problem wasfirst stated in [[19], [20], [21]] and this problem has been studied extensively since then.Moreover, recommender systems are usually classified into the following categories, basedon how recommendations are made, the basis are taken from [28]:

• Content-based recommendations: the user is recommended items similar to theones the user preferred in the past;

• Collaborative recommendations: the user is recommended items that people withsimilar tastes and preferences liked in the past;

• Hybrid approaches: these methods combine collaborative and content-based meth-ods

In addition to recommender systems that predict the absolute values of ratings thatindividual users would give to the yet unseen items (as discussed above), there has beenwork done on preference-based filtering, i.e., predicting the relative preferences of users[[29],[30],[31], [32]]. For example, in a movie recommendation application preference-based filtering techniques would focus on predicting the correct relative order of themovies, rather than their individual ratings.[5]

Several recommendation systems use a hybrid approach by combining collaborativeand content based methods[5], which helps to avoid certain limitations of content-basedand collaborative systems [[28],[33], [34],[35], [36],[37], [38]].

15

Page 24: Master thesis

2.3 Social Network Platform

2.3 Social Network Platform

Social networking is a phenomenon which has existed since society began[39].The Inter-net supports social interaction that is scalable from the micro level (two way conversation)to the macro level (creating a global online social network). Internet users indicate anincreasing willingness to create a persistent digital identity that enables long term socialinteraction [[40],[41]]

Since the introduction of Social Networking sites such as Facebook, MySpace, Orkutetc there is a new phenomena introduced to the world of Computer science. SocialNetworking Websites have created a science of its own and a platform which has thepotential to achieve much more than mere interaction of an individual with other people.

Billions of users have integrated this websites and its activities in their daily routinesand it has become a habit of Millions of users.

2.3.1 State of the Art Social Network Platform

Definition of Social network sites can be as follows which is taken from [42]:

This sites are web-based services that allow individuals

• To construct a public or semi page within a bounded system

• articulate a list of other users with whom they share a connection, and

• view and traverse their list of connections and those made by others within thesystem.

The nature and nomenclature of these connections may vary from site to site.

Figure 5.1 shows the functioning of Social network Sites and Figure 5.2 shows thetime line of the inception of various social network websites and their growth.

Hence integrating Go Green Model into Social Network platform gives the model anunprecedented boost and an obvious choice of development.

2.3.2 Facebook App Architecture

Facebook has emerged over the last several years as the dominant social space[4].Facebookhas grown immensely since its inception. The growth and the story behind the facebookgrowth is the constant need of the human nature to know about their friends, family,

16

Page 25: Master thesis

2.3.2 Facebook App Architecture

Figure 2.5: Characteristics of Social Network Sites is taken from [2]

loved ones etc. Also a need to feel like celebrity status. Facebook gives the individualto showcase themselves in virtual world. Now with the amount of time people spend onfacebook have given birth to new era of business: Online Social gaming This gamingarchitecture involves everyone, also the ones who were never gamers. Social games likeCityVille, Famrville which are not hardcore gaming but still are selling like hot cakes.And companies like Zygna are thriving on these games. Reason being the non game con-cepts like create own farm or city is gamified on a social network to make it interesting.

Facebook App Development consists of following elements:

Below given Traditional Software development and Rest call explanation is taken from[4].

• Traditional Software Development

– Libraries available for most languages - Perl, PHP, Java, Ruby, .NET, others

– Javascript Client API and/or FBJS

– HTML and FBML

• API Communication

– Traditional REST calls

– Certain calls require authentication

– App requires API Key

– Communication Libraries

• Social Integration Points

– Canvas Page

17

Page 26: Master thesis

2.3.2 Facebook App Architecture

Figure 2.6: Time line of Social Network Sites is taken from [3]

18

Page 27: Master thesis

2.4 NLI/NLP

∗ Full Monetization Potential

∗ Developers have full control on this page

– User Profile

∗ Profile Box

∗ Post stories to the Wall, aka, “Mini-Feed”

∗ Tabs

∗ Create Custom Publisher Box

– Send Notifications and Requests

In 2000, Roy Fielding,[4] one of the key contributors to HTTP and URI, codified thearchitecture of the Web in his doctoral thesis titled “Architectural Styles and the Designof Network-Based Software Architectures.” In this thesis, following is quoted [4]" he in-troduced an architecture style known as Representational State Transfer (REST). Thisstyle, in abstract terms, describes the foundation of the World Wide Web. The tech-nologies that make up this foundation include the Hypertext Transfer Protocol (HTTP),Uniform Resource Identifier (URI), markup languages such as HTML and XML, andweb-friendly formats such as JSON. REST is an architectural style for networked ap-plications. It consists of several constraints to address separation of concerns, visibility,reliability, scalability, performance, etc."

For Facebook App Development, Faceconn’s library and Facebook api is used.The canvas element uses a Cartesian coordinate system .The Cartesian coordinate systemconsists of two planes that are perpendicular to each other . The planes are commonlyreferred to as the x-axis and y-axis in two-dimensional space, with an origin of (0,0)where the x- and y-axes cross.The different sections of the coordinate system, with pos-itive x- and y-values in the top-right quadrant, and positive x and negative y in thebottom-right quadrant.

2.4 NLI/NLP

Defination of Chatbot is taken from [43]"Chatbots are known by a wide variety of termsincluding virtual assistants, virtual agents,conversational agents, avatars, virtual per-sonalities, web-bots and even ERAMS. We prefer chatbot as it is the simplest and mostcommonly understood term – and also suggests the right level of sophistication. We re-serve avatar for the visual, electronic representation of a character – be they operated bya real person or a chatbot".[43]

Defination of Chatbot program is as follows which is taken from [43]"A chatbot is aprogramme that tries to conduct a natural language conversation with a user. It lets theuser enter normal questions and statements (such as “how are you”, “what is the weather

19

Page 28: Master thesis

2.4 NLI/NLP

Figure 2.7: Facebook Architecture is taken from [4]

20

Page 29: Master thesis

2.4 NLI/NLP

like”, “what is the price of the bookcase”, “I’m feeling down today” ), and responds in asimilar natural language style[44] (e.g. “I feel fine, thank you”, “it is cloudy and raining”,“the bookcase is £19.99”, “why do you feel down”).The aim of Chat bot is to create a sys-tem which will be exact replica of human interactions and one cannot detect whether itshuman or robot"

I define a chatbot which is inspired from [45] as having four main components. Theseare shown diagrammatically below.The elements are:

• Readable script by User – a way of getting information into and out of the chatbot,typically text typing input, and speech and visual output. Voice input is comingthough.

• A range of answers – the information that the chatbot knows, e.g. about itself,about the world, and about your products and services.

• Modules – to provide added functionality (such as remembering users) and also tolet the chatbot interface to the outside world (e.g. to get the news, use Google, reada database, send emails etc.)

• A set of Management tools – to see what conversations the chatbot has had, andimprove its performance through analysis and reprogramming – chatbots are aniterative process.

The idea of chatbots has been around for a long time.

The reasons why Chatbot has huge potential now is taken from [43] "Chatbots arenow ripe for exploitation by businesses:

• First the technology to deliver chatbots as dynamic and speaking avatars is nowready for mass-market use – making chatbots a far richer and engaging experiencethan lines of text on a screen

• Second, rich avatars need reasonable bandwidths to deliver the audio and animation– the widespread adoption of broadband by businesses, and domination of broadbandin the domestic market means that this richness can now be delivered across thenet to almost any user.

• Third, chatbots have moved from proprietary platforms to Internet based technolo-gies, such as Macromedia Flash for the avatar graphics and audio, and XML di-alects for data storage.

" All this means that Chatbots are excellent way to add unique selling point to GoGreen Model and ideal to enhance user experience in Go Green Model.

21

Page 30: Master thesis

2.5 Carbon Footprint

2.5 Carbon Footprint

Carbon Footprint can be termed as total amount of Carbon emissions or Green housegas emissions emitted by an individual, event, community or institute.

Following details about greenhouse gases are taken from [47]Processes causing green-house gas (GHG) emissions benefit humans by providing consumer goods and services[46].This benefit, and hence the responsibility for emissions, varies by purpose or consump-tion category and is unevenly distributed across and within countries. We quantify green-house gas emissions associated with the final consumption of goods and services for 73nations and 14 aggregate world regions. National average per capita footprints vary from1 tCO2e/y in African countries to approximately 30/y in Luxembourg and the UnitedStates [47].

The Overview about Global Carbon footprint expenditure is taken from [48]" The ex-penditure elasticity is 0.57. The cross-national expenditure elasticity for just CO2, 0.81,corresponds remarkably well to the cross-sectional elasticities found within nations, sug-gesting a global relationship between expenditure and emissions that holds across severalorders of magnitude difference. On the global level, 72% of greenhouse gas emissionsare related to household consumption, 10% to government consumption, and 18% to in-vestments. Food accounts for 20% of GHG emissions, operation and maintenance ofresidences is 19%, and mobility is 17%. Food and services are more important in de-veloping countries, while mobility and manufactured goods rise fast with income anddominate in rich countries. The importance of public services and manufactured goodshas not yet been sufficiently appreciated in policy" [48]. Policy priorities hence dependon development status and country-level characteristics.

Analysis about household consumption is taken from [49]"Analysis of household con-sumption and its environmental impact remains one of the most important topics insustainability research. Nevertheless, much past and recent work has focused on do-mestic national averages, neglecting both the growing importance of international tradeon household carbon footprint and the variation between households of different incomelevels and demographics.The global location of emissions, which cannot be calculated us-ing standard input-output analysis, and the variation of household impacts with income,have important ramifications for polices designed to lower consumer impacts on climatechange, such as carbon taxes. The effectiveness and fairness of such policies hinges ona proper understanding of how income distributions, rebound effects, and internationaltrade affect them."

Now a days Carbon footprint is used as yardstick to measure an individual or orga-nization’s impact on the environment. Interestingly business models have emerged withCarbon footprint analysis and Carbon offsetting.[50]

Theoretically it is possible to calculate the Carbon footprint of an individual or orga-

22

Page 31: Master thesis

2.5.1 State of the art: Carbon Footprint Analysis

nization but practically it is next to impossible to calculate exact carbon emissions asthere is huge amount of data and variance in each case.

After Carbon Footprint there is a trend of Life Cycle Assessment which is emergingand becoming more popular. In Life Cycle Assessment, any product or individual’s de-tailed Carbon foot printing analysis is done.

In my thesis I haven’t concentrated on Carbon Footprint calculations in particularbut I am using it as a reference for the Gamification of the concept.

Further ahead we would be analyzing following factors:

• State of the art: Carbon Footprint Analysis

• My take on: Carbon Footprint Analysis

• Proposed model of Carbon Accounting with Go Green

2.5.1 State of the art: Carbon Footprint Analysis

Following text regarding research model developed in Northwest Ohio is taken from[51] ."Climate change is a serious worldwide concern and the emission of greenhousegases (GHG) significantly intensifies the issue. Numerous studies have been conductedconcerning GHG emissions related to energy and fuel consumption, but few have beenconducted related to the impact of increased recycling levels on GHG emissions for asingle facility. Several readily available GHG calculators are available for organizationsto estimate overall GHG emissions for facilities, but these calculators generate varyingresults and do not fully account for the impact of increased recycling levels, region specificdata, or material stream separation, and the associated economic benefit. This researchdeveloped a model to estimate the GHG emissions for facilities related to municipal solidwaste (MSW) disposal and recycling. The results from the model are compared to ex-isting Internet based GHG calculators that include MSW data. In addition, the modelestimates the GHG reductions and potential economic benefit derived from increased re-cycling for a case study in Northwest Ohio."

Carbon footprint models are increasingly being used to manage personal and house-hold carbon dioxide emissions. Six models were compared for their suitability for use inIreland using typical data for a household of three people and analysis text is taken from[52]. "The annual house hold energy and transportation emissions ranged from 10,540to 17,361 kg CO2 yr1 (mean 12,886; sd 2135) rising to a total footprint of 12,053 to 27,218 kg CO2 yr1 (mean 18,117; sd 5106) when aviation emissions were included. Thisrepresents a potential range for individual CO2 emissions of between 4018 and 9073 kgCO2/person/annum, a variation of over 5 tonnes/person. The information providedby these models proved to be inconsistent and often contradictory. The high variabil-ity between models was due to a number of anomalies. When these were corrected mean

23

Page 32: Master thesis

2.5.1 State of the art: Carbon Footprint Analysis

household energy and transportation emissions fell to 12,130 kg CO2 yr1 (sd 805), with atotal household footprint of 16,552 kg CO2 yr1 (sd 1101). Models vary in their complexityin terms of what is included in the overall estimation of emissions making a full analysisof the primary carbon footprint very difficult. When compared to current Irish conver-sion factors the corrected models either underestimated or overestimated CO2 emissionsby approximately 10%. Current carbon footprint models excluded emissions from CH4and N2O underestimating CO2 emissions for the household by 1.8%".

A socio-economically disaggregated framework for attributes CO2 emissions to peo-ple’s high level functional needs[47].

24

Page 33: Master thesis

3 Master Thesis Contribution

3 Master Thesis Contribution

3.1 Concept

"Being Green" via Go Green model may be a stepping stone towards changing commu-nity’s attitude towards energy conservation.

This model has been designed to promote energy conservation in most simplest way.It has the capability to integrate varied categories of users from experts in energy con-servation to beginners.

"Go Green" model is unique as it integrates various varied approaches such as gam-ification, recommender system, social networking platform and QR codes to promoteenergy conservation.

In the area of inspiring energy conservation there exists websites and dedicated hard-ware to monitor and encourage energy conservation.

But all the solutions provided in the field of energy conservation requires separatewebsites or dedicated hardware. This is where "Go Green" model is different as it isvery simple yet incorporates very varied approaches.

3.1.1 What is Go Green Model?

Go Green model is proposed to inspire energy conservation in fun, social and personal-ized way. Go Green model has following components:

• Carbon Footprint: is only used as a yardstick to measure and simplify Go Greengame logic. In non-game context too, Carbon Footprint is considered as yardstickto measure individual or community’s impact in environment.

• Gamification: Inspiring energy conservation is a non-game context to gamify thecontext a game logic model is proposed.

• Recommender System: Inspired by user- movie recommender system, user-suggestion(green gestures) recommender system is proposed along with correlation and lo-gistic regression module.

25

Page 34: Master thesis

3.1.2 Overview of Go Green Model

Figure 3.1: Go Green Model Overview

• Facebook App: To motivate social networking platform is used. Game Logic isdesigned with respect to social networking dynamics to enhance the effect.

• NLI/NLP and QR code: NLI/NLP technology is explored to enhance the userexperience and motivate the user for energy conservation via chat bot script onthe website. QR code technology is explored to create presence of Go Green andto verify accomplishment of Green Gestures.

3.1.2 Overview of Go Green Model

Overview of Green Model is presented in figure 1.1. The proposed model of Green Modelencorporates the components mentioned in Go Green Model.

Explanation of Go Green Model:In this section I explain in detail, Go Green Model blocks presented in the figure 3.1.

26

Page 35: Master thesis

3.1.3 Scenario Explanation of Go Green Model

• User’s Facebook Profile Connect: This block is activated when the user ini-tially enters the Go Green Facebook app.As the user enters the Go Green app, hegives the permission to Go Green app to access user’s profile and store it in theuser db.

• Recommender System Module: This module has correlation algorithm andcollaborative filtering algorithm. Correlation Algorithm initially presents a user-suggestion correlation matrix.This matrix is used by Collaborative Filtering Algo-rithm and present top 5 suggestions for the current user.

• Go Green Game: This is the Online Facebook game module, from the recom-mender system module suggestions are passed on to Go Green Game.

• User/Go Green Suggestion Feedback: This module identifies which sugges-tion is accepted by the user and depending on that user is allocated green coins.

• Carbon Footprint Calculator Feedback: This module returns the value ofgreen coins to be allocated based on the suggestion completed by the user.

• QR Code Feedback: This module provides completion information of the sug-gestion accepted by the user.

• Allocation of coins and growth: This module updates the facebook wall ofthe user with green coins. This module also initiates growth module to keep trackif the suggestion completed by the user is liked by others or not.

3.1.3 Scenario Explanation of Go Green Model

Scenario 1: Alice joins Green World App on facebook and starts collecting “GreenCoins”.Once Alice joins Green World, system has access to her user profile. The System requiresher age, country of residence and current location. If this information is missing fromher profile, System requests for her data, if the data is denied then based on availabledata about Alice is given her “Green Suggestions” such as “Let’s walk to the college todayAlice”, “Let’s take stairs instead of Elevators today”, “How about switching off lights for30 seconds” etc. Alice selects one of the suggestions based on her selection she is given“Green Coins”. Also based on her selection she is told how much energy she saved.

27

Page 36: Master thesis

3.1.3 Scenario Explanation of Go Green Model

Her “Green Coins” are her “Green Achievements” which is published on her wall.If she likes her “Green Achievements” she is awarded one more green coin for promotinggreenness.Due to her “Green Achievements” she gets “Green invites” which she can distribute toher friends on facebook via messages and get green coins for these gestures.Learning:Above scenario from the perspective of Computer Science requires Algorithm whichcould select suggestions from suggestions database based on user profile, weather andtime of the location of the user.Then award green coins based on the formula which relates the CO2 emission of thesuggestion selected which if not executed could have caused.

Scenario 2: Alice invites Bob to join Green World App.As Alice as received green invites, she invited Bob to join the Green World App.Bob gets interested and joins the app. Alice gets green coins for motivating and Bobgets green coins for being motivated.Learning:Database needs to be created which can handle point/coin system.

Scenario 3: Alice and Bob receive Green paper at the end of the week.It has been a week Alice and Bob have joined the Green World App and today they havereceived Green paper weekly update about their fellow “Green Citizens”. They receivestories about their friends only. There is a section about top stories of the Green Worldwhich features Green Gestures which earned maximum Green Coins.Learning:Algorithm which can isolate from all the stories only the story related to individual whois getting the green paper.

Scenario 4: Alice gets sponsored by BobAlice has a green idea which she wants to implement into green act. For this she offersher green idea on the green board. Bob looks at the green idea of Alice and offers tosponsor her. Alice agrees and Bob and Alice are in Sponsor/Sponsored paradigm.After completing her Green Act Alice puts the proof of Greenness and upon approvalfrom Administrator she and Bob gets green coins for their Green Achievements.Learning:Implementing database handling sponsor/sponsored concept so that administrator canadd green ideas to database of green suggestions.

Scenario 5: Alice offers her green coins to carbon off setters.Alice offers her green coins to carbon off setters to do Green Act on her behalf. Carbonoff setters approves her request and sends her the proof of carbon offsetting. After ap-proval from administrator Alice gets more green coins for her input.Learning:Collaboration with carbon off setters and database architecture to support above men-

28

Page 37: Master thesis

3.1.4 Use Case Diagram

Figure 3.2: Proposed Use Case Diagram Green World

tioned arrangement.

3.1.4 Use Case Diagram

Use Case Diagram in Figure 1.2. presents a players sequence model.

3.1.5 ER-Diagram

ER-Diagram in figure 1.3 presents Database model structure.

3.2 Gamification and Go Green

In this section, we would justify gamification of Go Green and also point out the ele-ments which we incorporated to gamify Go Green.

3.2.1 Concept of Go Green for Gamification

Go Green is created with the aim to access impact of following concepts on spreadingawareness about energy conservation:

29

Page 38: Master thesis

3.2.1 Concept of Go Green for Gamification

Figure 3.3: Proposed Entity-Relationship Diagram

30

Page 39: Master thesis

3.2.2 Game Elements in Go Green

• Gamification: To use game elements, game design and competitive nature of play-ing games in encouraging conservation of energy. Also, it aims on bringing be-havioural change in the participant of the game.

• Social Network impact: Explained in section of Social Network

• Recommender System: Explained in section of Recommender System

3.2.2 Game Elements in Go Green

As mentioned in the above section, Gamification involves adding game elements to non-game context. So for Go Green App following are the Game Elements:

• Green Coins

• Green Badge

• Green Leader Board

• Green Bank

• Social Graph: Knowing what other Green Friends are doing

• Green Challenges: Suggestions from Recommender system.

Snap shot of above described Game elements:

3.2.3 Game Design in Go Green

As mentioned in the above section, Gamification involves adding game elements andgame design technique to non-game context. So for Go Green App following is theGame design:

• Once User enters Go Green, he gets Green Coins for joining the App.

• Then based on his profile, Recommender System suggests him his green challenge.

• Submission of his each green challenge moves him ahead. For his completed chal-lenges, he is awarded green coins.

• He can earn more green coins by recommending Go Green to his friends.

• When he has earned lot of green coins he can go to Green Bank to offset his CarbonFootprint.

31

Page 40: Master thesis

3.2.3 Game Design in Go Green

Figure 3.4: Go Green Growth Model Icons

32

Page 41: Master thesis

3.2.3 Game Design in Go Green

Figure 3.5: Go Green Growth Model Icons

Figure 3.6: Go Green App Icon

33

Page 42: Master thesis

3.2.4 Non Game context in Go Green

• For offsetting carbon footprint he has to calculate his carbon footprint or take upaverage carbon foot print values to offset.

• Each green coins is equivalent to 1.5 tons of Carbon. When he offsets carbonfootprint he earns Green Badge and his position is moved ahead in Leader Board.

• He can also donate or gift his green coins to a friend.

• Every green act is rewarded with Green Coin, Green Badge or position in LeaderBoard.

• There are no negative points or marking in the game as studies shows SeriousGames/Educational Games should be built with utmost positive environment toencourage or motivate participants.

3.2.4 Non Game context in Go Green

Go Green is a game created to promote energy conservation and change the behaviourof participant towards usage of energy.

Hence the Non game context is promoting energy conservation and motivating to takesmall steps to create bigger impact.

3.2.5 Why Go Green is not Serious Game – My take

According to the Gamification course conducted by Prof. Kevin Werbach of WhartonSchool of University of Pennsylvania, Serious Games are defined as games which educatethe participant and help transition to real world. For E.g. U.S. Defence Departmentuses flight simulators and Battlefield simulators to teach Pilots and hundreds of Soldiers,battlefield strategies. In this simulator, soldiers react as they would react in real worldand learn, improve and develop their battlefield strategies. So there is interaction be-tween real world and virtual world even in Serious Game but more towards developinga skill.

Now Go Green does have interaction between Virtual world and Real world as playersare suggested suggestion from virtual environment which he has to accomplish in realworld and provide feedback back to virtual world, but this is not for the purpose of tran-sition. Go Green aims at modifying behaviour of players towards energy conservation.

For E.g. in Sweden, on highways there was a lottery machine installed which captureslicense plates of vehicles that were not speeding. This led to reduction in high speedingby 20 percentage. In long term even after removal of this lottery machine, increase inspeeding was not observed as behaviour of the Car travellers was modified.

34

Page 43: Master thesis

3.3 Recommender System model for Go Green Model

Go Green too aims at similar affect, in such a way that conserving energy becomeshabit of the players. To get this effect faster gamification, social network platform andrecommender system provides ideal composure.

3.3 Recommender System model for Go Green Model

3.3.1 Why Recommender Systems for Go Green Model

The use of context is important in interactive applications[53]. It is particularly impor-tant for applications where the user’s context is changing rapidly, such as in both handheld and ubiquitous computing. In order to better understand how we can use contextand facilitate the building of context-aware applications, we need to more fully under-stand what constitutes a context aware application and what context is. In Go GreenModel, probability distribution helps in creating a context aware recommendations.[54]

Recommender Systems helps to give personalize recommendations, that is good butwhy use it in Go Green Model. Concept of Go Green is to promote energy conservationand inspire people to address the issue of Global warming at grass root level.

To popularize this concept recommender systems can play a big role as it can helpthe concept to be more personalize so that people can address the issue in their ownway. Major issue with the concept of inspiring energy conservation is its low popularityand understanding among the majority of the people. As till now Global warming andClimate change are presented to the larger people in numbers and something which sci-entists are concerned off.

The idea of Go Green is to present this issue is personalized and gamified way. Ifpeople are presented with suggestions they would like to follow and which their friendsare following, it can create a big boost to energy conservation.

For Go Green Model we tend to implement recommender system to create a worldto possibilities and choices in energy conservation as we have in options in which musicto listen too, which restaurant to go too, which consumer products to buy and whichservices to go too.

For Go Green Model, I have chosen Hybrid approach of Recommender System.

First is the User-Suggestion Correlation Model, which helps to find correlation coef-ficient between the user and suggestion. The User- Suggestion model code is presentedin the Appendix.The User Correlation model and the equation is further explained in detail in Correla-tion based User - Suggestion model.

35

Page 44: Master thesis

3.3.2 Correlation Based User-Suggestion Model

3.3.2 Correlation Based User-Suggestion Model

In this section, I will be presenting a model designed to suggest highest correlationbetween User and Suggestion. High correlation between user and suggestion suggestsmaximum probability of the suggestion being accepted by user. This model is requiredto setup initial database as at the start of the Game we cannot apply collaborativefiltering algorithm as we don’t have different ratings of user for suggestions to predicttheir rating for upcoming suggestion.

Each user based on their facebook profile have a parameter vector of age, locationand weather. Each suggestion have a feature vector based on age, location and weather.Correlation between user’s parameter vector and Suggestion’s feature vector is found byfollowing Correlation function:

R(i, j) =C(i, j)√

C(i, i)C(j, j)(3.3.1)

Equation 4.1 returns matrix of correlation coefficient and significance value (p-value)which determines how correlated user’s parameter vector is with suggestion’s featurevector.

Features and Parameters for Go Green

User is prompted with the suggestion whose feature vector correlates maximum withuser’s parameter vector.

Features for Suggestion are as follows:

• Probability value for each category in age.

• Probability value for each category in location.

• Probability value for each category in weather.

• Difficulty level of the Suggestion.

• Ratings given by user combined with acceptance rate of the Suggestion.

Parameters for User are as follows:

• Probability value for following suggestion based on his age.

36

Page 45: Master thesis

3.3.3 Collaborative Filtering algorithm implementation for Go Green

Figure 3.7: Collaborative Filtering in Recommender Systems[5]

• Probability value for following suggestion based on his location.

• Probability value for following suggestion based on weather.

• Average difficulty level of all the suggestions accepted and followed by user.

• Acceptance rate of the user for following popular suggestions

User Suggestion Correlation Model for Go Green

Table given in this section shows the Significance(p-value) between each User and eachSuggestion calculated by Correlation Module. Significance value is based on User’sparameter vector and Suggestion’s feature vector.

3.3.3 Collaborative Filtering algorithm implementation for GoGreen

What is Collaborative Filtering algorithm?

From applicability point of view, Collaborative filtering algorithm is used to provideautomatic predictions for users based on their previous ratings and behavior.

Figure 4.1 explains Collaborative Filtering in Recommender Systems.

Collaborative Filtering in Go Green

My implementation of Collaborative filtering algorithm is based on Recom-mender Systems assignment provided in Machine Learning course by Prof.Andrew Ng. For Go Green Model, I have taken a simulated dataset for Suggestions

37

Page 46: Master thesis

3.3.3 Collaborative Filtering algorithm implementation for Go Green

Table 3.1: User-Suggestion Significance Correlation Values TableUser id Suggestion1 Suggestion2 Suggestion3 Suggestion4

User id 1 0.819661 0.223294 0.018079 0.23592Suggestion1 0.819661 1 0.747934 0.300697 0.055988Suggestion2 0.223294 0.747934 1 0.764741 0.055152Suggestion3 0.018079 0.300697 0.764741 1 0.448171Suggestion4 0.23592 0.055988 0.055152 0.448171 1Suggestion5 0.661467 0.038457 0.005542 0.38031 2.18E-05Suggestion6 0.610146 0.144207 0.812909 0.014458 0.446295Suggestion7 0.819496 0.591739 1.05E-06 0.13888 0.919334Suggestion8 0.055609 0.000521 0.109829 0.004742 0.151773Suggestion9 0.048043 0.025181 0.069539 0.588264 3.12E-08Suggestion10 0.331076 0.270399 0.078113 0.51217 0.08913Suggestion11 0.091432 0.370612 0.031212 0.109405 0.00102Suggestion12 0.034278 6E-05 0.659349 0.332537 0.00241Suggestion13 0.12561 0.299879 0.979153 0.053303 0.608881Suggestion14 0.541209 0.800401 0.320134 0.247348 0.778153Suggestion15 0.342305 0.837258 0.480044 0.149277 0.972843Suggestion16 0.007647 0.216557 0.533911 0.593014 0.50726Suggestion17 0.006036 0.94566 0.013723 0.126289 0.36062Suggestion18 0.062655 0.441465 0.18118 0.301455 0.820745Suggestion19 0.057168 0.273989 0.262909 0.003182 0.062145Suggestion20 0.000231 0.774048 0.320347 0.003114 0.948058Suggestion21 0.137332 0.869116 0.757654 0.755054 0.594661Suggestion22 0.009942 0.525427 0.299987 0.32229 0.604224Suggestion23 0.511505 0.140589 0.728106 0.000366 0.553166Suggestion24 0.088651 0.187601 0.044047 0.507134 0.013725Suggestion25 0.106654 0.913243 0.09706 0.000687 0.155362Suggestion26 0.183946 0.796835 0.152425 0.100044 0.931954Suggestion27 0.289979 0.769626 0.265208 0.040162 0.153318Suggestion28 0.126599 0.112118 0.126848 0.224099 0.913685Suggestion29 0.148487 0.039663 0.021062 0.161724 0.00409Suggestion30 0.000547 0.010933 0.047715 0.133604 0.211744

38

Page 47: Master thesis

3.3.3 Collaborative Filtering algorithm implementation for Go Green

where each suggestion is rated from 1 to 5 for 1000 users. The Matrix Y is num-suggestions x num-users where y(i,j) is rating of i-th suggestion by j-th user.The matrixR is an binary-valued indicator matrix, where R(i,j) = 1 if user j gave a rating to sug-gestion i, and R(i,j) = 0 otherwise. The objective of collaborative filtering is to predictsuggestion ratings for the suggestions that users have not yet rated, that is, the entrieswith R(i, j) = 0. This will allow us to recommend the suggestions with highest predictedratings to the user.

X =

− (X1)T−

− (X2)T−

.

.

.

.

− (X i)T−

Θ =

− (Θ1)T−

− (Θ2)T−

.

.

.

.

− (Θj)T−

The i-th row of X corresponds to the feature vector x(i) for the i-th movie,and the j-th

row of Θ(j) corresponds to one parameter vector Θ(j), for the j-th user. Both x(i) andΘ(j) are n-dimensional vectors. For the purposes of simplicity in test run, I have usedn = 100, and therefore, x(i) ∈ <100 and Θ(j) ∈ <100.Correspondingly, X is a nm × 100matrix and Θ is a nu × 100 matrix.

The collaborative filtering algorithm in the setting of Go Green Model considers a setof Suggestions rating.

To create a Suggestion rating table, I have taken example of movie ratings. In Sug-gestion rating table, Suggestions are rated by different users based on their parametersand features of the Suggestion.

Table 4.2 shows the feature vector of each suggestion.Table 4.3 shows User’s parameter vector

Source for suggestion database is 50waystosaveplanet.org.

The collaborative filtering algorithm[55] in the setting of suggestions recommendationsconsiders a set of n-dimensional parameter vectors x(1)......x(nm)and Θ(1)......Θ(nu), wherethe model predicts rating for suggestion i by user j as y(i,j)= (Θ(j))Tx(i).Given a datasetthat consists of a set of ratings produced by some users on some suggestions, we learnthe parameter vectors x(1).....x(nm), Θ(1)....Θ(nu) that produce the best fit(minimizes thesquared error)[56].

39

Page 48: Master thesis

3.3.3 Collaborative Filtering algorithm implementation for Go Green

Table 3.2: Suggestion Feature VectorSuggestionTitle Age_13_20 Age_20_40Adopt a Plant 0.2 0.3

Walk to your desired destination 0.45 0.45CHANGE YOUR LIGHT 0.2 0.45

TURN OFF COMPUTERS AT NIGHT 0.34 0.33DON’T RINSE 0.34 0.33

DO NOT PRE-HEAT THE OVEN 0.34 0.33RECYCLE GLASS 0.34 0.33

DIAPER WITH A CONSCIENCE 0.2 0.6HANG DRY 0.33 0.34

GO VEGETARIAN ONCE A WEEK 0.33 0.34WASH IN COLD OR WARM 0.33 0.34

USE ONE LESS PAPER NAPKIN 0.2 0.6USE BOTH SIDES OF PAPER 0.2 0.6

RECYCLE NEWSPAPER 0.2 0.6WRAP CREATIVELY 0.4 0.4

RETHINK BOTTLED WATER 0.33 0.34BAN BATHTIME! 0.33 0.34

BRUSH WITHOUT RUNNING 0.34 0.33SHOWER WITH YOUR PARTNER 0.2 0.6

TAKE A SHORTER SHOWER 0.33 0.34PLANT A TREE 0.33 0.34

USE YOUR CRUISE CONTROL 0.2 0.6SECOND-HAND DOESN’T MEAN SECOND-BEST 0.4 0.3

BUY LOCAL 0.3 0.6ADJUST YOUR THERMOSTAT 0.33 0.34

INVEST IN YOUR OWN COFFEE CUP 0.1 0.6BATCH ERRANDS 0.2 0.6

TURN OFF LIGHTS 0.33 0.34GREENER LAWN CARE 0.2 0.4

PICNIC WITH A MARKER 0.33 0.34RECYCLE OLD CELL PHONES 0.1 0.5

MAINTAIN YOUR VEHICLE 0.1 0.5RECYCLE UNWANTED WIRE HANGERS 0.2 0.4

TELECOMMUTE 0.2 0.4KEEP YOUR FIREPLACE DAMPER CLOSED 0.1 0.5

CUT DOWN ON JUNK MAIL 0.2 0.4CHOOSE MATCHES OVER LIGHTERS 0.1 0.5

LET YOUR FINGERS DO THE WALKING—ONLINE 0.33 0.34

40

Page 49: Master thesis

3.3.3 Collaborative Filtering algorithm implementation for Go Green

Table 3.3: User paramter vectorUser id firstname Prob_age Prob_loc Prob_wea Prob_sug

1 Dhara 0.78 0.23 0.23 0.782 Ishan 0.54 0.56 0.56 0.343 Mandeep 0.89 0.53 0.23 0.454 Vladimir 0.3 0.8 0.7 0.15 Ifeoma 0.4 0.1 0.4 0.16 Carlos 0.1 0.2 0.7 0.77 Daniel 0.5 0.9 0.7 0.38 Malachi 0.5 0.2 0.6 0.89 Irene 0.3 0.1 0.7 0.410 Kirsten 0.5 0.4 0.8 0.211 Gillian 0.8 0.6 0.5 0.412 Ciaran 0.8 0.3 0.2 0.113 Adam 0.2 0.8 0.2 0.914 Inez 0.3 0.5 0.1 0.315 Nola 0.7 0.9 0.4 0.916 Cheyenne 0.6 0.2 0.2 0.117 Isabella 0.7 0.8 0.9 0.118 Timothy 0.8 0.2 0.4 0.719 Caryn 0.5 0.2 0.9 0.320 Jasmine 0.7 0.6 0.8 0.721 Minerva 0.5 0.4 0.9 0.822 Bruce 0.9 0.5 0.5 0.523 Omar 0.7 0.6 0.6 0.824 Reuben 0.2 0.1 0.2 0.825 Garth 0.9 0.6 0.3 0.326 Willa 0.5 0.9 0.2 0.827 Macon 0.1 0.1 0.2 0.728 Beck 0.6 0.4 0.9 0.829 Ruth 0.9 0.4 0.9 0.930 Halla 0.9 0.1 0.2 0.331 Lois 0.7 0.1 0.9 0.732 Clare 0.1 0.1 0.7 0.433 Wilma 0.2 0.7 0.3 0.334 Hilda 0.4 0.4 0.6 0.735 Latifah 0.9 0.9 0.6 0.436 Victoria 0.5 0.8 0.4 0.837 Margaret 0.1 0.3 0.6 0.238 Randall 0.1 0.2 0.8 0.339 Orson 0.3 0.6 0.8 0.640 Alec 0.5 0.8 0.6 0.1

41

Page 50: Master thesis

3.3.3 Collaborative Filtering algorithm implementation for Go Green

Collaborative Filtering Cost Function

The collaborative filtering cost function (without regularization) is given by[57]

J(x(1)...x(nm),Θ(1)....Θ(nu)) =1

2

∑(i;j):r(i;j)=1

((Θ(j))Tx(i) − y(i,j))2 (3.3.2)

Accumulation of the cost for user j and suggestion i is done only if R(i,j) = 1. Ex-pected output is to see 22.22 .

I have used a vectorized implementation to compute J , since it will later be calledmany times by the optimization package fmincg. As usual, it might be easiest to firstwrite a non-vectorized implementation (to make sure I have the right answer), and themodify it to become a vectorized implementation(checking that the vectorization stepsdon’t change your algorithm’s out-put).I have used the R matrix to set selected entriesto 0. For example, R .* M will do an element-wise multiplication between M and R, sinceR only has elements with values either 0 or 1, this has the effect of setting the elementsof M to 0 only when the corresponding value in R is 0. Hence, sum(sum(R.*M)) is thesum of all the elements of M for which the corresponding element in R equals 1.

Collaborative Filtering Gradient

The gradients of the cost function is given by

∂J

∂x(i)k

=∑

(j:r(i,j)=1)

((Θ(j))Tx(i) − y(i,j))Θ(j)k (3.3.3)

∂J

∂Θ(j)k

=∑

(i:r(i,j)=1)

((Θ(j))Tx(i) − y(i,j))x(i)k (3.3.4)

Function returns the gradient for both sets of variables by unrolling them into a singlevector.

The implementation of gradient is done with a for-loop over suggestions for computing∂J

∂x(i)k

and a for-loop over users (for computing ∂J

∂Θ(j)k

.When the first implementation of gra-dient, we start with an in-vectorized version, by implementing another inner for-loop thatcomputes each element in the summation. After having completed the gradient compu-tation this way, we try to vectorize our implementation (vectorize the inner for-loops),so that we left with only two for-loops (one for looping over suggestions to compute ∂J

∂x(i)k

for each suggestion, and one for looping over users to compute ∂J

∂Θ(j)k

for each user).

To perform the vectorization, following approach is adopted: To compute all thederivatives associated with x(i)

1 ,x(i)2 ,....,x(i)

n (i.e., the derivative terms associated with thefeature vector x(i) at the same time. To define the derivatives for the feature vector of

42

Page 51: Master thesis

3.3.4 Regularized Cost Function

the i-th suggestion as:

(Xgrad(i, :))T =

(∂J

∂x(i)1

)(

∂J

∂x(i)2

)....(∂J

∂x(i)n

)

=

∑j:r(i,j)=1

((Θj)Tx(i) − y(i,j))Θ(j) (3.3.5)

To vectorize the above expression, we start by indexing into Theta and Y to selectonly the elements of interests (that is, those with r(i; j ) = 1). Intuitively, when weconsider the features for the i-th suggestion, we only need to be concern about the userswho had given ratings to the suggestion, and this allows you to remove all the otherusers from Theta and Y. Concretely, we can set idx = find(R(i,:)==1) to be a list of allthe users that have rated suggestion i. This allow us to create the temporary matricesThetatemp = Theta(idx,:) and Ytemp = Y(i,idx) that index into Theta and Y to give youonly the set of users which have rated the i-th suggestion. This allow us to write thederivatives as:

Xgrad(i; :) = (X(i; :) ∗ ThetaTtemp − Ytemp) ∗ Thetatemp (3.3.6)

The vectorized computation above returns a row-vector instead. After we have vec-torized the computations of the derivatives with respect to x(i). We use a similar methodto vectorize the derivatives with respect to Θ(j) as well.

Implementation of Cost function, Numerical Gradient, Gaussian Distribution, Mul-tivariate Gaussian Distribution, Normalization of Ratings of Suggestions and VisualizeFit in Go Green Model is shown in appendix

3.3.4 Regularized Cost Function

The cost function for collaborative filtering with regularization is given by

J(x(1), ...x(nm),Θ(1), ...,Θ(n(u))) =1

2

∑(i,j):r(i,j)=1

((Θ(j))Tx(i)−y(i, j)2)+(λ

2

nu∑j=1

n∑k=1

(Θ(j)k )2)+(

λ

2

nm∑i=1

n∑k=1

(x(i)k )2)

(3.3.7)Regularization of the cost function brings the value to around 31.34 .

43

Page 52: Master thesis

3.3.5 Regularized Gradient

Figure 3.8: Heroku Dashboard

3.3.5 Regularized Gradient

The Gradients for regularized cost function is given by:

∂J

∂x(i)k

=∑

j:r(i,j)=1

((Θ(j))Tx(i) − y(i,j))Θ(j)k + λx

(i)k (3.3.8)

∂J

∂Θ(j)k

=∑

i:r(i,j)=1

((Θ(j))Tx(i) − y(i,j))x(i)k + λΘ

(j)k (3.3.9)

3.4 Social Network Platform

The Facebook app is on Heroku server and is maintained via its dashboard. Figure 5.4is a snapshot of the dashboard. and figure 5.5 is a snapshot of how database can beallotted via this dashboard.

44

Page 53: Master thesis

3.5 Use of NLI/NLP in Go Green Model

Figure 3.9: Heroku Resources and Database Management on Dashboard

3.5 Use of NLI/NLP in Go Green Model

Natural Language Processing/ Natural Language Interactions via Chat bot on Go Greenwebsite. This implementation is done using Acobot Api.[58]

Implementation is useful for following purposes

• Improve recommender system based on log of Chat bot.

• Enhance User Experience

3.5.1 QR Code

In this section I present the QR Code implemented with Visual Lead Api.

Upon Scanning the QR Code, user can visit the Go Green website.

Mobile version of the website:

QR Code is implemented for following purposes

• Increase Social Network impact

• Enhance User Experience

45

Page 54: Master thesis

3.6 My take on: Carbon Footprint Analysis

Figure 3.10: QR Code Go Green

• Create big presence of Go Green

• Implements a mechanism to verify completion of Green Acts

3.6 My take on: Carbon Footprint Analysis

Carbon footprint analysis can be one of the most complex analysis if you wish to calcu-late every detail. It can be simplified if you make educated assumptions.

Usually Carbon Foot print Analysis of a product is done by calculating how muchcarbon is being released during the entire process of making the product to the productreaching the consumer.

In this era of Globalization, it is extremely difficult to justify the Carbon foot printcalculation and its offsetting. To justify my take I present the following example:

As my current location is based in Switzerland, my example is from Switzerland. InMigros and Coop, there are products from varied countries like Kiwis from New Zealand,Litchis from Madagascar clearly the transportation and importation regulations on theseproducts increases its carbon foot print.

So is the solution to grow these products locally? Strangely answer is No as the fruitswhich grow in tropical environment cannot grow naturally in hilly region. To create atropical environment in hilly region, it requires construction of houses which are heatedexternally, this heating process eventually increases carbon footprint of the productsmore than the imported food products.

46

Page 55: Master thesis

3.6 My take on: Carbon Footprint Analysis

Figure 3.11: QR Code Go Green

47

Page 56: Master thesis

3.6.1 Proposed Model of Carbon Accounting Analysis with Go Green

Secondly we talk about how Carbon offsetting mechanism is working, Non profitorganizations are calculating the Carbon foot print of an individual or company andsuggesting how much plants they would grow in under developed countries or develop-ing countries to offset the Carbon emitted by the individual.

Instead of following a complex method carbon offsetting and carbon emissions, GoGreen Model a simple yet effective way for an individual to subside their carbon foot-print.

3.6.1 Proposed Model of Carbon Accounting Analysis with GoGreen

In this section I will present how Go Green is using Carbon Footprint in a gamifiedconcept.

Carbon Footprint is used in following model of Go Green:

• Growth Model

• Game Logic

Above to model shows use of Carbon Footprint in Go Green in most simplest way.

Growth Model

In Growth Model, Player gets Green coins depending on his/her Green Act follower. Fore.g.

If Player A suggested/followed a green act such as "Planting a tree" then his wall isupdated with this green act and corresponding green coins.

Green coins are calculated on the basis of Carbon footprint reduction of the act.

If Player A’s act is followed by other players then A gets bonus green coins equivalentto 25 percent of the carbon footprint reduction.

Game Logic

Green Acts are divided into 3 categories as following:

48

Page 57: Master thesis

3.6.1 Proposed Model of Carbon Accounting Analysis with Go Green

• Low (Green Coins)

• Medium (Yellow Coins)

• High (Blue Coins)

Acts are categorized on the basis of the Carbon Footprint reduction. Higher the re-duction of Carbon Footprint by an act, higher is the value of the coin.

49

Page 58: Master thesis

4 Work Evaluation

4 Work Evaluation

In this chapter I present the evaluation of the thesis work.

4.1 Feasibility evaluation of the concept

Before researching on the topic of Carbon Footprint, Recommender Systems, Social Net-work platform and Gamification, a survey of around 25 students was taken. This surveywas conducted to know the students view regarding Carbon Footprint, their favouritesocial networking site and their percent of activity on social networking site.

The survey questions can be as seen below:

1). Which is your favorite social networking website?

2). which online games you like?

3). Do you prefer online or mobile game?

4). What do they do for green environment?

5). Do you have any idea about Carbon foot print? What is your perception? No research required in Carbon Foot print just state what you think, please.

6). what is your definition of „cool game“?

7). Would you be inspire by a game which is both social and for good cause?

8). Do you update everything on Social Networking website?

9). Do you get competitive in game?

Results of the survey are represented in the form of pie chart in figure 4.1, 4.2, 4.3.

The above survey motivated me to develop Go Green model.

50

Page 59: Master thesis

4.1 Feasibility evaluation of the concept

Figure 4.1: Percentage distribution of Social Networking Site as per survey

Figure 4.2: Activity distribution on Online Games by Students as per survey

Figure 4.3: Willingness of Students to play Go Green as per survey

51

Page 60: Master thesis

4.2 Mock Representation

Figure 4.4: Go Green Concept

4.2 Mock Representation

In this section I present the initial mock representation of the Website, initially Go Greenwas termed as "Greducate" for Green Education

The Mock representation defined the graphics and outlook of the Go Green Model.

4.3 Project Time line

Table given in this section presents the project time line.

4.4 Evaluation of Recommender Systems

Collaborative Filtering algorithm implemented for the Go Green Model is the on thebasis of exercise given in the Machine Learning course by Prof. Andrew Ng of StanfordUniversity.

52

Page 61: Master thesis

4.4 Evaluation of Recommender Systems

Figure 4.5: Project Time line

53

Page 62: Master thesis

4.4.1 Cost Function value

The exercise was modelled for movie suggestion database. I had modified the exercisefor green suggestion database. The Suggestions like movies have features such as age,location, weather and category according to Carbon Footprint. Movies too have featuressuch as romantic, action, drama etc.

Hence the exercise suited well for the Go Green model. According to the exercise, Ipresent the expected values and the actual values of the parameters from the algorithm.

4.4.1 Cost Function value

After loading the Suggestion database the value of the cost function is expected to benear 22.22

The Actual output:

Loading suggestion ratings dataset.

Average rating for suggestion 1 (Adopt a Plant): 3.878319 / 5

Program paused. Press enter to continue.Cost at loaded parameters: 22.224604

After the Cost function, gradient calculation of the user and suggestion without reg-ularization. Both the gradients are expected to be same only then the implementationof the algorithm is correct as the left hand side gradient is generated by the code I haveimplemented and right hand side gradient is analytical value of the gradient.

The Actual output:

Checking Gradients (without regularization) ...5.5335 5.53353.6186 3.61865.4422 5.4422-1.7312 -1.73124.1196 4.1196-1.4833 -1.4833-6.0734 -6.07342.3490 2.34907.6341 7.63411.8651 1.8651

54

Page 63: Master thesis

4.4.1 Cost Function value

4.1192 4.1192-1.5834 -1.58341.2828 1.2828-6.1573 -6.15731.6628 1.66281.1686 1.16865.5630 5.56300.3050 0.30504.6442 4.6442-1.6691 -1.6691-2.1505 -2.1505-3.6832 -3.68323.4067 3.4067-4.0743 -4.07430.5567 0.5567-2.1056 -2.10560.9168 0.9168

I have also implemented the back propagation algorithm and to see if that algorithmis correct or not relative difference between the algorithm and back propagation shouldbe less than 1e-9.

The Actual Output:

Relative Difference: 1.884e-012

Now to check the Cost function implementation with regularization, where the lamdavalue is 1.5, should be around 31.34

The Actual Output:

Cost at loaded parameters (lambda = 1.5): 31.344056

Now to check the gradients with regularization, again the left side which shows thegradient value according to the my implementation should be equal to the right handside which analytically calculated.

The Actual output:

Checking Gradients (with regularization) ...2.2223 2.2223

55

Page 64: Master thesis

4.4.2 Recommendations

0.7968 0.7968-3.2924 -3.2924-0.7029 -0.7029-4.2016 -4.20163.5969 3.59690.8859 0.88591.0523 1.0523-7.8499 -7.84990.3904 0.3904-0.1347 -0.1347-2.3656 -2.36562.1066 2.10661.6703 1.67030.8519 0.8519-1.0380 -1.03802.6537 2.65370.8114 0.8114-0.8604 -0.8604-0.5884 -0.5884-0.7108 -0.7108-4.0652 -4.06520.2494 0.2494-4.3484 -4.3484-3.6167 -3.6167-4.1277 -4.1277-3.2439 -3.2439

The Relative difference with back propagation algorithm is expected to be less than1e-9.

The Actual output:

Relative Difference: 1.83463e-012

4.4.2 Recommendations

After the cost function and gradient calculation with and without regularization is com-pleted. Training of Collaborative Filtering is executed and new recommendations areprovided for the user.

The Actual output:

56

Page 65: Master thesis

4.4.2 Recommendations

New user ratings:Rated 4 for Adopt a PlantRated 3 for RECYCLE GLASSRated 5 for USE ONE LESS PAPER NAPKINRated 4 for TURN OFF COMPUTERS AT NIGHTRated 5 for RECYCLE NEWSPAPERRated 3 for RETHINK BOTTLED WATERRated 5 for SHOWER WITH YOUR PARTNERRated 2 for PAY BILLS ONLINERated 4 for RECYCLE UNWANTED WIRE HANGERSRated 5 for INVEST IN YOUR OWN COFFEE CUPRated 5 for DON’T RINSE

Program paused. Press enter to continue.

Training collaborative filtering...Iteration 1 | Cost: 9.396285e+005Iteration 2 | Cost: 6.666086e+005Iteration 3 | Cost: 3.738138e+005Iteration 4 | Cost: 2.677902e+005Iteration 5 | Cost: 2.162663e+005Iteration 6 | Cost: 1.860012e+005Iteration 7 | Cost: 1.533258e+005Iteration 8 | Cost: 1.393118e+005Iteration 9 | Cost: 1.301015e+005Iteration 10 | Cost: 1.242570e+005Iteration 11 | Cost: 1.123334e+005Iteration 12 | Cost: 1.076199e+005Iteration 13 | Cost: 1.047996e+005Iteration 14 | Cost: 1.014198e+005Iteration 15 | Cost: 9.748547e+004Iteration 16 | Cost: 9.535378e+004Iteration 17 | Cost: 9.406114e+004Iteration 18 | Cost: 9.044542e+004Iteration 19 | Cost: 8.810258e+004Iteration 20 | Cost: 8.661802e+004Iteration 21 | Cost: 8.582420e+004Iteration 22 | Cost: 8.380500e+004Iteration 23 | Cost: 8.258747e+004Iteration 24 | Cost: 8.226757e+004Iteration 25 | Cost: 8.137694e+004Iteration 26 | Cost: 8.085946e+004Iteration 27 | Cost: 8.054899e+004Iteration 28 | Cost: 7.950229e+004

57

Page 66: Master thesis

4.4.2 Recommendations

Iteration 29 | Cost: 7.680273e+004Iteration 30 | Cost: 7.505874e+004Iteration 31 | Cost: 7.450333e+004Iteration 32 | Cost: 7.430923e+004Iteration 33 | Cost: 7.417926e+004Iteration 34 | Cost: 7.408801e+004Iteration 35 | Cost: 7.388377e+004Iteration 36 | Cost: 7.377181e+004Iteration 37 | Cost: 7.369190e+004Iteration 38 | Cost: 7.363752e+004Iteration 39 | Cost: 7.350740e+004Iteration 40 | Cost: 7.342734e+004Iteration 41 | Cost: 7.334142e+004Iteration 42 | Cost: 7.327850e+004Iteration 43 | Cost: 7.320158e+004Iteration 44 | Cost: 7.309433e+004Iteration 45 | Cost: 7.304350e+004Iteration 46 | Cost: 7.301962e+004Iteration 47 | Cost: 7.299902e+004Iteration 48 | Cost: 7.294466e+004Iteration 49 | Cost: 7.286522e+004Iteration 50 | Cost: 7.282507e+004Iteration 51 | Cost: 7.280434e+004Iteration 52 | Cost: 7.278366e+004Iteration 53 | Cost: 7.277208e+004Iteration 54 | Cost: 7.273913e+004Iteration 55 | Cost: 7.269305e+004Iteration 56 | Cost: 7.261713e+004Iteration 57 | Cost: 7.256071e+004Iteration 58 | Cost: 7.249054e+004Iteration 59 | Cost: 7.241182e+004Iteration 60 | Cost: 7.236394e+004Iteration 61 | Cost: 7.234577e+004Iteration 62 | Cost: 7.233107e+004Iteration 63 | Cost: 7.232003e+004Iteration 64 | Cost: 7.229522e+004Iteration 65 | Cost: 7.227202e+004Iteration 66 | Cost: 7.226215e+004Iteration 67 | Cost: 7.225619e+004Iteration 68 | Cost: 7.224982e+004Iteration 69 | Cost: 7.223554e+004Iteration 70 | Cost: 7.221996e+004Iteration 71 | Cost: 7.218638e+004Iteration 72 | Cost: 7.216271e+004

58

Page 67: Master thesis

4.4.2 Recommendations

Iteration 73 | Cost: 7.214804e+004Iteration 74 | Cost: 7.212758e+004Iteration 75 | Cost: 7.211296e+004Iteration 76 | Cost: 7.210035e+004Iteration 77 | Cost: 7.209291e+004Iteration 78 | Cost: 7.208786e+004Iteration 79 | Cost: 7.208096e+004Iteration 80 | Cost: 7.207600e+004Iteration 81 | Cost: 7.207229e+004Iteration 82 | Cost: 7.207014e+004Iteration 83 | Cost: 7.206521e+004Iteration 84 | Cost: 7.206079e+004Iteration 85 | Cost: 7.205799e+004Iteration 86 | Cost: 7.205063e+004Iteration 87 | Cost: 7.204131e+004Iteration 88 | Cost: 7.203311e+004Iteration 89 | Cost: 7.202990e+004Iteration 90 | Cost: 7.202663e+004Iteration 91 | Cost: 7.202195e+004Iteration 92 | Cost: 7.201899e+004Iteration 93 | Cost: 7.201687e+004Iteration 94 | Cost: 7.201491e+004Iteration 95 | Cost: 7.201319e+004Iteration 96 | Cost: 7.201007e+004Iteration 97 | Cost: 7.200868e+004Iteration 98 | Cost: 7.200815e+004Iteration 99 | Cost: 7.200704e+004Iteration 100 | Cost: 7.200643e+004

Recommender system learning completed.

Program paused. Press enter to continue.

Top recommendations for you:Predicting rating 8.6 for suggestion USE RECHARGABLE BATTERIESPredicting rating 8.5 for suggestion USE BOTH SIDES OF PAPERPredicting rating 8.3 for suggestion RECYCLE NEWSPAPERPredicting rating 8.3 for suggestion BUY LOCALPredicting rating 8.2 for suggestion BRUSH WITHOUT RUNNINGPredicting rating 8.2 for suggestion USE YOUR CRUISE CONTROLPredicting rating 8.1 for suggestion USE YOUR CRUISE CONTROLPredicting rating 8.0 for suggestion USE ONE LESS PAPER NAPKINPredicting rating 8.0 for suggestion RETHINK BOTTLED WATERPredicting rating 8.0 for suggestion USE YOUR CRUISE CONTROL

59

Page 68: Master thesis

4.4.3 Test Results of Latency of Collaborative Filtering Algorithm

Original ratings provided:Rated 4 for Adopt a PlantRated 3 for RECYCLE GLASSRated 5 for USE ONE LESS PAPER NAPKINRated 4 for TURN OFF COMPUTERS AT NIGHTRated 5 for RECYCLE NEWSPAPERRated 3 for RETHINK BOTTLED WATERRated 5 for SHOWER WITH YOUR PARTNERRated 2 for PAY BILLS ONLINERated 4 for RECYCLE UNWANTED WIRE HANGERSRated 5 for INVEST IN YOUR OWN COFFEE CUPRated 5 for DON’T RINSE

4.4.3 Test Results of Latency of Collaborative FilteringAlgorithm

Latency output:

Given a training set x1,....,xm where xi ε R), I want to estimate the Gaussian distri-bution for each of the features xi. For each feature i = 1,...n, I need to find parametersµi and σ2

i that fit the data in the i-th dimension x1i ,.....,xmi (the i-th dimension of each

example).

The Gaussian distribution is given by

p(x;µ, σ2) =1√

2Πσ2e−(x−µ)2

2σ2 (4.4.1)

where µ is the mean and σ2 controls the variance.

Significance of this test result is it helps us understand that suggestion features anduser parameter fit the Gaussian model.

Latency Output with Outliers:

Figure 4.7 helps us point out the outliers in the user suggestion database model whichhelps us adjust the lambda value of the cost function with regularization.

Figure 4.8 presents the adjusted Outliers model with adjusted value of lamba to in-corporate the the outliers too in to the model.

60

Page 69: Master thesis

4.4.3 Test Results of Latency of Collaborative Filtering Algorithm

Figure 4.6: Latency Output of Recommender Collaborative Filtering Algorithm

Figure 4.7: Outliers pointed out in Latency Output of Recommender Collaborative Fil-tering Algorithm

61

Page 70: Master thesis

4.4.3 Test Results of Latency of Collaborative Filtering Algorithm

Figure 4.8: Throughput calculation of the θ0 and θ1.

Throughput output of the Collaborative filtering algorithm, during distinguishing ofthe suggestions category.

Gradient increment of θ0 and θ1 Figure 4.9 shows the gradient increment of θ0 andθ1 during the iteration of the collaborative filtering algorithm while being trained withcost function.

62

Page 71: Master thesis

4.4.3 Test Results of Latency of Collaborative Filtering Algorithm

Figure 4.9: Outliers pointed out in Latency Output of Recommender Collaborative Fil-tering Algorithm

63

Page 72: Master thesis

5 Discussions and Conclusion

5 Discussions and Conclusion

5.1 Project Experience

Master Thesis has been a great research experience. Moreover the freedom to formulateown Thesis proposal was the highlight of this experience.

I had the opportunity to choose my own area of research and area of applicability. Ihad learnt a lot in this Thesis.

I wasn’t aware of Gamification, Recommender Systems, Facebook App development,NLI/NLP, QR code, Carbon Footprint and as a matter of fact not even Latex. But atthe end of the thesis I am quite comfortable with each of the research topics and haveconsiderable amount of knowledge both practical and theoretical.

The Journey of thesis has been intense as I had chosen my own thesis proposal andalso being the only student working on this entire concept, I had to figure out each andevery topic by my own self. Every learning experience was precious as I had found theway myself.

Brain storming sessions with professors were very helpful, it help me take up the rightdirection during the course of thesis.

Overall it was a fulfilling experience and inclusion of this project into Bearing pointbe.project finals just ensures that this project has a long way to go.

5.2 Conclusion

The goal of this Master Thesis was to present a model which can motivate online energyconservation is much more simple yet sophisticated way.

The above goal is achieved but the implementation of this model is incomplete dueto constrain of time and enormous amount of research put into the concept. But as theconceptual model and its proof of concept are implemented, road ahead seems not socomplicated.

64

Page 73: Master thesis

5.2 Conclusion

Goal was to incorporate Gamification is a non- game concept which was very muchsuccessful by incorporation of growth model and reward system by green coins model.

Goal was to incorporate Social Network platform to encourage energy conservationwhich was very much achieved by the Facebook integrated Go Green app and dedicatedpage for Go Green on Facebook.

Goal was to incorporate recommender systems to provide contextual suggestion whichwas achieved by matlab implementation of the Collaborative Filtering algorithm andUser-Correlation Suggestion model. Entire recommender systems model is created specif-ically for Go Green after careful study and implementation of various machine learningalgorithms such as linear regression and logistic regression.

Goal was to research and understand in depth Carbon footprint and its calculation.

All in all, this Master Thesis presents a unique model to inspire online energy conserva-tion using concepts such as gamification, recommender systems, social network platformand carbon footprint which has potential to grow and expand as a global standard formotivating energy conservation online.

65

Page 74: Master thesis

6 Future Recommendations and Work

6 Future Recommendations andWork

6.1 Future Work and recommendations

Go Green Model has immense potential to expand both on People and Industrial front.

On the People front, inclusion of the concept of Crowd Sourcing can benefit the projectimmensely.[[59],[60],[61],[62],[63]]

Simple inclusion of Green suggestions from the people can encourage them participatein the website more and expand the green suggestion database immensely.

On Industry level, there are many companies which look after their carbon foot printand even countries have policies to see companies are not harming the environment ontheir way to progress. But every company and country have rules and regulations tailormade for their needs. Developing countries have lenient rules regarding environmentalpolicies as for them development is more important. This lack of Global standards inpolicy can be fulfilled by Go Green Model where each and every country can be mea-sured via Go Green model.

Future work for Go Green Model are as following:

• Improved Graphic integration of the website

• Complete implementation of Recommender System on Facebook

• Elaborate NLI/NLP technology for Go Green

Recommendations for Go Green are as following:

• Collaboration with Energy Distributors/Producers to promote Go Green Model.

• Integration with NGOs promoting energy conservation to promote Go Green Model

66

Page 75: Master thesis

References

Bibliography

[1] P. D. K. Werbach, “Gamification Course,”

[2] E. C. J. R. C. Ipts, “Social Computing : Study on the Use and Impact of OnlineSocial Networking,” 2008.

[3] R. English and J. Duncan-howell, “Facebook c© Goes to College : Using SocialNetworking Tools to Support Students Undertaking Teaching Practicum,” vol. 4,no. 4, pp. 596–601, 2008.

[4] “Facebook App Development,”

[5] G. Adomavicius and A. Tuzhilin, “Toward the next generation of recommendersystems: a survey of the state-of-the-art and possible extensions,” 2005.

[6] T. R. Karl and K. E. Trenberth, “Modern global climate change.,” Science (NewYork, N.Y.), vol. 302, pp. 1719–23, Dec. 2003.

[7] “Google Green,”

[8] “My Climate,”

[9] C. Vlek and L. Steg, “? Human Behavior and Environmental Sustainability: Prob-lems, Driving Forces, and Research Topics,” Journal of Social Issues, vol. 63, pp. 1–19, Mar. 2007.

[10] A. Ars and B. College, “NIH Public Access,” vol. 34, no. 1, pp. 74–82, 2009.

[11] B. D. Ng and P. Wiemer-Hastings, “Addiction to the internet and online gaming.,”Cyberpsychology & behavior : the impact of the Internet, multimedia and virtualreality on behavior and society, vol. 8, pp. 110–3, Apr. 2005.

[12] “Simple Energy,”

[13] “US20080306801.pdf.”

[14] J. Gardner and J. Samson, “Photoelectron branching ratios with a cylindrical mirrorenergy analyzer,” Journal of Electron Spectroscopy and Related Phenomena, vol. 2,no. 3, pp. 267 – 275, 1973.

[15] S. Boess and H. Brezet, “Exploring the use of a game to stimulate energy saving inhouseholds Daphne Geelen *, David Keyson ,,” vol. 10, pp. 102–120, 2012.

67

Page 76: Master thesis

References

[16] “Energiesparen fördern durch psychologische Interventionen 1,” pp. 1–25.

[17] P. W. Schultz, “Presented at the 2008 Behavior, Energy, and Climate Change(BECC) conference. Sacramento, CA.,” 2008.

[18] A. Derryberry and I. Serious, “Serious games : online games for learning,”

[19] W. Hill, L. Stead, M. Rosenstein, and G. Furnas, “Recommending and evaluatingchoices in a virtual community of use,” in Proceedings of the SIGCHI Conference onHuman Factors in Computing Systems, CHI ’95, (New York, NY, USA), pp. 194–201, ACM Press/Addison-Wesley Publishing Co., 1995.

[20] P. Resnick, N. Iacovou, M. Suchak, P. Bergstrom, and J.Riedl, “Grouplens: Anopen architecture for collaborative filtering of netnews,” In Proceedings of the ACMConference on Computer Supported Cooperative Work (CSCW’94), pp. 175–186,October 22–26 1994.

[21] U. Shardanand and P. Maes, “Social information filtering: algorithms for automat-ing word of mouth,” in Proceedings of the SIGCHI Conference on Human Fac-tors in Computing Systems, CHI ’95, (New York, NY, USA), pp. 210–217, ACMPress/Addison-Wesley Publishing Co., 1995.

[22] E. Rich, “User Modeling via Stereotypes *,” vol. 354, 1979.

[23] J. Powell, Approximation Theory and Methods. Cambridge University Press, 1981.

[24] G. Salton, Automatic text processing: the transformation, analysis, and retrieval ofinformation by computer. Boston, MA, USA: Addison-Wesley Longman PublishingCo., Inc., 1989.

[25] J. Armstrong, Principles of Forecasting: A Handbook for Researchers and Prac-titioners. International Series in Operations Research & Management Science,Springer, 2001.

[26] B. P. S. Murthi and S. Sarkar, “The role of the management sciences in research onpersonalization,” Manage. Sci., vol. 49, pp. 1344–1362, Oct. 2003.

[27] G. L. Lilien, P. Kotler, and K. S. Moorthy, Marketing models. Prentice-Hall Engle-wood Cliffs, 1992.

[28] M. Balabanović and Y. Shoham, “Fab: content-based, collaborative recommenda-tion,” Commun. ACM, vol. 40, pp. 66–72, Mar. 1997.

[29] M. Stevens, “A Coordinate Descent Algorithm for Learning Compact Ranking Func-tions,” pp. 1–12.

[30] R. E. Schapire and Y. Singer, “Improved boosting algorithms using confidence-ratedpredictions,” Mach. Learn., vol. 37, pp. 297–336, Dec. 1999.

68

Page 77: Master thesis

References

[31] A. Kolobov, Mausam, and D. S. Weld, “Retrase: integrating paradigms for approx-imate probabilistic planning,” in Proceedings of the 21st international jont confer-ence on Artifical intelligence, IJCAI’09, (San Francisco, CA, USA), pp. 1746–1753,Morgan Kaufmann Publishers Inc., 2009.

[32] A. Hotho, “Learning in Web Search Guest Editors : Stephan Bloehdorn,” vol. 30,no. 2, 2006.

[33] S. Alvarez-napagao and J. Vázquez-salceda, “USE : a Multi-Agent User-DrivenRecommendation System for Semantic Knowledge Extraction,”

[34] Z. Malik and C. Fyfe, “Review of web personalization,” Journal of Emerging Tech-nologies in Web Intelligence, vol. 4, no. 3, 2012.

[35] M. J. Pazzani, “A framework for collaborative, content-based and demographicfiltering,” Artif. Intell. Rev., vol. 13, pp. 393–408, Dec. 1999.

[36] A. I. Schein, A. Popescul, L. H. Ungar, and D. M. Pennock, “Methods and metricsfor cold-start recommendations,” in Proceedings of the 25th annual internationalACM SIGIR conference on Research and development in information retrieval, SI-GIR ’02, (New York, NY, USA), pp. 253–260, ACM, 2002.

[37] G. Adomavicius, R. Sankaranarayanan, S. Sen, and A. Tuzhilin, “Incorporating con-textual information in recommender systems using a multidimensional approach,”ACM Trans. Inf. Syst., vol. 23, pp. 103–145, Jan. 2005.

[38] L. H. Ungar and D. P. Foster, “Clustering methods for collaborative filtering,” inWorkshop on Recommender Systems at the 15th National Conference on ArtificialIntelligence (AAAI’98), (Madison, Wisconsin, USA), pp. 112–125, AAAI Press,July 1998.

[39] A.-L. Barabasi, “Linked the new science of networks,” 2002.

[40] R. Gross and A. Acquisti, “Information revelation and privacy in online social net-works,” in Proceedings of the 2005 ACM workshop on Privacy in the electronicsociety, WPES ’05, (New York, NY, USA), pp. 71–80, ACM, 2005.

[41] S. Whittaker, Q. Jones, B. Nardi, M. Creech, L. Terveen, E. Isaacs, andJ. Hainsworth, “Contactmap: Organizing communication in a social desktop,” ACMTrans. Comput.-Hum. Interact., vol. 11, pp. 445–471, Dec. 2004.

[42] J. R. Corwin, “Social Networking Phenomena In The First-Year Experience,” vol. 8,no. 1, pp. 25–38, 2011.

[43] L. Gouveia, L. Pereira, M. Scott, and I. Oakley, “Eco-Avatars : Visualizing Disag-gregated Home Energy Use,” pp. 5–6, 2012.

[44] “Bill MacCartney June 2009,” no. June, 2009.

69

Page 78: Master thesis

References

[45] A. W. Paper, “Deploying Chatbots to Customer Advantage,” vol. 44, no. November,2010.

[46] B. P. Weidema, M. Thrane, P. Christensen, J. Schmidt, and S. r. Lø kke, “CarbonFootprint.,” url of Industrial Ecology, vol. 12, pp. 3–6, Feb. 2008.

[47] a. Druckman and T. Jackson, “The carbon footprint of UK households 1990-2004:A socio-economically disaggregated, quasi-multi-regional input-output model,” Eco-logical Economics, vol. 68, pp. 2066–2077, May 2009.

[48] F. Pearce, “Why bother going,” no. November, 2007.

[49] C. Weber and H. Matthews, “Quantifying the global and distributional aspects ofAmerican household carbon footprint,” Ecological Economics, vol. 66, pp. 379–391,June 2008.

[50] M. Franchetti and P. Kilaru, “Modeling the impact of municipal solid waste re-cycling on greenhouse gas emissions in Ohio, USA,” Resources Conservation andRecycling, vol. 58, pp. 107–113, Jan. 2012.

[51] J. Padgett, a. Steinemann, J. Clarke, and M. Vandenbergh, “A comparison of carboncalculators,” Environmental Impact Assessment Review, vol. 28, no. 2-3, pp. 106–115, 2008.

[52] T. Kenny and N. Gray, “Comparative performance of six carbon footprint modelsfor use in Ireland,” Environmental Impact Assessment Review, vol. 29, pp. 1–6, Jan.2009.

[53] A. K. Dey and G. D. Abowd, “Towards a Better Understanding of Context,”

[54] P. L. Academic, “Social Network Analysis Course,”

[55] P. D. A. Ng, “Machine Learning Course,”

[56] P. D. P. Domingos, “Machine Learning Course,”

[57] P. D. G. Hinton, “Neural Networks for Machine Learning,”

[58] P. D. Jurafsky and P. C. Manning, “Natural Language Processing Course,”

[59] A. Kittur, E. H. Chi, and B. Suh, “Crowdsourcing user studies with mechanicalturk,” in Proceedings of the SIGCHI Conference on Human Factors in ComputingSystems, CHI ’08, (New York, NY, USA), pp. 453–456, ACM, 2008.

[60] O. Alonso, D. E. Rose, and B. Stewart, “Crowdsourcing for relevance evaluation,”SIGIR Forum, vol. 42, pp. 9–15, Nov. 2008.

[61] C. Parvanta, Y. Roth, and H. Keller, “Crowdsourcing 101: A few basics to makeyou the leader of the pack,” Health Promotion Practice, vol. 14, no. 2, pp. 163–167,2013.

70

Page 79: Master thesis

Appendix

[62] B. J. Howe, “The Rise of Crowdsourcing,” no. 14, pp. 1–5, 2012.

[63] A. Doan, R. Ramakrishnan, and A. Y. Halevy, “Crowdsourcing systems on theworld-wide web,” Commun. ACM, vol. 54, pp. 86–96, Apr. 2011.

71

Page 80: Master thesis

Appendix

Appendices

Recommender Systems Implementation

User Correlation Model Implementation

The User-Suggestion Correlation Model, which helps to find correlation coefficient be-tween the user and suggestion is implemented below:

close allclear allclc

% Selection of input file for correlation on one side there should%be Suggestion features and other User features we want to correlate.[filenamedata, pathdata] = uigetfile(’*.xlsx’,’Please select theexcel file for correlation’);

path_data = [pathdata, filenamedata]; % Complete file path

% Output data[correl_data, variable_name]= xlsread(path_data,-1); %Save thecorrelation data

% Correlation Function[correl_result, correl_sig] = corrcoef(correl_data); % Correlationof Data and significance

% Output Data[filenameoutput, pathoutput] = uiputfile(’*.xlsx’, ’Please saveCorrelation Matrix’); % Dialog to save file

path_results = [pathoutput, filenameoutput];

output_varname1 = xlswrite(path_results, variable_name,’Correlationsmatrix’, ’b1’);% Variable name in the table

output_varname2 = xlswrite(path_results, variable_name’,’Correlationsmatrix’, ’a2’);% Variablen name in the first sheetoutput_data = xlswrite(path_results, correl_result,’Correlationsmatrix’, ’b2’);% Correlation Matrix

72

Page 81: Master thesis

Appendix

output_varname3 = xlswrite(path_results, variable_name,’Significance’, ’b1’);% Variable name storage on top

output_varname4 = xlswrite(path_results, variable_name’,’Significance’, ’a2’);% Variable name storageoutput_sig = xlswrite(path_results, correl_sig,’Significance’, ’b2’);%Significance values

% Feedback Functionif output_varname1 == 1 && output_varname2 == 1 && output_data ==1&& output_varname3 == 1 && output_varname4 == 1 && output_sig ==1

msgbox(char(’All the data related to correlation is saved inexcel file’));

elsemsgbox(char(’Some problem occured while running correlation’));

end

Collaborative Filtering Implementation

Implementation of Cost function, Numerical Gradient, Gaussian Distribution, Multi-variate Gaussian Distribution, Normalization of Ratings of Suggestions and VisualizeFit in Go Green Model is as follows:

function [J, grad] = cofiCostFunc(params, Y, R, num_users, num_suggests, ...num_features, lambda)

%COFICOSTFUNC Collaborative filtering cost function% [J, grad] = COFICOSTFUNC(params, Y, R, num_users, num_suggests, ...% num_features, lambda) returns the cost and gradient for the% collaborative filtering problem.%

% Unfold the U and W matrices from paramsX = reshape(params(1:num_suggests*num_features), num_suggests, num_features);Theta = reshape(params(num_suggests*num_features+1:end), ...

num_users, num_features);

% You need to return the following values correctlyJ = 0;X_grad = zeros(size(X));Theta_grad = zeros(size(Theta));

% ====================== YOUR CODE HERE ======================

73

Page 82: Master thesis

Appendix

% Instructions: Compute the cost function and gradient for collaborative% filtering. Concretely, you should first implement the cost% function (without regularization) and make sure it is% matches our costs. After that, you should implement the% gradient and use the checkCostFunction routine to check% that the gradient is correct. Finally, you should implement% regularization.%% Notes: X - num_suggests x num_features matrix of suggest features% Theta - num_users x num_features matrix of user features% Y - num_suggests x num_users matrix of user ratings of suggests% R - num_suggests x num_users matrix, where R(i, j) = 1 if the% i-th suggest was rated by the j-th user%% You should set the following variables correctly:%% X_grad - num_suggests x num_features matrix, containing the% partial derivatives w.r.t. to each element of X% Theta_grad - num_users x num_features matrix, containing the% partial derivatives w.r.t. to each element of Theta%

H = X*Theta’;J = 0.5 * sum(sum(R.*(H - Y).^2)) + 0.5*lambda*sum(sum(Theta.^2)) + 0.5 *lambda*(sum(sum(X.^2)));

X_grad = R.*(H - Y) * Theta + lambda * X;Theta_grad = (R.*(H - Y))’ * X + lambda * Theta;

% =============================================================

grad = [X_grad(:); Theta_grad(:)];

end

function numgrad = computeNumericalGradient(J, theta)%COMPUTENUMERICALGRADIENT Computes the gradient using "finite differences"%and gives us a numerical estimate of the gradient.% numgrad = COMPUTENUMERICALGRADIENT(J, theta) computes the numerical% gradient of the function J around theta. Calling y = J(theta) should% return the function value at theta.

74

Page 83: Master thesis

Appendix

% Notes: The following code implements numerical gradient checking, and% returns the numerical gradient.It sets numgrad(i) to (a numerical% approximation of) the partial derivative of J with respect to the% i-th input argument, evaluated at theta. (i.e., numgrad(i) should% be the (approximately) the partial derivative of J with respect% to theta(i).)%

numgrad = zeros(size(theta));perturb = zeros(size(theta));e = 1e-4;for p = 1:numel(theta)

% Set perturbation vectorperturb(p) = e;loss1 = J(theta - perturb);loss2 = J(theta + perturb);% Compute Numerical Gradientnumgrad(p) = (loss2 - loss1) / (2*e);perturb(p) = 0;

end

endfunction [mu sigma2] = estimateGaussian(X)%ESTIMATEGAUSSIAN This function estimates the parameters of a%Gaussian distribution using the data in X% [mu sigma2] = estimateGaussian(X),% The input X is the dataset with each n-dimensional data point in one row% The output is an n-dimensional vector mu, the mean of the data set% and the variances sigma^2, an n x 1 vector%

% Useful variables[m, n] = size(X);

% You should return these values correctlymu = zeros(n, 1);sigma2 = zeros(n, 1);

% ====================== YOUR CODE HERE ======================% Instructions: Compute the mean of the data and the variances% In particular, mu(i) should contain the mean of% the data for the i-th feature and sigma2(i)% should contain variance of the i-th feature.%

75

Page 84: Master thesis

Appendix

mu = mean(X)’;sigma2 = var(X)’ * (m - 1) / m;

% =============================================================

end

function p = multivariateGaussian(X, mu, Sigma2)%MULTIVARIATEGAUSSIAN Computes the probability density function of the%multivariate gaussian distribution.% p = MULTIVARIATEGAUSSIAN(X, mu, Sigma2) Computes the probability% density function of the examples X under the multivariate gaussian% distribution with parameters mu and Sigma2. If Sigma2 is a matrix, it is% treated as the covariance matrix. If Sigma2 is a vector, it is treated% as the \sigma^2 values of the variances in each dimension (a diagonal% covariance matrix)%

k = length(mu);

if (size(Sigma2, 2) == 1) || (size(Sigma2, 1) == 1)Sigma2 = diag(Sigma2);

end

X = bsxfun(@minus, X, mu(:)’);p = (2 * pi) ^ (- k / 2) * det(Sigma2) ^ (-0.5) * ...

exp(-0.5 * sum(bsxfun(@times, X * pinv(Sigma2), X), 2));

end

function [Ynorm, Ymean] = normalizeRatings(Y, R)%NORMALIZERATINGS Preprocess data by subtracting mean rating for every%suggestion (every row)% [Ynorm, Ymean] = NORMALIZERATINGS(Y, R) normalized Y so that each suggestion% has a rating of 0 on average, and returns the mean rating in Ymean.%

[m, n] = size(Y);Ymean = zeros(m, 1);Ynorm = zeros(size(Y));for i = 1:m

Ymean(i) = mean(Y(i, R(i, :)));

76

Page 85: Master thesis

Appendix

Ynorm(i, R(i, :)) = Y(i, R(i, :)) - Ymean(i);end

endfunction [bestEpsilon bestF1] = selectThreshold(yval, pval)%SELECTTHRESHOLD Find the best threshold (epsilon) to use for selecting%outliers% [bestEpsilon bestF1] = SELECTTHRESHOLD(yval, pval) finds the best% threshold to use for selecting outliers based on the results from a% validation set (pval) and the ground truth (yval).%

bestEpsilon = 0;bestF1 = 0;F1 = 0;

stepsize = (max(pval) - min(pval)) / 1000;for epsilon = min(pval):stepsize:max(pval)

% ====================== YOUR CODE HERE ======================% Instructions: Compute the F1 score of choosing epsilon as the% threshold and place the value in F1. The code at the% end of the loop will compare the F1 score for this% choice of epsilon and set it to be the best epsilon if% it is better than the current choice of epsilon.%% Note: You can use predictions = (pval < epsilon) to get a binary vector% of 0’s and 1’s of the outlier predictions

cvPredictions = pval < epsilon;tp = sum((cvPredictions == 1) & (yval == 1));fp = sum((cvPredictions == 1) & (yval == 0));fn = sum((cvPredictions == 0) & (yval == 1));

prec = tp / (tp + fp + 1e-10);rec = tp / (tp + fn + 1e-10);F1 = 2 * prec * rec / (prec + rec + 1e-10);

% =============================================================

if F1 > bestF1bestF1 = F1;bestEpsilon = epsilon;

end

77

Page 86: Master thesis

Appendix

end

endfunction visualizeFit(X, mu, sigma2)%VISUALIZEFIT Visualize the dataset and its estimated distribution.% VISUALIZEFIT(X, p, mu, sigma2) This visualization shows you the% probability density function of the Gaussian distribution. Each example% has a location (x1, x2) that depends on its feature values.%

[X1,X2] = meshgrid(0:.5:35);Z = multivariateGaussian([X1(:) X2(:)],mu,sigma2);Z = reshape(Z,size(X1));

plot(X(:, 1), X(:, 2),’bx’);hold on;% Do not plot if there are infinitiesif (sum(isinf(Z)) == 0)

contour(X1, X2, Z, 10.^(-20:3:0)’);endhold off;

end

Go Green Website Model

The index.php is the main file for the go-green website model which is described belowand it uses faceconn’s library for accessing the facebook’s features.

<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1" /><title>Green Educate</title><link type="text/css"href="css/custom-theme/jquery-ui-1.8.22.custom.css"rel="stylesheet" /><script type="text/javascript"src="js/jquery-1.7.2.min.js"></script><script type="text/javascript"src="js/jquery-ui-1.8.22.custom.min.js"></script>

78

Page 87: Master thesis

Appendix

<script type="text/javascript">$(function(){

// Accordion$("#accordion").accordion({ header: "h3" });

// Dialog$(’#dialog’).dialog({autoOpen: false,width: 600,buttons: {"Ok": function() {$(this).dialog("close");},"Cancel": function() {$(this).dialog("close");}}});

// Dialog Link$(’#dialog_link’).click(function(){$(’#dialog’).dialog(’open’);return false;});

$(’#tabs’).tabs();});

</script><style type="text/css">/*index page css*/body{ font: 62.5% "Trebuchet MS", sans-serif; margin:50px;}.demoHeaders { margin-top: 2em; }#dialog_link {padding: .4em 1em .4em20px;text-decoration: none;position: relative;}#dialog_link span.ui-icon {margin: 0 5px 0 0;position:absolute;left: .2em;top: 50%;margin-top: -8px;}ul#icons {margin: 0; padding: 0;}ul#icons li {margin: 2px; position: relative; padding:4px 0; cursor: pointer; float: left; list-style: none;}ul#icons span.ui-icon {float: left; margin: 0 4px;}</style><body bgcolor = "yellow">

<img src="images/1200x150.png" alt="banner" height="150"/>

79

Page 88: Master thesis

Appendix

<h1><font color="#20ac20" face="Comic Sans MS" size="16"> Welcome toGreen Educate </font></h1><br>This website is created by [email protected]. It isunder construction for my Master Thesis work. </br><script type="text/javascript">var _aco = _aco || [];</script><scriptsrc="http://js.acobot.com/b0a0f90cb4a69a61b09a3ddf0c5bfce8.js"async="true"></script><div id="tabs"><ul><li><a href="#tabs-1">Game</a></li><li><a href="#tabs-2">Suggestions</a></li><li><a href="#tabs-3">Leader Board</a></li><li><a href="#tabs-4">Trivia</a></li><li><a href="#tabs-5">Green Bank</a></li></ul><div id="tabs-1">Here there will be a carboon foot printcalculator on the basis of which participant will beawarded green coins according to his green act.

<div id="accordion"><div><h3><a href="#">Give your greenact</a></h3><div>Submit your green actionhere</div></div><div><h3><a href="#">Get your green actof the day</a></h3><div>Get suggestion based on yourlocation, weather and profile</div></div><div><h3><a href="#">Nominate afriend</a></h3><div>Earn green points by nominatinga friend</div></div></div>

</div><div id="tabs-2">Here there will be interestingsuggestions. And also updates on what his fellow greenfriends have been doing<p><a href="#"

80

Page 89: Master thesis

Appendix

id="dialog_link"class="ui-state-defaultui-corner-all"><spanclass="ui-iconui-icon-newwin"></span>OpenDialog</a></p>

<!-- ui-dialog --><div id="dialog" title="DialogTitle"><p>Name of friend with hisenergy rating and hisspecial green acts</p></div>

</div><div id="tabs-3">Here there will be a board with listingof ranks of green citizen</div>

<div id="tabs-4">Here there will be trivial informationrelated to green energy, energy conservation, home solutionsfor environment tips for green acts</div>

<div id="tabs-5">Here the user can sell his green coins,donate his green coins, transfer to his friend or buy greencoinsHere connect with Facebook friends</div></div><?php

require_once ’facebook.php’;require_once ’faceconn/faceconn.php’;UseGraphAPI();

?><div id="LikeButton"><?php

$like = new LikeButton();$like->Render();

?></div><div id="Bookmark"><?php$bookmark = new Bookmark();

$bookmark->Render();?>

</div>

81

Page 90: Master thesis

Appendix

<div id="Publish"><?php$publish = new StreamPublish();

$publish->SetName("Small Energy Conservation Actionswhich makes big difference");$publish->SetNameUrl("https://go-green.herokuapp.com");

$publish->SetCaption("{*actor*} publish this story:");$publish->SetDescription("On this site we can get simpleyet effective ideas to save environment with our smallgreen gestures");$publish->SetOnPublishJavaScript("alert(’Published’)");$publish->SetMedia(newImageMedia("https://go-green.herokuapp.com/1200x150.png","https://go-green.herokuapp.com"));$publish->AddPropery(new Property("Product Name", "GreenEducate"));$publish->AddActionLink(new ActionLink("Green Educate","http://go-green.herokuapp.com"));$publish->Render();

?></div>

<form id="form1"><?php

$login = new LoginButton();$login->SetText("Facebook Connect");$login->SetPermissions("video_upload, email");$login->SetOnLoginSubmitForm("form1");$login->Render();$facebook = newFacebook(AppConfig::GetKeyArray());

try{

// create facebook user$facebookUser = $facebook->getUser();

// check if user if connectedif ($facebookUser) {

// get user data$loggedUser = $facebook->api(’/me’);echo "<b>User data:</b><br />";echo "<br /><b>User ID:</b> " .$loggedUser[’id’];

82

Page 91: Master thesis

Appendix

echo "<br /><b>First name:</b> " .$loggedUser[’first_name’];echo "<br /><b>Last name:</b> " .$loggedUser[’last_name’];echo "<br /><b>Email:</b> " .$loggedUser[’email’];echo "<br /><br />";$logout = new LogoutButton();$logout->SetImage("images/fb_logout.png");$logout->SetOnLogoutSubmitForm("form1");$logout->Render();

}else{

ShowLoginButton();}

}catch (Exception $ex){

ShowLoginButton();}

?></form>

<div id="like-box"><?php// create instance of the class and set pageId

$likeBox = new LikeBox();// render the default control on the page$likeBox->Render();

?></div>

</body></html>

83