Sketch: Plot Input (`plot_input.py`)
Purpose: exploratory visualisation helpers for raw/processed inputs.
Import
Section titled “Import”Preferred:
from sketch.plot_input import ( plot_all_metrics, plot_correlation_matrix, plot_all_media_spend,)Compatibility:
from src.sketch.plot_input import ( plot_all_metrics, plot_correlation_matrix, plot_all_media_spend,)Functions and Outputs
Section titled “Functions and Outputs”plot_all_metrics(input_data, output_dir, suffix)
Section titled “plot_all_metrics(input_data, output_dir, suffix)”Creates a multi-panel metric chart and saves it through stage-aware file utils.
Output:
10_pre_diagnostics/metrics_{suffix}.png
plot_correlation_matrix(input_data, per_observation_df)
Section titled “plot_correlation_matrix(input_data, per_observation_df)”Returns a Plotly heatmap figure and a correlation DataFrame.
Output:
- No file is saved automatically.
plot_all_media_spend(input_data, per_observation_df)
Section titled “plot_all_media_spend(input_data, per_observation_df)”Returns a Plotly time-series figure for the target metric.
Output:
- No file is saved automatically.
- Only
plot_all_metricswrites files directly. - Plotly-returning helpers are intended for interactive notebooks/apps where the caller decides whether to save PNG/HTML.