Overview
TheProbabilisticAnswer family of classes represents predictions returned from agent analysis methods. They encapsulate probability estimates, confidence levels, and reasoning for different market types.
Import
ProbabilisticAnswer
Used for binary (yes/no) market predictions.Constructor
Probability
required
Probability that the outcome is “Yes” (0.0 to 1.0)
float
required
Confidence in the prediction (0.0 to 1.0)
str | None
default:"None"
Optional explanation for the prediction
Properties
Probability
Probability of “Yes” outcome
Probability
Probability of “No” outcome (computed as 1 - p_yes)
float
Confidence level in the prediction
str | None
Explanation for the prediction
Basic Usage
Accessing Probabilities
From Agent Implementation
CategoricalProbabilisticAnswer
Used for categorical (multiple choice) market predictions.Constructor
dict[str, Probability]
required
Probability for each outcome (must sum to 1.0)
float | None
default:"None"
Overall confidence in the prediction
str | None
default:"None"
Optional explanation for the prediction
Properties
dict[str, Probability]
Dictionary mapping outcome names to their probabilities
float | None
Confidence level in the prediction
str | None
Explanation for the prediction
Basic Usage
From Agent Implementation
Converting from Binary
Convert a binary prediction to categorical format:ScalarProbabilisticAnswer
Used for scalar (numeric range) market predictions.Constructor
float
required
Predicted value within the market’s range
float | None
default:"None"
Confidence in the prediction
str | None
default:"None"
Optional explanation for the prediction
Properties
float
The predicted numeric value
float | None
Confidence level in the prediction
str | None
Explanation for the prediction
Basic Usage
From Agent Implementation
Returning None
All answer methods can returnNone to skip a market:
Probability Type
TheProbability type ensures values are between 0.0 and 1.0:
Complete Example
See Also
- DeployableTraderAgent - Base class using these models
- AgentMarket - Market interface for predictions
- Betting Strategies - How predictions are converted to bets