Data Science, Machine Learning, Regression, Data Analysis, Statistics.
Generating test data for plotting x_test = np.linspace(-2, 2, 100).reshape(-1, 1) # Predictions y_linear = linear_model.predict(x_test) y_poly_good = poly_model_good.predict(x_test) y_poly_overfit = poly_model_overfit.predict(x_test) # Plotting plt.figure(figsize=(12, 6)) plt.scatter(x, y,