pdstools.impactanalyzer.ImpactAnalyzer ====================================== .. py:module:: pdstools.impactanalyzer.ImpactAnalyzer Classes ------- .. autoapisummary:: pdstools.impactanalyzer.ImpactAnalyzer.ImpactAnalyzer Module Contents --------------- .. py:class:: ImpactAnalyzer(raw_data: polars.LazyFrame) .. py:attribute:: ia_data :type: polars.LazyFrame .. py:attribute:: default_ia_experiments .. py:attribute:: default_ia_controlgroups .. py:attribute:: plot .. py:method:: from_pdc(pdc_source: Union[os.PathLike, str, dict], *, query: Optional[pdstools.utils.types.QUERY] = None, return_input_df: Optional[bool] = False, return_df: Optional[bool] = False) :classmethod: Create an ImpactAnalyzer instance from a PDC file :param pdc_filename: The full path to the PDC file :type pdc_filename: Union[os.PathLike, str] :param query: An optional argument to filter out selected data, by default None :type query: Optional[QUERY], optional :param return_input_df: Debugging option to return the wide data from the raw JSON file as a DataFrame, by default False :type return_input_df: Optional[QUERY], optional :param return_df: Returns the processed input data as a DataFrame. Multiple of these can be stacked up and used to initialize the ImpactAnalyzer class, by default False :type return_df: Optional[QUERY], optional :returns: The properly initialized ImpactAnalyzer object :rtype: ImpactAnalyzer .. py:method:: _from_pdc_json(json_data: dict, *, query: Optional[pdstools.utils.types.QUERY] = None, return_input_df: Optional[bool] = False, return_df: Optional[bool] = False) :classmethod: Internal method to create an ImpactAnalyzer instance from PDC JSON data The PDC data is really structured as a list of expriments: control group A vs control group B. There is no explicit indicator whether the B's are really the same customers or not. The PDC data also contains a lot of UI related information that is not necessary. We turn this data into a series of control groups with just counts of impressions and accepts. This does need to assume a few implicit assumptions. .. py:method:: summary_by_channel() -> polars.LazyFrame Summarization of the experiments in Impact Analyzer split by Channel. :returns: Summary across all running Impact Analyzer experiments as a dataframe with the following fields: Channel Identification: - Channel: The channel name Performance Metrics: - CTR_Lift Adaptive Models vs Random Propensity: Lift in Engagement when testing prioritization with just Adaptive Models vs just Random Propensity - CTR_Lift NBA vs No Levers: Lift in Engagement for the full NBA Framework as configured vs prioritization without levers (only p, V and C) - CTR_Lift NBA vs Only Eligibility Rules: Lift in Engagement for the full NBA Framework as configured vs Only Eligibility policies applied (no Applicability or Suitability, and prioritized with pVCL) - CTR_Lift NBA vs Propensity Only: Lift in Engagement for the full NBA Framework as configured vs prioritization with model propensity only (no V, C or L) - CTR_Lift NBA vs Random: Lift in Engagement for the full NBA Framework as configured vs a Random eligible action (all engagement policies but randomly prioritized) - Value_Lift Adaptive Models vs Random Propensity: Lift in Expected Value when testing prioritization with just Adaptive Models vs just Random Propensity - Value_Lift NBA vs No Levers: Lift in Expected Value for the full NBA Framework as configured vs prioritization without levers (only p, V and C) - Value_Lift NBA vs Only Eligibility Rules: Lift in Expected Value for the full NBA Framework as configured vs Only Eligibility policies applied (no Applicability or Suitability, and prioritized with pVCL) - Value_Lift NBA vs Propensity Only: Lift in Expected Value for the full NBA Framework as configured vs prioritization with model propensity only (no V, C or L) - Value_Lift NBA vs Random: Lift in Expected Value for the full NBA Framework as configured vs a Random eligible action (all engagement policies but randomly prioritized) :rtype: pl.LazyFrame .. py:method:: overall_summary() -> polars.LazyFrame Summarization of the experiments in Impact Analyzer. :returns: Summary across all running Impact Analyzer experiments as a dataframe with the following fields: Performance Metrics: - CTR_Lift Adaptive Models vs Random Propensity: Lift in Engagement when testing prioritization with just Adaptive Models vs just Random Propensity - CTR_Lift NBA vs No Levers: Lift in Engagement for the full NBA Framework as configured vs prioritization without levers (only p, V and C) - CTR_Lift NBA vs Only Eligibility Rules: Lift in Engagement for the full NBA Framework as configured vs Only Eligibility policies applied (no Applicability or Suitability, and prioritized with pVCL) - CTR_Lift NBA vs Propensity Only: Lift in Engagement for the full NBA Framework as configured vs prioritization with model propensity only (no V, C or L) - CTR_Lift NBA vs Random: Lift in Engagement for the full NBA Framework as configured vs a Random eligible action (all engagement policies but randomly prioritized) - Value_Lift Adaptive Models vs Random Propensity: Lift in Expected Value when testing prioritization with just Adaptive Models vs just Random Propensity - Value_Lift NBA vs No Levers: Lift in Expected Value for the full NBA Framework as configured vs prioritization without levers (only p, V and C) - Value_Lift NBA vs Only Eligibility Rules: Lift in Expected Value for the full NBA Framework as configured vs Only Eligibility policies applied (no Applicability or Suitability, and prioritized with pVCL) - Value_Lift NBA vs Propensity Only: Lift in Expected Value for the full NBA Framework as configured vs prioritization with model propensity only (no V, C or L) - Value_Lift NBA vs Random: Lift in Expected Value for the full NBA Framework as configured vs a Random eligible action (all engagement policies but randomly prioritized) :rtype: pl.LazyFrame .. py:method:: summarize_control_groups(by: Optional[Union[List[str], str]] = None, drop_internal_cols=True) -> polars.LazyFrame .. py:method:: summarize_experiments(by: Optional[Union[List[str], str]] = None) -> polars.LazyFrame