Skip to content

Preprocessing minmaxscaler partialfit

github-actions[bot] edited this page Sep 21, 2026 · 11 revisions

Development build. This page describes main, not a released package. The latest published Lodestar.Preprocessing is 0.1.0 — read its documentation.

HomePreprocessingFeature scaling

MinMaxScaler.PartialFit

Folds another batch into the range and the scale it implies, as partial_fit does.

public MinMaxScaler PartialFit(ReadOnlySpan<double> samples)

Parameterssamples is the next batch, row-major, with FeatureCount values per row.

Returns — a new scaler summarising every batch seen so far; the one it was called on is unchanged.

ExceptionsArgumentException when samples holds no row, a partial one, or a non-finite value.

Example — a second batch that widens the range, and one that does not.

using Lodestar.Preprocessing;

MinMaxScaler scaler = MinMaxScaler.Fit([0.0, 10.0], featureCount: 1);

MinMaxScaler wider = scaler.PartialFit([20.0]);
MinMaxScaler same = scaler.PartialFit([5.0]);

double widened = wider.DataMaximum[0];  // => 20
double unmoved = same.DataMaximum[0];   // => 10

Remarks — a running minimum and maximum, and the scale recomputed from them by the same code Fit uses, so the two cannot drift. A batch inside the range moves nothing but SampleCount.

It returns a new scaler and leaves this one alone — see StandardScaler.PartialFit for why.

Applies to — net10.0, netstandard2.0.

See alsoMinMaxScaler, MinMaxScaler.Fit.

Clone this wiki locally