Module Modelkit.Robust_scaler

Median centering and percentile-range scaling.

Quantiles use linear interpolation over sorted training values. A zero percentile range is replaced by one. Centering and scaling can be disabled independently; input values and quantile bounds must be finite, and sample weights are rejected.

type params = {
  1. with_centering : bool;
  2. with_scaling : bool;
  3. quantile_range : float * float;
}
type t
type fitted
val create : ?with_centering:bool -> ?with_scaling:bool -> ?quantile_range:(float * float) -> unit -> (t, Error.t) result
val center : 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