Preprocessing Lodestar.Preprocessing - CyrilB1531/lodestar GitHub Wiki
Development build. This page describes
main, not a released package. The latest published Lodestar.Preprocessing is 0.2.0 — read its documentation.
Lodestar.Preprocessing
Feature preprocessing with scikit-learn's semantics: the standard, min-max, max-abs and
robust scalers, the quantile and power transformers, one-hot encoding, binning, imputation
(simple and k-nearest-neighbour), polynomial features and the cross-validation splitters —
stratified, grouped, time-ordered and repeated, shuffled by scikit-learn's own random_state. Each
transformer is fitted on arrays or a CsrMatrix and applied to spans, with its fitted statistics
readable.
Install
dotnet add package Lodestar.Preprocessing
Example
using Lodestar.Preprocessing;
// Row-major: two features per row, three rows. The second is constant.
double[] samples = [1.0, 10.0, 2.0, 10.0, 4.0, 10.0];
StandardScaler scaler = StandardScaler.Fit(samples, featureCount: 2);
double[] standardised = scaler.Transform(samples);
double first = standardised[0]; // -1.069…
Parity
Replayed against sklearn.preprocessing and sklearn.model_selection.
docs/equivalence.md maps each Python call to its C#
counterpart, with every deliberate divergence.
Dependencies
A core package (decision 0003),
built for net10.0 and netstandard2.0:
Lodestar.Stats0.5.0 or laterLodestar.Abstractions0.2.1 or laterLodestar.Cluster0.2.0 or later
Documentation
- Reference: preprocessing/encoding
- Reference: preprocessing/scaling
- Reference: preprocessing/splitting
- Reference: preprocessing/transforming
- Changelog
- Performance
- All packages