Answered step by step
Verified Expert Solution
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 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: or indicating the typical percentage of FDA recommended
Shelf: Display shelf or 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 R 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 R value you can. Try to get above 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 azuremlmainframe:
## import libraries
import matplotlib
matplotlib.useagg # Set backend
from pandas.tools.plotting import scattermatrix
import pandas.tools.rplot as rplot
import matplotlib.pyplot as plt
import numpy as np
## Create a pairwise scatter plot
Azure True
fig pltfigure figsize
ax figgca
smscattermatrixframe alpha
diagonal'kde', ax ax
sxaxis.label.setrotation for s in smreshape
syaxis.label.setrotation for s in smreshape
pltshow
figsavefigscatterpng
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started