Created
September 24, 2018 12:30
-
-
Save nithyadurai87/a39ecee72dc4a266933621c298e80df9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.linear_model import LinearRegression | |
import numpy as np | |
from numpy.linalg import inv,lstsq | |
from numpy import dot, transpose | |
x = [[6], [8], [10], [14], [18]] | |
y = [[7], [9], [13], [17.5], [18]] | |
model = LinearRegression() | |
model.fit(x,y) | |
x_test = [[8], [9], [11], [16], [12]] | |
y_test = [[11], [8.5], [15], [18], [11]] | |
print ("Score = ",model.score(x_test, y_test)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Very usefull for beginers mam...