0% found this document useful (0 votes)
21 views4 pages

Week 3 - 2-Polynomial Regression

The document discusses using polynomial regression to model nonlinear relationships between variables. It introduces linear, quadratic, and cubic polynomial functions. It warns about overfitting models and recommends visualizing data and fits to avoid overly complex curves.

Uploaded by

Noah Byrne
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views4 pages

Week 3 - 2-Polynomial Regression

The document discusses using polynomial regression to model nonlinear relationships between variables. It introduces linear, quadratic, and cubic polynomial functions. It warns about overfitting models and recommends visualizing data and fits to avoid overly complex curves.

Uploaded by

Noah Byrne
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Why limit ourselves to straight

lines?
Not all relationships are linear.
Linear formula: y = mx + b
 This is a “first order” or
“first degree” polynomial, as
the power of x is 1
Second order polynomial: y =
ax2 + bx + c
Third order: y = ax3 + bx2 + cx
+
d
Higher orders produce more
Beware overfitting
Don’t use more degrees than you need
Visualise you data first to see how complex of a
curve there might really be
Visualise the fit – is you curve going out of its way
to accommodate outliers?
A high r-squared simply means your curve fits your
training data well; but it may not be a good
predictor.
Later we’ll talk about more principled ways to
detect overfitting (train/test)
Look at an example
Numpy.polyfit() makes it easy

PolynomialRegression.ipynb

You might also like