CPSC 483 Introduction to Machine Learning Project 1 solved

$30.00

Download Details:

  • Name: 483_Project1-pxb0bm.zip
  • Type: zip
  • Size: 104.09 KB

Category:

Description

5/5 - (6 votes)

Dataset
The scikit-learn sklearn.datasets module includes some small datasets for experimentation.
In this project we will use the Boston house prices dataset to try and predict the median value of
a home given several features of its neighborhood.
See the section on scikit-learn in Sergiy Kolesnikov’s blog article Datasets in Python to see how
to load this dataset and examine it using pandas DataFrames.
Experiments
Run the following experiments in a Jupyter notebook, performing each action in a code cell and
answering each question in a Markdown cell.
1. Load and examine the Boston dataset’s features, target values, and description.
2. Create a scatterplot showing the relationship between the feature LSTAT and the target
value MEDV. Does the relationship appear to be linear?
3. Create and fit() an sklearn.linear_model.LinearRegression model using LSTAT
as a predictor of MEDV. Using the coef_ and intercept_ attributes of the model, what
is the equation for MEDV as a function of LSTAT?
4. Use the predict() method of the model to find the response for each value of the
LSTAT attribute in the dataset. Using sklearn.metrics.mean_squared_error(), find
the average loss 𝓛 for the model.
5. Add a line to your scatter plot representing the least squares fit to the data. How well
does the model fit the data?
6. Now repeat experiments (3) and (4) using all 13 input features at the same time. How
does the average loss change?
7. Based on the coef_ attributes of the new model, which features are desirable in a
home? Which features detract from its value?
8. Given the coef_ attributes, find the following for each feature: how much does a one unit
increase in that feature change the median value of the home? Based on the description
of the dataset, convert your answer to dollars.
9. Based on the amount of change in the value of the home, which features don’t seem to
be important?
Submission
Submit your Jupyter .ipynb notebook file through Canvas before class on the due date. Your
notebook should include the usual identifying information found in a README.TXT file.
If the assignment is completed by a pair, only one submission is required. Be certain to identify
the names of both students at the top of the notebook.