Preprocessing minmaxscaler 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)Parameters — samples is the mapped 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.
Example — the inverse walks straight back out of the range.
using Lodestar.Preprocessing;
MinMaxScaler scaler = MinMaxScaler.Fit([0.0, 10.0], 1, new MinMaxScalerOptions { Clip = true });
double back = scaler.InverseTransform([2.0])[0]; // => 20Remarks — it never clips, even when the scaler does. A value clipped on the way in has lost what it was, and clipping again on the way out would hide that rather than undo it; the reference draws the line in the same place.
A feature whose Scale was floored to 1 does not round-trip to its own spread either — that step
threw the spread away, which is the point of forcing it.
Applies to — net10.0, netstandard2.0.
See also — MinMaxScaler.Transform, MinMaxScaler.