Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

scikit learn linear regression

from sklearn.linear_model import LinearRegression
X = np.array([[1, 1], [1, 2], [2, 2], [2, 3]])
y = np.dot(X, np.array([1, 2])) + 3
reg = LinearRegression().fit(X, y)
reg.score(X, y)
reg.coef_
reg.intercept_
reg.predict(np.array([[3, 5]]))
Comment

scikit learn linear regression

from sklearn.linear_model import LinearRegression
reg = LinearRegression()
reg.score(X, y) #Fit linear model
reg.coef_ #Estimated coefficients for the linear regression problem
reg.predict(y) #Predict using the linear model
Comment

PREVIOUS NEXT
Code Example
Python :: how to redirect to another page in django after login 
Python :: how to launch jupyter notebook from cmd 
Python :: how to import mnist dataset keras 
Python :: read bytes from file python 
Python :: python teilen ohne rest 
Python :: polynomial features random forest classifier 
Python :: python program to find fibonacci series using function recursion loop 
Python :: shuffle array python 
Python :: django text area limit characters 
Python :: where to find python3 interpreter 
Python :: how do you count most frequent item in a list in python 
Python :: clear pygame screen 
Python :: list of files in python 
Python :: mean class accuracy sklearn 
Python :: how to slice odd index value from a list in python using slice function 
Python :: how to change number of steps in tensorflow object detection api 
Python :: sns time series plot 
Python :: notify2 python example 
Python :: install biopython in windows 
Python :: replace multiple spaces with single space python 
Python :: jupyter notebook extensions 
Python :: how to drop a column by name in pandas 
Python :: object.image.url email template django 
Python :: pyspark take random sample 
Python :: tf.contrib.layers.xavier_initializer() tf2 
Python :: python poner en mayusculas 
Python :: python wsgi server 
Python :: rename files in a folder python 
Python :: pyqt5 pylatex 
Python :: pytorch save model 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =