Artificial intelligenceIntermediate25 min read

When a model says 80%: checking its probabilities before trading

Learn to review probability calibration in trading, separate accuracy from confidence, and turn forecasts into decisions with explicit costs and payoffs.

Imagine keeping one hundred cards. Each contains a prediction issued before the outcome was known: “probability of an upward move, eighty percent.” When the time comes to open them, sixty correspond to an upward move and forty do not. The model selected the majority class correctly in sixty cases, but its confidence label described a higher frequency than this group actually delivered.

We cannot turn one hundred cards into a law of the market. We can ask a precise question: what relationship connects the number the model announces with what happens afterwards? That is the starting point for calibration. It is not simply about predicting direction correctly or plotting a profit curve. It is about checking whether probabilities have a defensible empirical interpretation.

Our context is research into Forex strategies. Every quantity, group and payoff in this article is hypothetical and educational. None represents Atlas robots, historical product results or expected returns. Small examples are useful because a probability becomes much easier to discuss when we can reconstruct its events, its errors and the decisions someone might make from it.

1. Define the event before writing the percentage

“Probability of going up” leaves too many questions unanswered. Specify which price is compared, the starting instant, the horizon and what happens if the price does not change. The probability that the mid-price finishes above its current level in fifteen minutes differs from the probability that a purchase executed at the ask can later be closed profitably at the bid. Both can be legitimate tasks, but their labels are different.

We also need to know when the event resolves. A forecast issued at ten o’clock for a one-hour horizon does not have its final label at five past ten. Updating a calibrator at that moment using the eventual outcome introduces future information. The problem remains even if the main model was trained correctly. The layer that transforms its probabilities also learns from data and has its own information requirements.

A simple contract can define a binary event: one when a specified price difference is strictly positive, zero otherwise. An unchanged price then belongs to zero by explicit choice. Another definition could add a neutral region, but that would change the classes and the percentage’s interpretation. Calibration belongs to a defined event, rather than to a model in the abstract.

The horizon matters because it changes the question, the dependence between observations and potentially the base frequency. Calibration studied for fifteen-minute events cannot automatically be transferred to daily decisions. Nor can the probability of finishing above the starting price be treated as the probability of hitting a target before a stop. That second event requires a price path and a different set of rules.

Store an event identifier, issue time, horizon, model version and resolution time with each prediction. Without these details, the percentage is difficult to audit. With them, we can check whether the evaluator is comparing equivalent promises and whether the system genuinely had the information it used when making them. This is the foundation of the probability record, before any particular calibration method enters the project.

2. Ranking well does not mean measuring well

A model can assign increasing scores to increasingly favourable opportunities while exaggerating all their probabilities. Imagine three observations with scores of zero point fifty-one, zero point fifty-two and zero point fifty-three. Another transformation converts them to zero point six, zero point seven and zero point eight. Their order remains the same, but their numerical meaning has changed substantially.

A ranking metric may regard those lists as equivalent. A decision requiring a probability above zero point seventy-five will not: it selects nothing from the first list and the final observation from the second. Discrimination and calibration are different properties. The first asks whether a model distinguishes cases; the second asks how its probabilities relate to subsequent frequencies.

The opposite extreme is a model that always announces zero point six in a population whose event frequency is exactly sixty percent. It may be calibrated in that aggregate sense while failing to distinguish any opportunity from another. It provides no reason to choose one row instead of the next. This prevents “well calibrated” from becoming a universal label for model quality.

Classification accuracy does not resolve the issue either. With a threshold of zero point five, both zero point six and zero point eight produce the same positive class. Changing every card in our example from eighty to sixty percent leaves class accuracy at sixty percent. The description of uncertainty changes, however, and so might a sizing or selection policy that uses the numerical probability rather than only the class.

A useful review keeps three columns separate: the original score, the probability used and the resulting action. If calibration changes the second without changing the ordering of the first, we can identify that effect. If the third changes, we know that a decision depended on the probability level rather than just its rank. This separation reveals where an improvement or deterioration arises instead of attributing everything to “the model.”

3. Read a reliability table with its sample counts

Group predictions with similar values and compare their mean with the event frequency within each group. A reliability table needs both quantities and the number of observations. Writing “the eighty percent group” is insufficient: its predictions might range from seventy-five to eighty-five percent, with a mean different from the interval’s midpoint. The mean of the predictions is the relevant comparison.

The scikit-learn documentation describes calibration diagrams as comparisons between mean predicted probabilities and observed fractions of positives within groups. It also cautions that common global scores combine components and should not be treated as pure calibration measures. We will use that distinction when reading our examples, without turning a smooth-looking plot into a guarantee. Scikit-learn’s probability calibration guide.

Hypothetical group Mean probability Observations Positive events Observed frequency
Low 0.20 20 4 0.20
Middle 0.60 50 30 0.60
High 0.80 100 60 0.60

The first two groups exactly match their frequencies in this constructed example. The third announces eighty percent and observes sixty. This table does not tell us the future frequency. It shows which discrepancy needs investigation and how much material supports it. A point without its count conceals part of the evidence.

Equal-width bins reserve fixed probability intervals but may leave some nearly empty. Bins with similar observation counts provide more support for each point, while moving the boundaries and potentially combining different numerical regions. Neither choice eliminates the trade-off between detail and stability. Fix the convention before comparing models and show what happens in the regions where trading decisions are actually made.

What is missing matters too. If a model never emits a probability above zero point sixty-five, there is no evidence here that it is calibrated near zero point ninety. Extending a diagonal line to one does not fill that gap. Observed calibration has a region of coverage. Outside it, we are extrapolating rather than reporting a check that the chart has somehow performed on our behalf.

Three reliability groups with mean probabilities of twenty, sixty and eighty percent and observed frequencies of twenty, sixty and sixty percent, with their sample counts.
Vertical separation shows a sample discrepancy; counts show the support behind each point. All data are hypothetical.

4. A Brier score we can calculate by hand

For a binary event encoded as zero or one, we will define Brier score as the mean squared difference between predicted probability and outcome. A prediction of zero point eight followed by a positive outcome contributes zero point zero four; followed by a negative outcome, it contributes zero point sixty-four. This binary definition uses a scale from zero to one. Check a library’s convention, especially when moving to multiple classes. Definition and options for brier_score_loss.

Sixty of our one hundred cards have positive outcomes. Their average contribution is zero point six multiplied by zero point zero four: zero point zero two four. The forty negatives contribute zero point four times zero point sixty-four: zero point two five six. Adding the two produces zero point twenty-eight.

Replacing every probability with zero point six on those same rows changes the positive contribution to zero point six times zero point sixteen, or zero point zero nine six. The negatives contribute zero point four times zero point thirty-six, or zero point one four four. The total falls to zero point twenty-four. The difference is zero point zero four, without changing any predicted class at the halfway threshold.

Constant probability Positive contribution Negative contribution Total Brier score
0.80 0.024 0.256 0.280
0.60 0.096 0.144 0.240
0.50 0.150 0.100 0.250

This improvement is an identity in the example, not calibration validated on new observations. We used the frequency of those same cards to choose the replacement number. Announcing success because the adjustment matches them evaluates an answer with the data that determined it. We need subsequent predictions issued after the transformation has already been fixed to investigate whether the correction carries forward.

A useful mathematical intuition is that, if the event’s true probability were an unknown value, the expected squared error from announcing another value could be separated into unavoidable uncertainty and the squared distance to that true probability. The minimum occurs when the correct probability is announced. The practical problem is that this value is unknown and must be estimated from limited samples that may be dependent and changing over time.

Brier calculation for one hundred cases with sixty positives: announcing zero point eight gives zero point twenty-eight, while announcing zero point six gives zero point twenty-four.
A comparison that can be reconstructed without training a model. The change is calculated on the same sample and does not establish generalisation.

5. Log loss and the cost of misplaced certainty

Logarithmic loss penalises the probability assigned to the outcome that actually occurred. For a positive event it uses minus the logarithm of the positive probability; for a negative event, minus the logarithm of its complement. We will use natural logarithms. The metric’s documentation also specifies how extreme probabilities are handled numerically. Scikit-learn’s definition of log_loss.

In the example with sixty positives and forty negatives, always announcing zero point eight produces a mean loss of approximately zero point seven seven eight. Announcing zero point six produces approximately zero point six seven three. Both calculations use exactly the same labels; no new signal has been discovered. The improvement says that the second description assigns less mistaken probabilities to this particular collection of outcomes.

The contrast with Brier becomes visible near the extremes. A negative outcome assigned a positive probability of zero point ninety-nine has a log loss of approximately four point six zero five. If it was assigned zero point eight, the loss is approximately one point six zero nine. Misplaced certainty carries substantial weight. This helps reveal extreme confidence, but it also makes label errors and numerical defects worth checking before interpreting isolated cases.

A proper scoring rule is not a profit function. Optimising a probabilistic loss makes sense for estimating probabilities, but it does not automatically incorporate the size of trading gains, losses or costs. A model can improve log loss in regions where no order is ever executed while deteriorating near a strategy’s decision threshold. Examine both the global score and behaviour in the region relevant to the intended decision.

A constant reference helps interpret the result. Its probability must be estimated from information permitted before evaluation, rather than from the final event frequency in the period being judged. If the complex model barely improves on that reference, evidence of additional predictive value under the metric is limited. A clear improvement still leaves another question: which economic decision does it support, and how stable is that support across the cases that matter?

6. Calibration is another model-fitting step

A calibration transformation takes a score and produces a probability. Even if it has only one parameter, it learns from examples and outcomes. It therefore needs fitting data and a later evaluation that was not used to choose the transformation. A small calibrator is not exempt from overfitting or future-information problems simply because it looks modest beside a large predictor.

For an initial temporal experiment, reserve an early period for fitting the predictor, a later period for fitting the calibrator on predictions from that frozen predictor, and a final period for evaluating them together. The calibrator should receive scores produced without the predictor having learned from those same labels. CalibratedClassifierCV explicitly describes separating estimator-training data from calibration data when calibrating an already fitted model. CalibratedClassifierCV documentation.

Outcome timing adds another restriction. At the end of the calibration period, some labels may still be unresolved because their horizons extend further. Those rows are not available merely because their prediction times have passed. The schedule must follow when outcomes become known. A separation chosen only as a number of rows can be inadequate when horizons vary or event resolution is delayed.

Changing the predictor after fitting the calibrator creates another score distribution. We cannot assume that a transformation learned for the previous version retains its meaning. The deployed artefact is the predictor and calibrator as a versioned pair, together with the data and decision rules. Updating one component requires explaining how the relationship is preserved or checked again.

This design does not impose one universal partition. A rolling procedure can repeat predictor training and calibration as time advances. What matters is reconstructing, for every evaluated prediction, which model issued it, which transformation was applied and which labels were available to fit each component. A library helps execute operations; it cannot decide on our behalf which information was legitimate at that historical instant.

Three chronological periods: fit the predictor, fit the calibrator with the predictor frozen, then evaluate the frozen pair while respecting label resolution times.
The separation represents different data roles. Labels must have resolved before they can be used for fitting.

7. Choose flexibility without inventing information

A sigmoid transformation uses a restricted curve shape to convert scores into probabilities. Isotonic regression permits a more flexible monotonic relationship and can produce flat segments. Niculescu-Mizil and Caruana compare these alternatives and investigate their relationship with the amount of available data. Their experimental results do not provide a universal recommendation for Forex. Predicting Good Probabilities With Supervised Learning.

The practical question is not which technique sounds more sophisticated, but how much complexity the observations can support. With very few high-confidence cases, a flexible function may follow accidental irregularities. A rigid curve may fail to represent a real distortion. This trade-off needs subsequent evaluation and a defined selection criterion, rather than repeated inspection until the plot looks reassuring.

Temperature scaling transforms logits using a positive parameter before converting them into probabilities. Guo and colleagues studied it in neural networks for image and document classification. Their work supports understanding the method and its evaluation in those domains; it does not establish that applying a temperature calibrates a trading network. On Calibration of Modern Neural Networks.

In the binary case, dividing a logit by a positive temperature preserves its ordering before the logistic function is applied. That algebraic property can be checked without attributing a financial advantage to it. An isotonic transformation can introduce ties instead. If a policy selects a fixed number of signals by rank, those ties require a reproducible tie-breaking rule so that the policy remains fully specified.

Calibration does not create information absent from the score. It may correct an estimable numerical relationship, but it does not by itself turn a score without discriminatory ability into an opportunity detector. Compare the constant reference, the original scores and the calibrated version together. This reveals whether we are improving probability estimates or merely moving numbers around within the allowed interval, and whether the chosen method changes anything relevant to the decision.

8. One hundred rows can contain much less variety

The opening cards looked like one hundred separate tests. In market data, consecutive predictions can share much of the same future price movement. With a one-hour horizon and a prediction every minute, nearby labels overlap. Counting them as one hundred independent observations exaggerates the evidence available for estimating a frequency. The row count is easy to calculate; its statistical interpretation requires more thought.

An extreme example makes the problem visible: take twenty events and copy each one five times. There are now one hundred rows but no additional information about the original outcomes. A calibration table retains its proportions, while a naive precision calculation based on one hundred independent trials becomes too optimistic. Real data need not be exact duplicates for relevant dependence to exist.

Counts are not automatically independent sample sizes. Studying uncertainty requires considering how predictions were generated, which horizons they share and which market episodes group them together. Block resampling may be appropriate under its assumptions, but selecting an arbitrary block length does not automatically resolve either dependence or regime changes. The procedure needs a connection to the structure of the observations being studied.

Concentration in a particular condition can matter too. One hundred high-confidence predictions emitted during a single volatile session do not represent one hundred varied contexts. If the intended use includes other sessions, examine that coverage. The answer is not endless fragmentation until no data remain, but a clear account of which regions support the conclusion and where observations are still missing.

With small samples, presenting the observed discrepancy and its limitations is more honest than declaring a model calibrated or miscalibrated forever. A plot describes a collection of forecasts. Turning it into a statement about future probabilities requires additional arguments about stability and representativeness, rather than merely a line close to the diagonal. The uncertainty belongs to the interpretation even when the graphic is visually clean.

Twenty original events copied five times produce one hundred rows without adding new outcomes or independent information.
An extreme hypothetical example: repeated rows enlarge the file, not the collection of original outcomes. Overlapping horizons require their own dependence analysis.

9. An average can hide the region where you act

Suppose a model emits many moderate probabilities and very few high ones. It can achieve an acceptable global score while failing on precisely the small subset selected by a strategy. This does not mean we should ignore the complete dataset. It means evaluation should recognise the intended use and show the decision region alongside its count, rather than allowing a large inactive region to dominate the interpretation.

A grouped calibration error usually combines distances between frequencies and predicted probabilities, weighted by group size. Its value depends on how observations are grouped. Changing boundaries can change within-group cancellations and the result. A single number should therefore not replace the table or become the objective of a repeated search for flattering partitions.

The one-hundred-card example provides a concrete warning. If we use its sixty positives to replace every probability with zero point six, the reliability error of that single group becomes zero on this sample. We have not demonstrated perfect forecasting. We have matched a frequency that was already known. A flawless-looking chart can also be a retrospective fit.

Aggregate calibration may also hide differences across conditions. A group of sixty-percent predictions might combine one session with forty-percent positives and another with eighty-percent positives, in equal proportions. The average is sixty percent. If session identity is known when deciding and persistently affects outcomes, that mixture may be insufficient for the intended use of the percentage, even though the overall point sits on the diagonal.

Subgroup investigation requires discipline. Searching dozens of cuts and highlighting only the best or worst introduces selection. A reasonable review defines relevant conditions before seeing results, shows counts and distinguishes exploratory diagnosis from subsequent verification. Describing where a probability fails does not mean we have learned how to correct it. A proposed correction still needs to be fitted and evaluated under its own information contract.

10. From a probability to an economic decision

Consider a hypothetical trade whose positive event pays twelve gross units and whose negative event loses eight. The transaction cost is one unit in either case. If p is the probability of the positive event, expected result is 12p − 8(1 − p) − 1: the positive payoff weighted by its probability, minus the negative payoff weighted by its probability, minus cost. This simplifies to twenty times p minus nine. Break-even probability is zero point forty-five.

At a probability of zero point six, expected result is three units. At zero point eight, it is seven. If the model announces eighty percent for a group whose event actually occurs sixty percent of the time, that discrepancy changes the economic estimate, even though both numbers produce a trade decision under this simplified contract. This does not establish future profit. It shows how a probability error propagates into an expectation calculation.

Now change the payoffs. The positive event gains four, the negative event loses twelve, and cost remains one. Expected result is sixteen times p minus thirteen. At eighty percent, it is minus zero point two. A high probability can describe an unfavourable trade when losses and costs outweigh the compensation provided by successful outcomes.

Hypothetical contract Gross gain Gross loss Cost Break-even probability Expectation at p = 0.80
A 12 8 1 0.45 7.0
B 4 12 1 0.8125 −0.2

The payoffs are deliberately fixed to separate the concepts. In an actual strategy, gains, losses and costs may vary and depend on the same conditions that produce the probability. Knowing only the probability of an upward move does not provide the required conditional magnitudes. Estimating those quantities adds uncertainty of its own and requires information available at the decision time. A direction label is not a complete payoff distribution.

Nor does the probability determine how much capital to risk. Two contracts with the same expectation can have different loss distributions, relationships with other positions and operational restrictions. A sizing policy needs those elements as well. Calibration improves the interpretation of one input to that policy; it does not authorise skipping the rest of the economic analysis or treating every positive expectation estimate as equally reliable.

At the same eighty-percent probability, contract A has an expected result of seven units and contract B minus zero point two because their payoffs differ.
The percentage does not contain the payoffs. Contracts A and B are hypothetical examples with explicit costs and different expected results.

11. Uncertainty about the percentage enters the decision too

A report often presents a probability to two decimal places even when the evidence does not support that precision. If the decision changes at zero point forty-five, an estimate of zero point forty-six should not be treated as an indisputable advantage. The percentage is an estimate produced by a procedure, rather than a quantity the market has revealed with exact precision.

For contract A, considering probabilities from zero point forty-three to zero point fifty-five produces expected results from minus zero point four to two units. This is a hypothetical sensitivity range. We do not call it a confidence interval because it was not estimated through a statistical procedure. It identifies how much probability uncertainty would change the economic conclusion and makes the threshold’s role concrete.

Abstention can be an explicit decision when the evidence does not convincingly separate an opportunity from its costs and errors. It need not be presented as model failure. We can define an inactive region in advance, record how many forecasts fall inside it and investigate what is lost or avoided by applying it. Choosing that region retrospectively to improve a result would be another strategy-fitting step.

A probability calibrated on average does not guarantee a known probability for each individual trade. The statement concerns groups and a distribution of cases. Two observations receiving the same output can differ in variables the model does not know. Keeping that distinction visible prevents a forecast from being described as a contractual promise about a specific transaction.

Sensitivity review can extend to costs and payoffs: how much the threshold moves if spreads widen, the conditional average gain falls or losses exceed the assumed size. The aim is to locate the assumptions supporting the decision. Useful confidence recognises which changes would make you stop acting, rather than compressing every uncertainty into a percentage that merely looks precise. The decision rule becomes easier to review when those turning points are explicit.

12. Base frequencies change and calibration ages

The relationship between scores and outcomes can change over time. A model trained in one distribution and applied in another does not automatically retain the interpretation of its numbers. A change in event frequency, costs or selection can alter what a prediction means even if the code remains identical. Monitoring code versions alone cannot detect every change in the population being evaluated.

Training samples deserve attention. Artificially balancing highly unequal classes can make the frequency seen during fitting differ from the frequency encountered in use. An output between zero and one is not enough to identify it with an operational probability. Calibration data must correspond to the meaning we intend to evaluate, or an explicit correction with defensible assumptions must account for the mismatch.

Monitoring should retain predictions issued before their outcomes, rather than recomputing the entire past retrospectively with the current model. Only the first record reveals the confidence each version actually expressed. As labels mature, reliability tables and metrics can be updated under a predefined rule, with counts and covered periods shown. This preserves the distinction between a historical forecast and a present reconstruction.

Recalibrating after every visible discrepancy may chase noise. Waiting indefinitely can preserve an obsolete transformation. Window choice and update frequency belong to the research design. They must account for label delays, data availability and the stability needed for decisions, without promising that an automatic mechanism will detect every market change. A monitoring rule is an operational choice with limitations of its own.

Version a calibration change with the data-availability date and fitting criterion. Retain the previous transformation as well, so a reviewer can explain why the same score now becomes a different percentage. Monitoring needs a memory of what was predicted, rather than only a fresh chart reconstructed from the present. Otherwise even a careful numerical evaluation can lose its connection with the decisions that were actually possible.

13. A record that lets someone question the percentage

A complete review can begin with a small file containing events, issue and resolution times, original scores, transformed probabilities and outcomes. Another person should be able to reconstruct reliability groups, counts and probabilistic losses from it. If trading decisions are included, their payoffs and costs belong to a separate layer that must also reconcile. Keeping the layers separate makes their connection easier to inspect.

The record includes a constant reference estimated before evaluation, the calibration method, the data it used and the predictor-calibrator version pair. Add coverage limitations: rarely emitted probabilities, overlapping horizons and conditions with little representation. These details help interpret an improvement more than a general “trustworthy model” label, which says little about the event, population or decision where the model was examined.

When studying rules and code within the initial Forex scope, a demo CSV can support a reproducible evaluation table. The demo remains a preparation and study setting; this description does not promise immediate delivery or imply that paid packages include CSV files. What matters here is enabling the reader to distinguish an archived forecast from a result recalculated after the outcome was known.

If there is no simple probabilistic reference yet, return to building a rival before training models. If the percentage will become a reward for an agent, the article on designing reinforcement learning rewards helps separate objectives, accounting and the training signal. These are connected problems, but solving one does not substitute for solving the other.

The final question is not whether a model can print eighty percent beside a signal. It is whether we can explain the event it describes, the evidence supporting the number, the cases where it was checked and its effect on a decision with real payoffs. A defensible probability comes with its procedure and limitations. That documentation does not remove uncertainty; it allows us to work with uncertainty without disguising it as certainty.

One hundred hypothetical outcomes: sixty positives and forty negatives compared with a constant prediction of eighty percent.
Stated confidence and observed frequency answer different questions; comparing them requires a defined event and sample.
Back to the Blog