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_regression/index.html

Module Modelkit.Lasso_regression

Weighted L1-regularized scalar regression.

The portable solver uses deterministic cyclic coordinate descent to minimize weighted mean squared error plus alpha times the L1 coefficient norm. The optional intercept is not penalized. alpha is finite and non-negative; tolerance and max_iterations control checked convergence. Iteration exhaustion returns a typed convergence error. For n samples and p features, each coordinate-descent sweep costs O(n * p) and fitting uses O(n + p) working storage.

type params = {
  1. alpha : float;
  2. fit_intercept : bool;
  3. tolerance : float;
  4. max_iterations : int;
}
type t
type fitted
val create : ?alpha:float -> ?fit_intercept:bool -> ?tolerance:float -> ?max_iterations:int -> unit -> (t, Error.t) result
val coefficients : fitted -> Vector.t
val intercept : fitted -> float
val report : fitted -> Solver_report.t
include REGRESSOR with type t := t and type params := params and type fitted := fitted and type rng = Rng.t
include ESTIMATOR with type target = Target.regression Target.t and type prediction = Target.regression Target.t with type t := t with type params := params with type fitted := fitted with type rng = Rng.t
include SPECIFICATION with type t := t with type params := params
val clone : t -> t
val params : t -> params
type prediction = Target.regression Target.t
type rng = Rng.t
val fit : t -> ?sample_weight:Sample_weight.t -> rng:rng -> feature_schema:Feature_schema.t -> x:Matrix.t -> y:target -> unit -> (fitted, Error.t) result
val predict : fitted -> feature_schema:Feature_schema.t -> x:Matrix.t -> (prediction, Error.t) result
val fitted_params : fitted -> params
val feature_schema : fitted -> Feature_schema.t