package modelkit

Build not checked
  1. Overview
  2. Docs
Portable classical machine learning workflows for OCaml

Install

dune-project
 Dependency

Authors

Maintainers

Sources

modelkit-0.4.1.tbz
sha256=7a7af032790248b5d1d5392bbf29f8c8163df2e7f50ab5801cdaed5fd2c543e1
sha512=185bc224afc9b141d54b89a564694438a268429ba9c58dd3a402da31cb29f3e1eefd3643a76766ce9170c5f6c927f307873d51e4e3ce08aece00884cebbe0e2a

doc/modelkit/Modelkit/Lasso_path/index.html

Module Modelkit.Lasso_path

A descending lasso regularization path fitted with deterministic warm starts.

Without explicit alphas, fit constructs count logarithmically spaced values from the smallest alpha producing the all-zero centered solution to epsilon times that value. Explicit alphas are copied, validated, and sorted descending. Coefficient-matrix rows, intercepts, reports, and model indices all use this same order. A path of a alpha values costs the sum of its warm-started coordinate-descent sweeps and stores O(a * p) fitted coefficients.

type params = {
  1. fit_intercept : bool;
  2. epsilon : float;
  3. count : int;
  4. tolerance : float;
  5. max_iterations : int;
}
type t
type fitted
val create : ?fit_intercept:bool -> ?epsilon:float -> ?count:int -> ?tolerance:float -> ?max_iterations:int -> unit -> (t, Error.t) result
val fit : t -> ?alphas:Vector.t -> ?sample_weight:Sample_weight.t -> rng:Rng.t -> feature_schema:Feature_schema.t -> x:Matrix.t -> y:Target.regression Target.t -> unit -> (fitted, Error.t) result
val params : t -> params
val alphas : fitted -> Vector.t
val coefficients : fitted -> Matrix.t

Returns one coefficient row per descending alpha.

val intercepts : fitted -> Vector.t
val reports : fitted -> Solver_report.t array
val model : fitted -> index:int -> (Lasso_regression.fitted, Error.t) result