pdstools.prediction¶
Submodules¶
Classes¶
Monitor Pega Prediction Studio Predictions |
Package Contents¶
- class Prediction(df: polars.LazyFrame)¶
Monitor Pega Prediction Studio Predictions
- Parameters:
df (polars.LazyFrame)
- predictions: polars.LazyFrame¶
- plot: PredictionPlots¶
- prediction_validity_expr¶
- cdh_guidelines¶
- static from_mock_data(days=70)¶
- summary_by_channel(custom_predictions: List[List] | None = None, by_period: str = None) polars.LazyFrame ¶
Summarize prediction per channel
- Parameters:
custom_predictions (Optional[List[CDH_Guidelines.NBAD_Prediction]], optional) – Optional list with custom prediction name to channel mappings. Defaults to None.
by_period (str, optional) – Optional grouping by time period. Format string as in polars.Expr.dt.truncate (https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.dt.truncate.html), for example “1mo”, “1w”, “1d” for calendar month, week day. If provided, creates a new Period column with the truncated date/time. Defaults to None.
- Returns:
Dataframe with prediction summary (validity, numbers in test, control etc.)
- Return type:
pl.LazyFrame
- overall_summary(custom_predictions: List[List] | None = None, by_period: str = None) polars.LazyFrame ¶
Overall prediction summary. Only valid prediction data is included.
- Parameters:
custom_predictions (Optional[List[CDH_Guidelines.NBAD_Prediction]], optional) – Optional list with custom prediction name to channel mappings. Defaults to None.
by_period (str, optional) – Optional grouping by time period. Format string as in polars.Expr.dt.truncate (https://docs.pola.rs/api/python/stable/reference/expressions/api/polars.Expr.dt.truncate.html), for example “1mo”, “1w”, “1d” for calendar month, week day. If provided, creates a new Period column with the truncated date/time. Defaults to None.
- Returns:
Summary across all valid predictions as a dataframe
- Return type:
pl.LazyFrame