import numpy as npy import pandas as pda from sklearn import linear_model filepath="G:/Delivery.csv" data=pda.read_csv(filepath,encoding="gbk") print(data) x=data.iloc[:,0:2].as_matrix() y=data.iloc[:,2].as_matrix() print(x) print(y) mlr=linear_model.LinearRegression() mlr.fit(x,y) print(mlr.coef_) print(mlr.intercept_) test_x=[[102,6]] test_y=mlr.predict(test_x) print(test_y)
多元线性回归1
最新推荐文章于 2024-01-09 13:48:26 发布