Skip to content

Instantly share code, notes, and snippets.

@yuyasugano
Created Nov 18, 2020
Embed
What would you like to do?
Scikit-learn LinearRegression vs Numpy Polyfit
import numpy as np
import scipy as sp
x = [9, 28, 38, 58, 88, 98, 108, 118, 128, 138, 148, 158, 168, 178, 188, 198, 208, 218, 228, 238, 278, 288, 298]
y = [51, 80, 112, 294, 286, 110, 59, 70, 56, 70, 104, 59, 59, 72, 87, 99, 64, 60, 74, 151, 157, 57, 83]
%matplotlib inline
import matplotlib.pyplot as plt
plt.scatter(x, y)
plt.title("Test data observation")
plt.grid()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment