学习目标:
sklearn的加州数据集预测,回归,评价模型学习产出:
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.datasets import load_boston
from sklearn.model_selection import train_test_split
#首先要加载数据
boston = load_boston()
boston_data = boston.data
boston_target = boston.target
names = boston.feature_names
print(boston.DESCR,end='\n')
print(boston.data[0,:])
#将数据集划分成为训练集和测试集
boston_train,boston_test