_valid Module (Internal Script/Notes)ΒΆ

This file (abacus/driver/_valid.py) appears to contain script snippets or notes demonstrating data validation and quality checks typically performed before MMM analysis, rather than defining reusable functions or classes for the driver workflow.

The snippets illustrate steps such as:

  • Loading configuration and data (using functions assumed to be defined elsewhere).

  • Calling a data quality check function (e.g., preprocessing.check_data_quality, assumed to be defined elsewhere) to obtain metrics like:

    • Correlations between features and the target.

    • Variance of each feature.

    • Spend fraction for each media channel.

    • Variance Inflation Factors (VIF) to check for multicollinearity.

  • Displaying these metrics, potentially using styling functions (e.g., highlight_variances, highlight_low_spend_fractions, highlight_high_vif_values) to flag potential issues based on predefined thresholds.

  • Calculating and displaying the correlation matrix specifically for media channel volumes and the target variable.

  • Visualising the correlation matrix using plotly.express.imshow.

These steps showcase common data validation procedures useful for identifying potential problems like low variance, high multicollinearity, or low spend that might affect model stability or interpretation.