/avatar.jpg

DATA100-lab8: Model Selection, Regularization, and Cross-Validation

1 2 3 # Initialize Otter import otter grader = otter.Notebook("lab08.ipynb") Lab 8: Model Selection, Regularization, and Cross-Validation In this lab, you will practice using scikit-learn to generate models of various complexity. You’ll then use the holdout method and K-fold cross-validation to select the models that generalize best. 1 2 3 4 5 6 7 8 9 10 11 # Run this cell to set up your notebook import seaborn as sns import csv import numpy as np import pandas as pd import matplotlib.

DATA100-lab5: Modeling, Loss Functions, and Summary Statistics

1 2 3 # Initialize Otter import otter grader = otter.Notebook("lab05.ipynb") Lab 5: Modeling, Loss Functions, and Summary Statistics Predicting Restaurant Tips In this lab, you will try to predict restaurant tips from a set of data in several ways: A. Without given any additional information, use a constant model with L2 loss to predict the tip $\hat{y}$ as a summary statistic, $\theta$. B. Given one piece of information—the total bill $x$ use a linear model with L2 loss to predict the tip $\hat{y}$ as a linear function of $x$.

DATA100-lab6: Linear Regression

1 2 3 # Initialize Otter import otter grader = otter.Notebook("lab06.ipynb") Lab 6: Linear Regression Objectives In this lab, you will review the details of linear regresison as described in Lectures 10 and 11. In particular: Matrix formulation and solution to Ordinary Least Squares sns.lmplot as a quick visual for simple linear regression scikit-learn, a real world data science tool that is more robust and flexible than analytical/scipy.optimize solutions You will also practice interpreting residual plots (vs.