pythonregression
發布時間: 2025-10-06 22:17:36
Ⅰ python怎麼用線性回歸擬合
from sklearn import linear_model#線性回歸clf = linear_model.LinearRegression()#訓握漏練clf.fit ([[0, 0], [1, 1], [2, 2]], [0, 1, 2])#表達式參豎皮睜數clf.coef_#測試余歲improt numpy as npx = np.array([1,1])y = x.dot(clf.coef_)
熱點內容