# 导入sklearn库下的linear_model类 from sklearn import linear_model # 一元线性回归 # 转化自变量数据为矩阵 x = [[6], [8], [10], [14]