vipr_reflectometry.flow_models.postprocess.cluster package

Subpackages

Module contents

Cluster analysis package for posterior distributions.

class vipr_reflectometry.flow_models.postprocess.cluster.ClusterDiagnosticsHook(app: VIPR)

Bases: object

Hook for clustering model selection and diagnostics.

Performs hyperparameter sweeps (GMM K-range or HDBSCAN min_cluster_size) and generates diagnostic plots without modifying the data.

cluster_model_selection(data: Dict[str, Any], app=None, **kwargs) Dict[str, Any]

Perform model selection diagnostics for clustering.

Generates BIC/AIC/Silhouette plots for GMM or cluster count/Silhouette plots for HDBSCAN. Does not modify data.

Parameters:
  • data – Prediction results with parameter samples

  • **kwargs – Hook parameters

Returns:

Unmodified data dict (only plots are generated)

class vipr_reflectometry.flow_models.postprocess.cluster.ClusterHook(app: VIPR)

Bases: object

Thin adapter between VIPR filter hook and clustering processor.

Responsibilities: - Register as VIPR filter - Validate input data - Delegate to service layer

cluster_posterior_samples(data: Dict[str, Any], app=None, **kwargs) Dict[str, Any]

VIPR filter hook for clustering posterior samples.

Parameters:
  • data – Prediction results with parameter samples

  • **kwargs – Filter parameters

Returns:

Enhanced data dict with cluster information