Generate a quadratic model with y=x+x^2+e. x and e are both vectors which are normal mean 0, variance 1. Generate a monte-carlo sample from this model with length m = 20. Use the functions train_test_split() to get training and test sets where the test set is 1/2 of the full sample size, m. Fit three different models, a linear model, a quadratic model, and a 7 degree polynomial.

Q&A Education