Lets do it!
1.1. Generalized Linear Models ¶
1.1.广义线性模型
The following are a set of methods intended for regression in which the target value is expected to be a linear combination of the input variables. In mathematical notion, if is the predicted value.
以下是一组用于线性回归的方法,其中目标值(希望能够符合)与输入变量是线性组合关系。在数学概念中,假设是预测值。
Across the module, we designate the vector as coef_
and as intercept_
.
在整个模块中,我们指定向量作为系数(对应的权重)coef_ ,以及作为截距intercept_。
To perform classification with generalized linear models, see Logistic regression.
使用广义线性模型完成分类,请参阅 Logistic回归。
1.1.1. Ordinary Least Squares
1.1.1.普通最小二乘法
LinearRegression
fits a linear model with coefficients to minimize the residual sum of squares between the observed responses in the dataset, and the responses predicted by the linear approximation. Mathematically it solves a problem of the form:
LinearRegression模块用来拟合系数为 的线性模型,来得到数据集中观察样本的残差平方和的最小值,并通过线性近似预测。用数学式子表达:
LinearRegression
will take in its fit
method arrays X, y and will store the coefficients of the linear model in its coef_
member:
LinearRegression模块将采用其fit方法拟合数组X,y并将其线性模型的系数存储在其 coef_成员中:
However, coefficient estimates for Ordinary Least Squares rely on the independence of the model terms. When terms are correlated and the columns of the design matrix