OOrderSaffron
Product

Product features · Unweighted isotonic regression

01

Inspect each pooled block beside the observation sequence so a flattened segment can be explained by its least-squares constraint.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Unweighted isotonic regression

● ● ●OrderSaffron●
A concrete starting point · Unweighted isotonic regression ×
from math import isfinite
def isotonic_fit(values):
    if type(values) is not list or len(values) > 128:
        raise ValueError("bounded list")
    if any(type(x) not in (int, float) or abs(x) > 10**6 or
           not isfinite(x) for x in values):
        raise ValueError("bounded finite values")
    blocks = []
    for value in values:
        blocks.append([float(value), 1])
        while len(blocks) > 1 and (
            blocks[-2][0] / blocks[-2][1] > blocks[-1][0] / blocks[-1][1]):
            total, count = blocks.pop()
            blocks[-1][0] += total; blocks[-1][1] += count
    return [total / count for total, count in blocks for _ in range(count)]
✳Fit a nondecreasing sequence to at most 128 finite observations bounded by ±10^6 with equal least-squares weights.
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗