pdstools.prediction.Prediction ============================== .. py:module:: pdstools.prediction.Prediction Attributes ---------- .. autoapisummary:: pdstools.prediction.Prediction.logger pdstools.prediction.Prediction.COLORSCALE_TYPES pdstools.prediction.Prediction.Figure Classes ------- .. autoapisummary:: pdstools.prediction.Prediction.PredictionPlots pdstools.prediction.Prediction.Prediction Module Contents --------------- .. py:data:: logger .. py:data:: COLORSCALE_TYPES .. py:data:: Figure .. py:class:: PredictionPlots(prediction) Bases: :py:obj:`pdstools.utils.namespaces.LazyNamespace` .. py:attribute:: dependencies :value: ['plotly'] .. py:attribute:: prediction .. py:method:: _prediction_trend(period: str, query: Optional[pdstools.utils.types.QUERY], return_df: bool, metric: str, title: str, facet_row: str = None, facet_col: str = None, bar_mode: bool = False) .. py:method:: performance_trend(period: str = '1d', *, query: Optional[pdstools.utils.types.QUERY] = None, return_df: bool = False) .. py:method:: lift_trend(period: str = '1d', *, query: Optional[pdstools.utils.types.QUERY] = None, return_df: bool = False) .. py:method:: ctr_trend(period: str = '1d', facetting=False, *, query: Optional[pdstools.utils.types.QUERY] = None, return_df: bool = False) .. py:method:: responsecount_trend(period: str = '1d', facetting=False, *, query: Optional[pdstools.utils.types.QUERY] = None, return_df: bool = False) .. py:class:: Prediction(df: polars.LazyFrame) Monitor Pega Prediction Studio Predictions .. py:attribute:: predictions :type: polars.LazyFrame .. py:attribute:: plot :type: PredictionPlots .. py:attribute:: prediction_validity_expr .. py:attribute:: cdh_guidelines .. py:method:: from_mock_data(days=70) :staticmethod: .. py:property:: is_available :type: bool .. py:property:: is_valid :type: bool .. py:method:: summary_by_channel(custom_predictions: Optional[List[List]] = None, by_period: str = None) -> polars.LazyFrame Summarize prediction per channel :param custom_predictions: Optional list with custom prediction name to channel mappings. Defaults to None. :type custom_predictions: Optional[List[CDH_Guidelines.NBAD_Prediction]], optional :param by_period: 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. :type by_period: str, optional :returns: Dataframe with prediction summary (validity, numbers in test, control etc.) :rtype: pl.LazyFrame .. py:method:: overall_summary(custom_predictions: Optional[List[List]] = None, by_period: str = None) -> polars.LazyFrame Overall prediction summary. Only valid prediction data is included. :param custom_predictions: Optional list with custom prediction name to channel mappings. Defaults to None. :type custom_predictions: Optional[List[CDH_Guidelines.NBAD_Prediction]], optional :param by_period: 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. :type by_period: str, optional :returns: Summary across all valid predictions as a dataframe :rtype: pl.LazyFrame