Skip to main content

IsotonicRegression

Non-parametric monotonic regression: fits the best non-decreasing (or non-increasing) step function to 1-D data via the Pool-Adjacent-Violators Algorithm.

Algorithm

PAVA merges adjacent blocks that violate monotonicity, replacing them with their weighted mean, in O(n log n). Out-of-range queries follow the out_of_bounds policy (NaN, clip, or raise).

Constructor

Skigen::IsotonicRegression<Scalar> model(std::optional<Scalar> y_min = nullopt, std::optional<Scalar> y_max = nullopt, IsotonicIncreasing = True, OutOfBounds = Nan);

Parameters

ParameterDefaultDescription
y_min / y_maxnulloptOptional clamps on the output.
increasingTrueDirection (True, False, Auto).
out_of_boundsNanBehaviour outside the training range.

Methods

MethodDescription
fit(X, y)Run PAVA.
predict(X)Interpolate the fitted step function.
transform(X)Alias of predict.

Fitted Attributes

AccessorDescription
increasing_resolved()Resolved monotonic direction.

Example

Skigen::IsotonicRegression<double> iso;
iso.fit(X, y);
auto yhat = iso.predict(X_test);
Verified against scikit-learn

This estimator is checked by the parity suite. See the generator tests/parity/generate_isotonic_reference.py and the reference fixtures in tests/parity/data/isotonic/, exercised by tests/parity/parity_isotonic.cpp.

API Reference

For full signatures see the IsotonicRegression API Reference.