import numpy as np
import matplotlib.pyplot as plt12 Classificiation
A classifier is an algorithm that takes an input and returns a label, or class.
This section utilizes NumPy and Pyplot:
Exercises
Find the parameters of the linear regression of the model \(\hat{Y}=\beta_0+\beta_1 X\) on the following data:
\(x\) -4 -1 0 2 3 5 6 7 9 \(y\) 22 19 15 16 15 19 19 20 22 Given the linear model \(\hat{Y}=\beta_0+\beta_1 X\) for the above data, find:
- The residual errors \(e_i = y_i - \hat{y}_i\)
- The sum of squared errors \(\sum_{i=1}^{n} e_{i}^{2}\)
- The mean-squared error \(\frac{1}{n}\sum_{i=1}^{n} e_{i}^{2}\)
Plot the data and the linear model.
Repeat the above for a quadratic model \(\hat{Y}=\beta_0+\beta_1 X + \beta_2 X^2\).