-
Notifications
You must be signed in to change notification settings - Fork 0
Preprocessing 0.2.0 simpleimputer
Lodestar.Preprocessing 0.2.0. This page is frozen at that release. Read the current documentation for what
mainsays now. A link to a decision or a migration page followsmain, and leaves the archive.
Home › Encoding and imputation
Fills the missing values of each feature with a statistic of the ones present, at
sklearn.impute.SimpleImputer parity.
public sealed class SimpleImputerProperties — FeatureCount and SampleCount are the shape it was fitted on, and Statistics
is what each feature's missing values are filled with — the reference's statistics_.
Example — the mean of what is present, per feature.
using Lodestar.Preprocessing;
// Two features; each is missing one value.
double[] samples = [1.0, 10.0, 2.0, double.NaN, double.NaN, 30.0];
SimpleImputer imputer = SimpleImputer.Fit(samples, featureCount: 2);
double first = imputer.Statistics[0]; // => 1.5
double second = imputer.Statistics[1]; // => 20Remarks — NaN is what marks a value missing, as it does in the reference: there is no
separate mask, and a matrix with no NaN comes back unchanged. An infinity is refused — it marks
nothing and would carry into every statistic.
Applies to — net10.0, netstandard2.0.
See also — SimpleImputerOptions, ImputationStrategy.
| Member | What it does |
|---|---|
SimpleImputer.Fit |
Fits an imputer on a row-major sample matrix. |
SimpleImputer.Transform |
Fills the missing values of a matrix. |