Preprocessing maxabsscaler partialfit - CyrilB1531/lodestar GitHub Wiki
Development build. This page describes
main, not a released package. The latest published Lodestar.Preprocessing is 0.1.0 — read its documentation.
Home › Preprocessing › Feature scaling
Folds another batch into the largest absolute value and the scale, as partial_fit does.
public MaxAbsScaler PartialFit(ReadOnlySpan<double> samples)Parameters — samples 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.
Exceptions — ArgumentException when samples holds no row, a partial one, or a non-finite value.
Example — the running maximum absolute value.
using Lodestar.Preprocessing;
MaxAbsScaler scaler = MaxAbsScaler.Fit([2.0, 1.0], featureCount: 1).PartialFit([-8.0]);
double largest = scaler.MaximumAbsolute[0]; // => 8
int seen = scaler.SampleCount; // => 3Remarks — the largest absolute value, so a negative batch can move it where a maximum would
not. The near-constant floor is applied to the result, as Fit applies it.
It returns a new scaler and leaves this one alone — see
StandardScaler.PartialFit for why.
Applies to — net10.0, netstandard2.0.
See also — MaxAbsScaler, MaxAbsScaler.Fit.