from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# X,y分别存放特征向量(自变量)和标签(因变量)
# 使用.reshape(a,b)来设置数组为a行b列(若a=-1,b=2,意为将数组变为两列,并根据列数自动计算行数)
X,y = data
【代码模版】线性回归
最新推荐文章于 2024-05-14 09:48:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)