Skip to content

Preprocessing minmaxscaler inversetransform

github-actions[bot] edited this page Sep 24, 2026 · 14 revisions

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

Home › Preprocessing › Feature scaling

MinMaxScaler.InverseTransform

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];  // => 20

Remarks — 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.

Clone this wiki locally