9. Assignment 9: Linear Regression#
9.1. Quick Facts#
Due: 2023-11-06
9.2. Assessment#
Eligible skills: (links to checklists)
9.4. Instructions#
Find a dataset suitable for regression. We recommend a dataset from the UCI repository. Remember that you can use the filters to choose a dataset that is well-suited for regression.
9.4.1. Linear Regression Basics#
TLDR: Fit a linear regression model, measure the fit with two metrics, and make a plot that helps visualize the result.
Include a basic description of the data(what the features are, units, size of dataset, etc)
Write your own description of what the prediction task it, why regression is appropriate.
Fit a linear model on all numerical features with 75% training data.
Test it on 25% held out test data and measure the fit with two metrics and one plot
Inspect the model to answer:
What to the coefficients tell you?
What to the residuals tell you?
Repeat the split, train, and test steps 5 times.
Is the performance consistent enough you trust it?
Interpret the model and its performance in terms of the application. Some questions you might want to answer in order to do this include:
do you think this model is good enough to use for real?
is this a model you would trust?
do you think that a more complex model should be used?
do you think that maybe this task cannot be done with machine learning?
Try fitting the model only on one feature. Justify your choice of feature based on the results above. Plot this result.
Hint
For python level 2, summarize level 2 or visualize level 2 expand the “Repeat the split test and train” step a little.
Use a loop to vary a variable of the analysis, repeat more times, or similar.
Answer a question about regression and when it works, by putting all of the results into a dataframe