Skip to main content

Overview

The ProbabilisticAnswer 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 return None to skip a market:

Probability Type

The Probability type ensures values are between 0.0 and 1.0:

Complete Example

See Also