Module Modelkit.Standard_scaler

Column-wise centering and population-standard-deviation scaling.

Fitting and transformation require finite inputs. Constant features use a scale of one, so centering maps them to zero without division by zero. Optional sample weights give weighted means and weighted population variances over positively weighted rows; an all-zero weight vector is a typed error. Fit and transform are O(rows * columns) and transform allocates one dense output matrix.

type params = {
  1. with_mean : bool;
  2. with_std : bool;
}
type t
type fitted
val create : ?with_mean:bool -> ?with_std:bool -> unit -> t
val mean : fitted -> Vector.t
val variance : fitted -> Vector.t
val scale : fitted -> Vector.t
include TRANSFORMER with type t := t and type params := params and type target = unit and type fitted := fitted and type rng = Rng.t
include SPECIFICATION with type t := t with type params := params
val clone : t -> t
val params : t -> params
type target = unit
type rng = Rng.t
val fit : t -> ?sample_weight:Sample_weight.t -> rng:rng -> feature_schema:Feature_schema.t -> x:Matrix.t -> y:target option -> unit -> (fitted, Error.t) result
val transform : fitted -> feature_schema:Feature_schema.t -> x:Matrix.t -> (Matrix.t, Error.t) result
val fitted_params : fitted -> params
val input_schema : fitted -> Feature_schema.t
val output_schema : fitted -> Feature_schema.t