OpenBI Docs Buy

PREDICT OpenBI

A prediction's scores for each row it scores, or a forecast's months, worked out now with the version in use.

Group: Predictions. OpenBI’s own: DAX has no function of this name.

Syntax

PREDICT ( <name> [, <version>] )
ParameterTypeDescription
nameTextThe prediction's name, as the Prediction view named it: its notebook and its versions go by it.
versionWhole number
optional
A version's number, to score with that version instead of the one in use.

Returns

Table. For a prediction that scores rows: the key of what is scored (a customer, a lead) and its label when it has one, Score (Risk for a survival model), Band, for a survival model Survival, Median and Survival from now, the reasons (Reason 1, Reason 2 …), Version and As of. For a forecast: the series' column when it forecasts several, Date, Actual, Forecast, Low, High, Kind (Actual or Forecast) and Anomaly, and Version when a version made it.

Remarks

  • A prediction is trained in OpenBI Studio's Prediction view, with LightGBM, on the model's own data, and saved as versions. PREDICT ( "name" ) scores with the version in use: one a person approved and put in use in the notebook's Versions tab. A report page and OpenBI Server use no draft. Until any version has been saved, it scores with the prediction's latest training.
  • With a version number, that version scores: on a page or the server only when it was approved and is not retired. A draft, a version nobody approved, or a retired one is for a developer's tests alone: the OAX view and notebooks.
  • The scores are worked out at the moment of the query, from the data as it is: EVALUATE TOPN ( 20, PREDICT ( "Churn" ), [Score], DESC ) lists the twenty most at risk today. Used in the model (Use in the model), the table of scores refreshes with the data.
  • Score is a probability for a yes-or-no question (who will leave, who will buy), an amount for a question of how much. Band says High, Medium or Low against the version's thresholds. The reasons name the inputs that push the row's score furthest from the average, with their values.
  • A forecast has a row for each period of the history (Kind Actual: the value, and what the model would have said) and for each period ahead (Kind Forecast: Actual blank). Low and High are the 10th and 90th percentiles; Anomaly marks a past period that fell well outside what was expected.
  • A name that is not text, a prediction that was never trained, a version that does not exist or one that may not score here is an error.

Compared with DAX

An OpenBI function: DAX has none like it, so a measure or query that uses it works in OpenBI only, not in Power BI or Analysis Services.

Examples

Next six months of liters, product by product

A forecast named Liters of the measure Liters sold, month by month for each product, would give the Forecast rows here. The Example Brewery as it ships has no prediction, so the query is an error: train one in the Prediction view (Forecast) and approve a version first.

EVALUATE
FILTER ( PREDICT ( "Liters" ), [Kind] = "Forecast" )

Result: an error.

MONTECARLO, OPTIMIZE, VALUATION, SURVIVAL.COX.PREDICT, TOPN.

Last updated · OpenBI Studio 0.3.74