predict是训练后返回预测结果,是标签值. predict_proba返回的是一个 n 行 k 列的数组, 第 i 行 第 j 列上的数值是模型预测 第 i 个预测样本为某个标签的概率,并且每一行的概率和为1.# conding :utf-8 from sklearn.linear_model import LogisticRegression import numpy as np x_train = np.array([[1,2,3], [1,
数据一:波士顿房价(适合做回归),以后直接用boston标记 这行代码就读进来了boston = sklearn.datasets.load_boston()查询具体数据说明,用这个代码:print boston.DESCR输出如下:Data Set Characteristics: :Number of Instances: 506 :Number of Attributes: 13 numeric/categorical predictive :Median Value (attribute