python3精要(61)-线性回归
生活随笔
收集整理的這篇文章主要介紹了
python3精要(61)-线性回归
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
import random
from sklearn import linear_model
reg=linear_model.LinearRegression()
reg.fit([[1,2],[10,3],[3,9],[2,7]],[1*5+2+random.random(),10*5+3,3*5+9,2*5+7])
reg.coef_
array([4.9376333 , 0.90900977])
y=ax+by
a=5
b=1
下載線性回歸用數(shù)據(jù)集
https://www.kaggle.com/andonians/random-linear-regression/version/1
總結(jié)
以上是生活随笔為你收集整理的python3精要(61)-线性回归的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java中String类中compare
- 下一篇: python3精要(48)-os命令