Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Scenario Kaggle contains a variety of datasets for experimentation. One such dataset is the 8 0 - cereals dataset. This dataset contains the consumer reports

Scenario
Kaggle contains a variety of datasets for experimentation. One such dataset is the 80-cereals dataset. This dataset contains the consumer reports rating of several different cereals along with various data about the cereals. The dataset contains the following fields.
Content
Fields in the Dataset
Name: Name of cereal
mfr: Manufacturer of cereal
A = American Home Food Products
G = General Mills
K = Kelloggs
N = Nabisco
P = Post
Q = Quaker Oats
R = Ralston Purina
Type:
Cold
Hot
Calories: Calories per serving
Protein: Grams of protein
Fat: Grams of fat
Sodium: Grams of sodium (Note: The original data contains milligrams.)
Fiber: Grams of dietary fiber
Carbs: Grams of complex carbohydrates
Sugars: Grams of sugars
Potassium: Grams of potassium (Note: The original data contains milligrams.)
Vitamins: Vitamins and minerals: 0,25, or 100, indicating the typical percentage of FDA recommended
Shelf: Display shelf (1,2, or 3, counting from the floor)
Weight: Weight in ounces of one serving
Cups: Number of cups in one serving
Rating: A rating of the cereals
Create a new experiment in Azure Machine Learning and perform linear regression on the cereals.csv dataset. We are seeking to determine if we can predict the rating based on the above features. The ratings are based on nutrition and taste. Open the cereals.csv file and look through the data to familiarize yourself with the data. You will need to cleanse the dataare there any missing values? Any outliers? Do you need to make any fields categorical? You will also need to normalize the data. You will want to develop python visualizations (feel free to use the code we have used in previous examples to create a pairwise scatter plot). You may also want to focus on a few selected fields based on your visualizations (sugar, calories, fat, fiber, etc). Dont forget to split the data into a training and test set. You will need to create a linear regression model, train the model, score the model, and then evaluate it.
How accurate is your model? What is the R2 value?
Look at the python pairwise scatter plot. What features do you want to remove from the model? Continue iterating (removing features and adding them back in) and reviewing the evaluation results. Find the best R2 value you can. Try to get above 0.70. What features are good predictors of the cereal rating?
Prepare a report on your regression analysis. In your report include several screenshots and explanations of your model. The rubric is below.
Introduction to the problem
Uploading dataset
Data preparation (normalization)
Data Visualization (python script)
Selecting features
Splitting data
Linear regression model
Training the model
Scoring the model show scored labels
Evaluating the model
Iteration process
Why you chose to exclude certain features
New evaluation when those features were excluded
What features are most influential on the rating
Conclusion
Challenges
Career skills obtained
Web service (optional)
Note: Pairwise scatter plot code in Python.
def azureml_main(frame1):
## import libraries
import matplotlib
matplotlib.use('agg') # Set backend
from pandas.tools.plotting import scatter_matrix
import pandas.tools.rplot as rplot
import matplotlib.pyplot as plt
import numpy as np
## Create a pair-wise scatter plot
Azure = True
fig1= plt.figure(1, figsize=(10,10))
ax = fig1.gca()
sm=scatter_matrix(frame1, alpha=0.3,
diagonal='kde', ax = ax)
[s.xaxis.label.set_rotation(45) for s in sm.reshape(-1)]
[s.yaxis.label.set_rotation(45) for s in sm.reshape(-1)]
plt.show()
fig1.savefig('scatter1.png')

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The World Wide Web And Databases International Workshop Webdb 98 Valencia Spain March 27 28 1998 Selected Papers Lncs 1590

Authors: Paolo Atzeni ,Alberto Mendelzon ,Giansalvatore Mecca

1st Edition

3540658904, 978-3540658900

More Books

Students also viewed these Databases questions