File tree 1 file changed +10
-11
lines changed
algorithms/linfa-linear/src
1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -21,22 +21,21 @@ use linfa::traits::{Fit, PredictInplace};
21
21
derive( Serialize , Deserialize ) ,
22
22
serde( crate = "serde_crate" )
23
23
) ]
24
- /// An ordinary least squares linear regression model.
24
+ /// An ordinary least squares univariate linear regression model.
25
25
///
26
- /// LinearRegression fits a linear model to minimize the residual sum of
27
- /// squares between the observed targets in the dataset, and the targets
28
- /// predicted by the linear approximation.
26
+ /// Given predictors `x` and responses `y` ordinary least squares linear
27
+ /// regression estimates a model of the form
29
28
///
30
- /// Ordinary least squares regression solves the overconstrainted model
29
+ /// `y = xW + b`
31
30
///
32
- /// y = Ax + b
31
+ /// by finding a matrix `W` and a vector `b` which minimize the sum of the
32
+ /// squared L_2 norms `||y_j - x_jW - b||_2^2` for a dataset
33
+ /// `{(x_j, y_j) for j in 1..=n_samples}`.
33
34
///
34
- /// by finding x and b which minimize the L_2 norm ||y - Ax - b||_2.
35
+ /// The algorithm is only implemented for _univariate_ regression. This means
36
+ /// that `b` and `y` are scalars and `W` is just one column.
35
37
///
36
- /// It currently uses the [Moore-Penrose pseudo-inverse]()
37
- /// to solve y - b = Ax.
38
- ///
39
- /// /// ## Examples
38
+ /// ## Examples
40
39
///
41
40
/// Here's an example on how to train a linear regression model on the `diabetes` dataset
42
41
/// ```rust
You can’t perform that action at this time.
0 commit comments