Add source example files
This commit is contained in:
10
source/scikit/scikit-regression.py
Normal file
10
source/scikit/scikit-regression.py
Normal file
@ -0,0 +1,10 @@
|
||||
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_)
|
Reference in New Issue
Block a user