Preprocessing maxabsscaler inversetransform - 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
Undoes Transform, returning values on the original scale.
public double[] InverseTransform(ReadOnlySpan<double> samples)public CsrMatrix InverseTransform(CsrMatrix samples)The second overload takes a CsrMatrix and returns a new one storing the same positions, each value multiplied by its column's Scale: a zero stays a zero, so nothing absent becomes stored.
Parameters — samples is the scaled matrix, row-major, with FeatureCount values per row.
Returns — a new array of the same length, back on the input scale.
Exceptions — ArgumentException when samples holds no row, a partial one, or a non-finite value.
The sparse overload throws ArgumentNullException when samples is null, ArgumentException when it holds no row or its column count is not FeatureCount or it stores a non-finite value.
Example — the inverse leaves the unit interval that clipping bounded.
using Lodestar.Preprocessing;
MaxAbsScaler scaler = MaxAbsScaler.Fit([0.0, 10.0], 1, new MaxAbsScalerOptions { Clip = true });
double back = scaler.InverseTransform([5.0])[0]; // => 50Remarks — it never clips, even when the scaler does, for the reason
MinMaxScaler.InverseTransform gives: a clipped value has lost
what it was.
Applies to — net10.0, netstandard2.0.
See also — MaxAbsScaler.Transform, MaxAbsScaler.