package modelkit
Module Modelkit.Simple_imputer
Column-wise replacement of NaN missing values.
Mean and median fitting fail when a training feature contains no observed value. Constant values must be finite. Transform rejects infinities and preserves the input feature schema. Sample weights are rejected. Mean fitting is O(rows * columns); median fitting is O(columns * rows * log rows) with one temporary column allocation.
val mean : unit -> tval median : unit -> tinclude TRANSFORMER
with type t := t
and type params := params
and type target = unit
and type fitted := fitted
and type rng = Rng.t
type rng = Rng.tval fit :
t ->
?sample_weight:Sample_weight.t ->
rng:rng ->
feature_schema:Feature_schema.t ->
x:Matrix.t ->
y:target option ->
unit ->
(fitted, Error.t) resultval input_schema : fitted -> Feature_schema.tval output_schema : fitted -> Feature_schema.t