Bentrix Docs
HomePricingDashboard

Measuring an output

How each kind is scored against what came — only against bars that had not closed when the value arrived — what you hand over for what Bentrix cannot compute, and a comparison of several outputs side by side.

01In plain words

A model's numbers are a claim. Measuring checks the claim: each value the model gave is paired with what the market did after that value arrived, and Bentrix counts how often the model was right — and, for a probability, how often a 70 % really came true seven times in ten.

Measure in the laboratory, on history, before you trust a model anywhere else. A model that does no better than tossing a coin is common, even when it looks sensible. Finding that out costs nothing in the laboratory.

0.5the model said: up if above 0.5✓✗✓✗✗✓✗✓✓✓late: counted, not scored✓✗✓✗✓✗right 9 · wrong 7 · late 1
Bentrix measures a model against what came after each value arrived — never against bars it could not have known. A value that arrived after its bar had closed is counted as late and left out of the score, so a model cannot look better by being slow. A drawing of the idea, not a picture of the application.

02The rule

Every value is scored only against a bar that had not closed when it arrived. A value that could already see its bar is counted late and never scored; one whose bar has not closed yet is pending. So a model that is slow, or that sends its answer after the fact, is never credited for it.

03A report

output_report scores one output of one model on one market, against the workbench's bars up to its clock:

KindMeasures
A probabilityAUC, Brier score, log-loss, a ten-bin calibration curve, the hits and misses at your threshold
Another numberMAE, RMSE, mean signed error, Pearson and Spearman correlation with the step's move
Named outcomeslog-loss, accuracy, each outcome's precision, recall and F1
Quantilespinball loss and coverage at each level
A rankper date: Spearman correlation — its mean, spread, ratio and worst run — against your target, and apart against the raw move
An eventthe probability's measures, the lead time from the fire to the event, the fires nothing followed
Levelsthe share of trades whose target came before the stop, from the bars' highs and lows
A position, weights, an actionmeasured in money only, by a laboratory strategy run
Textnever measured

Name the interval the steps are bars of where the output's horizon does not.

app = bentrix.connect(name="my-program")       # as in "your first output, step by step"
report = app.output.report(bench, "EURUSD", "dir_v4", "direction", interval="H1")

04What Bentrix cannot compute

Some outcomes are not in the bars: the label your own rule gives, whether the event came, a tournament's residual target. Hand them over with output_actual_put — one realised thing per anchor: a value, a label or an event. An anchor past the workbench's clock is refused: what has not happened cannot have been realised.

05A comparison

output_compare sets the reports of several outputs on one market side by side, by name — never ranked. A comparison is your laboratory's instrument: nothing here is published or ranked anywhere else.

06The measures in plain words

You will meet these names in a report. You do not need the formulas to use them:

MeasureWhat it tells youGood is
AUCHow well the model's numbers tell the moves that came true from those that did not.0.5 is a coin toss. Above 0.5 is better than chance; 1 is perfect. Below 0.5 means the model is, on the whole, backwards.
Brier scoreHow far the probabilities were from what happened, on average.Lower is better. 0.25 is what saying 0.5 every time gives.
Log-lossLike the Brier score, but it punishes being confidently wrong much harder.Lower is better.
CalibrationWhether the probabilities mean what they say: of all the times the model said about 0.7, did about 70 % come true? Shown in ten groups.Each group's came true close to its mean.
At your thresholdThe hits and misses where your meaning acts: right buys (true positives), wrong buys (false positives), right nothings (true negatives) and missed rises (false negatives).More right than wrong — after you count the costs a trade would pay.
Precision and recallPrecision: of the times the model said yes, how often it was right. Recall: of the times the answer was yes, how often the model said so.Higher is better; one usually rises as the other falls.
F1 and MatthewsOne number each that balances the hits and misses.Higher is better. Matthews is 0 for chance and 1 for perfect.
MAE, RMSEFor a number that is not a probability: how far it was from what came, on average. RMSE weighs big misses more.Lower is better.
Mean signed errorWhether the model leans one way — always a little too high, or too low.Close to 0.
Correlation (Pearson, Spearman)Whether the model's numbers go up and down with what came.0 is no link; 1 moves together; −1 moves opposite.
Pinball loss, coverageFor quantiles: how good each level is, and how often the outcome really fell below it.Coverage close to the level — 0.95 for the 95th percentile.
Lead timeFor an event: how many candles of warning a true alarm gave.More warning, fewer false alarms.

And the counts on every report:

  • scored — the values checked;
  • late — values that arrived after the candle they spoke about had closed: shown, never scored;
  • pending — values whose next candle has not come yet;
  • unrealised — values with nothing to check them against yet, such as an event you have not handed over.

A good score is not a profit. A model that is right 55 % of the time can still lose money once spreads, commissions and timing are counted. A strategy run in the laboratory, with costs, is where that is seen.

07The measures themselves

Bentrix's AUC, Brier score, log-loss, Matthews correlation, Pearson and Spearman correlation, multi-outcome log-loss and pinball loss are pinned against the reference implementations of scikit-learn and SciPy on the same inputs, to twelve decimal places.

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed