September 5, 2017

Introduction

This app will allow users to calcuate how many Calories are in their food. This is suprisingly accurate and will calculate accurately 90% of the time. You can test this app by finding something in your house and inputing the following ingredients in. Then compare the Calorie output with the amount of Calories displayed on the nutrition fact. Note that I have rounded all the values to the nearest tens so you will not get a number like 35 but instead 30 or 40.

Code

For this project, I used the menu from McDonalds to create my linear model. I found this data on kaggle.

setwd("C:\\Users\\shubh\\Documents\\Coursera\\Developing Data Products")
foodData <- read.csv("menu.csv")
foodDataNumeric <- foodData[, -c(1,2,3)]
COR <- cor(foodDataNumeric)
top <- order(COR[1,], decreasing = T)

For this project, I used the some of the highest correlations which are total fat, saturated fat, sodium, carbohydrates, and protein. You can see these on the next slide.

Top Correlations

##                      Calories             Calories.from.Fat 
##                     1.0000000                     0.9045878 
##                     Total.Fat     Total.Fat....Daily.Value. 
##                     0.9044092                     0.9041225 
## Saturated.Fat....Daily.Value.                 Saturated.Fat 
##                     0.8476308                     0.8455636 
##                       Protein                 Carbohydrates 
##                     0.7878475                     0.7815395 
## Carbohydrates....Daily.Value.        Sodium....Daily.Value. 
##                     0.7812420                     0.7134150

Some Graphs