Module Modelkit.Linear_regression

Weighted ordinary least squares using column-pivoted Householder QR.

The solver never forms normal equations. It reports numerical rank and returns a deterministic basic least-squares solution for rank-deficient inputs. The optional intercept is fitted without regularization. Fit costs O(samples * features squared) and prediction costs O(samples * features).

type params = {
  1. fit_intercept : bool;
}
type t
type fitted
val create : ?fit_intercept:bool -> unit -> t
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