Send Close Add comments: (status displays here)
Got it!  This site uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.nbsp; Note: This appears on each machine/browser from which this site is accessed.
Matplotlib: Linear regression


1. Matplotlib: Linear regression

2. Linear regression
Here is an example of linear regression using numpy, sklearn and matplotlib.

3. Data
Here is the data to be used as an example.
x y 1 2 2 1 3 4 4 3 5 6 6 5 7 8

Here is the Python code.

Here is the output of the Python code.


4. Regression chart
simple linear regression

5. End of page