Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Generalized Linear Regressions Models (penalized regressions, robust regressions, ...)

License

NotificationsYou must be signed in to change notification settings

JuliaAI/MLJLinearModels.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

[Linux]CoverageDocumentation
Build Statuscodecov.iostable-docdev-doc

This is a package gathering functionalities to solve a number of generalised linear regression/classification problems which, inherently, correspond to an optimisation problem of the form

$$L(y, X\theta) + P(\theta)$$

where:

  • $L$ is a loss function
  • $X$ is the$n \times p$ matrix of training observations, where$n$ is the number ofobservations (sample size) and$p$ is the number offeatures (dimension)
  • $\theta$ the length$p$ vector of weights to be optimized
  • $P$ is a penalty function

Additional regression/classification methods which do not directly correspond to this formulation may be added in the future.

The core aims of this package are:

  • make these regressions models "easy to call" and callable in a unified way,
  • interface withMLJ.jl,
  • focus on performance including in "big data" settings exploiting packages such asOptim.jl,IterativeSolvers.jl,
  • use a "machine learning" perspective, i.e.: focus essentially on prediction, hyper-parameters should be obtained via a data-driven procedure such as cross-validation.

Head to thequickstart section of the docs to see how to use this package.

NOTES

This section is only useful if you're interested in implementation details or would like to help extend the library. For usage instruction please head to the docs.

Implemented

RegressorsFormulation¹Available solversComments
OLS & RidgeL2Loss + 0/L2Analytical² or CG³
Lasso & Elastic-NetL2Loss + 0/L2 + L1(F)ISTA⁴
Robust 0/L2RobustLoss⁵ + 0/L2Newton, NewtonCG, LBFGS, IWLS-CG⁶no scale⁷
Robust L1/ENRobustLoss + 0/L2 + L1(F)ISTA
Quantile⁸ + 0/L2RobustLoss + 0/L2LBFGS, IWLS-CG
Quantile L1/ENRobustLoss + 0/L2 + L1(F)ISTA
  1. "0" stands for no penalty
  2. Analytical means the solution is computed in "one shot" using the\ solver,
  3. CG = conjugate gradient
  4. (Accelerated) Proximal Gradient Descent
  5. Huber,Andrews,Bisquare,Logistic,Fair andTalwar weighing functions available.
  6. Iteratively re-Weighted Least Squares where each system is solved iteratively via CG
  7. In other packages such as Scikit-Learn, a scale factor is estimated along with the parameters, this is a bit ad-hoc and corresponds more to a statistical perspective, further it does not work well with penalties; we recommend using cross-validation to set the parameter of the Huber Loss.
  8. Includes as special case theleast absolute deviation (LAD) regression whenδ=0.5.
ClassifiersFormulationAvailable solversComments
Logistic 0/L2LogisticLoss + 0/L2Newton, Newton-CG, LBFGSyᵢ∈{±1}
Logistic L1/ENLogisticLoss + 0/L2 + L1(F)ISTAyᵢ∈{±1}
Multinomial 0/L2MultinomialLoss + 0/L2Newton-CG, LBFGSyᵢ∈{1,...,c}
Multinomial L1/ENMultinomialLoss + 0/L2 + L1ISTA, FISTAyᵢ∈{1,...,c}

Unless otherwise specified:

  • Newton-like solvers use Hager-Zhang line search (default inOptim.jl)
  • ISTA, FISTA solvers use backtracking line search and a shrinkage factor ofβ=0.8

Note: these models were all tested for correctness whenever a direct comparison with another package was possible, usually by comparing the objective function at the coefficients returned (cf. the tests):

  • (againstscikit-learn): Lasso, Elastic-Net, Logistic (L1/L2/EN), Multinomial (L1/L2/EN)
  • (againstquantreg): Quantile (0/L1)

Systematic timing benchmarks have not been run yet but it's planned (seethis issue).

Current limitations

  • The models are built and tested assumingn > p; if this doesn't hold, tricks should be employed to speed up computations; these have not been implemented yet.
  • CV-aware code not implemented yet (code that re-uses computations when fitting over a number of hyper-parameters); "Meta" functionalities such as One-vs-All or Cross-Validation are left to other packages such as MLJ.
  • No support yet for sparse matrices.
  • Stochastic solvers have not yet been implemented.
  • All computations are assumed to be done in Float64.

Possible future models

Future

ModelFormulationComments
Group LassoL2Loss + ∑L1 over groups
Adaptive LassoL2Loss + weighted L1A
SCADL2Loss + SCADA,B,C
MCPL2Loss + MCPA
OMPL2Loss + L0LossD
SGD Classifiers*Loss + No/L2/L1 and OVASkL
  • (⭒) should be added soon

Other regression models

There are a number of other regression models that may be included in this package in the longer term but may not directly correspond to the paradigmLoss+Penalty introduced earlier.

In some cases it will make more sense to just useGLM.jl.

Sklearn's list:https://scikit-learn.org/stable/supervised_learning.html#supervised-learning

ModelNoteLink(s)
LARS--
Quantile Regression--Yang et al, 2013,QuantileRegression.jl
L∞ approx (Logsumexp)--slides
Passive Agressive--Crammer et al, 2006SkL
Orthogonal Matching Pursuit--SkL
Least Median of Squares--Rousseeuw, 1984
RANSAC, Theil-SenRobust regOverview RANSAC,SkL,SkL,More Ransac
Ordinal regressionneed to figure out how they workE
Count regressionneed to figure out how they workR
Robust M estimators--F
Perceptron, MIRA classifierSklearn just does OVA with binary in SGDClassifH
Robust PTS and LTS--PTSLTS

What about other packages

While the functionalities in this package overlap with a number of existing packages, the hope is that this package will offer a general entry point for all of them in a way that won't require too much thinking from an end user (similar to how someone would use the tools fromsklearn.linear_model).If you're looking for specific functionalities/algorithms, it's probably a good idea to look at one of the packages below:

There's alsoGLM.jl which is more geared towards statistical analysis for reasonably-sized datasets and does (as far as I'm aware) lack a few key functionalities for ML such as penalised regressions or multinomial regression.

References

Dev notes

Packages

No packages published

Contributors9

Languages


[8]ページ先頭

©2009-2025 Movatter.jp