Files
training.python.datascience/source/scikit/scikit-regression.py

11 lines
243 B
Python

from sklearn.linear_model import LinearRegression
model = LinearRegression()
x = [[0, 1], [1, 1], [2, 1]]
y = [0, 1, 2]
target = [1, 1, 1]
coeff: LinearRegression = model.fit(x, y)
# L'ordonne des points est 0.5 + 0.5 * x
print(coeff.coef_)