Liking cljdoc? Tell your friends :D

scicloj.metamorph.ml.regression

Regression models for continuous target prediction.

This namespace provides implementations of various regression algorithms with a consistent metamorph.ml training and prediction interface. Models support statistical output formats (tidy, glance, augment) for analysis and diagnostics.

Available Models:

OLS (Ordinary Least Squares)

  • :metamorph.ml/ols: Apache Commons Math implementation (Java-based)
  • :fastmath/ols: FastMath implementation (pure Clojure) Solves for regression coefficients β in: y = Xβ + ε Assumes linear relationships and homoscedastic errors.

GLM (Generalized Linear Model)

  • :fastmath/glm: FastMath GLM implementation Extends linear regression to non-normal distributions and non-linear relationships via link functions and variance models.

Baseline Model

  • :metamorph.ml/dummy-regressor: Predicts mean of training target Useful sanity check - models should outperform this baseline.

Model Output Functions:

  • :tidy-fn: Extracts model coefficients with statistics Returns dataset with :term, :estimate, :std.error, :statistic, :p.value
  • :glance-fn: Extracts model-level diagnostics Returns dataset with :r.squared, :adj.r.squared, :rss, :aic, :bic, etc.
  • :augment-fn: Adds model predictions and residuals to data Returns augmented dataset with :.fitted and :.resid columns

Example Usage (in metamorph pipeline):

(ml/train
  data
  {:model-type :fastmath/ols})
   

Model Diagnostics:

(ml/glance model)        ; Overall model metrics
(ml/tidy model)          ; Coefficient table
(ml/augment model data)  ; Predicted values and residuals

See also: scicloj.metamorph.ml.r-model-matrix for R-formula-based feature engineering

Regression models for continuous target prediction.

 This namespace provides implementations of various regression algorithms with
 a consistent metamorph.ml training and prediction interface. Models support
 statistical output formats (tidy, glance, augment) for analysis and diagnostics.

 Available Models:

 **OLS (Ordinary Least Squares)**

 - `:metamorph.ml/ols`: Apache Commons Math implementation (Java-based)
 - `:fastmath/ols`: FastMath implementation (pure Clojure)
 Solves for regression coefficients β in: y = Xβ + ε
 Assumes linear relationships and homoscedastic errors.

 **GLM (Generalized Linear Model)**

 - `:fastmath/glm`: FastMath GLM implementation
 Extends linear regression to non-normal distributions and non-linear relationships
 via link functions and variance models.

 **Baseline Model**
 
 - `:metamorph.ml/dummy-regressor`: Predicts mean of training target
 Useful sanity check - models should outperform this baseline.

 Model Output Functions:

 - **:tidy-fn**: Extracts model coefficients with statistics
   Returns dataset with :term, :estimate, :std.error, :statistic, :p.value
 - **:glance-fn**: Extracts model-level diagnostics
   Returns dataset with :r.squared, :adj.r.squared, :rss, :aic, :bic, etc.
 - **:augment-fn**: Adds model predictions and residuals to data
   Returns augmented dataset with :.fitted and :.resid columns

 Example Usage (in metamorph pipeline):
 ```
 (ml/train
   data
   {:model-type :fastmath/ols})
    
 ```

 Model Diagnostics:
 ```
 (ml/glance model)        ; Overall model metrics
 (ml/tidy model)          ; Coefficient table
 (ml/augment model data)  ; Predicted values and residuals
```   

 See also: [[scicloj.metamorph.ml.r-model-matrix]] for R-formula-based feature engineering
raw docstring

extend-intervallclj

(extend-intervall [start end] extension)
source

inclusive-rangeclj

(inclusive-range start end)
(inclusive-range start end step)

Return a sequence of nums from START to END, both inclusive, by STEP.

Return a sequence of nums from START to END, both inclusive, by STEP.
sourceraw docstring

lay-cooks-dclj

(lay-cooks-d pose
             cooks-d
             params-count
             pos-neg
             min-std-resid
             max-std-resid
             max-hat)
source

min-max-extendedclj

(min-max-extended s extension)
source

residual-vs-leverage-poseclj

(residual-vs-leverage-pose augmented-ds model options)
source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close