Foretold

Foretold

class Foretold(token=None)[source]

Interface to Foretold

get_question(id)[source]

Retrieve a single question by its id

get_questions(ids)[source]
Retrieve many questions by their ids
ids (List[string]): List of foretold question ids

(should be less than 500 per request)

Returns: List of questions corresponding to the ids,

or None for questions that weren’t found.

ForetoldQuestion

class ForetoldQuestion(id, foretold, data=None)[source]

“Information about foretold question, including aggregated distribution

plotCdf()[source]

Plot the CDF

quantile(q)[source]

Quantile of distribution

sample_community()[source]

Sample from CDF

submit_from_samples(samples, length=20)[source]

Submit a prediction to Foretold based on the given samples

Parameters
  • samples (Union[ndarray, Series]) – Samples on which to base the submission

  • length (int) – The length of the CDF derived from the samples

Return type

Response