-
Notifications
You must be signed in to change notification settings - Fork 89
Closed
Description
Bug: Incorrect condition for dimension check
Lines 249 to 253 in 0caa830
| if n <= p { | |
| return Err(Failed::fit( | |
| "Number of rows in X should be >= number of columns in X", | |
| )); | |
| } |
The condition n <= p is inconsistent with the error message, it should be n < p. (my case is full-rank)
L1 penalty normalization not documented
Line 12 in 0caa830
| //! \\[\underset{\beta}{minimize} \space \space \sum_{i=1}^n \left( y_i - \beta_0 - \sum_{j=1}^p \beta_jx_{ij} \right)^2 + \alpha \sum_{j=1}^p \lVert \beta_j \rVert_1\\] |
the penalty in docs is alpha * sum(abs(beta)), but I think it's alpha * n * sum(abs(beta)) in the code, where n is the number of observations.
Feature Request: Option to disable intercept fitting
smartcore/src/linear/lasso_optimizer.rs
Line 64 in 0caa830
| let y = y.sub_scalar(T::from_f64(y.mean_by()).unwrap()); |
Currently, the mean is always substracted from y. Is it possible to add a parameter (e.g., fit_intercept: bool, or more specific substract_mean_from_y: bool) to allow users to disable intercept fitting? (force the beta_0 parameter in the formula to 0)
Metadata
Metadata
Assignees
Labels
No labels