Skip to content

Analysis

Post-optimization analysis: summary, SHAP, PDP/ICE, feature importance, trade-offs, what-if.

AnalysisConfig

surrox.AnalysisConfig

Bases: BaseModel

Configuration for post-optimization analysis.

Attributes:

Name Type Description
shap_background_size int

Number of background samples for SHAP explanations.

pdp_grid_resolution int

Number of grid points for PDP/ICE plots.

pdp_percentiles tuple[float, float]

Lower and upper percentile bounds for PDP grid range.

monotonicity_check_resolution int

Grid resolution for monotonicity verification.

random_seed int

Random seed for reproducibility.

Analyzer

surrox.Analyzer(optimization_result, surrogate_manager, bound_dataset, config)

On-demand detail analysis engine with lazy computation and caching.

Provides SHAP explanations (global and local), feature importance, PDP/ICE curves, trade-off analysis, and what-if predictions. Results are cached after first computation.

See Results for all analysis result types (Summary, ShapGlobalResult, PDPICEResult, WhatIfResult, etc.).