ClusterStabilityExplorer
Cluster persistence bar chart for HDBSCAN.
Reads the cluster_persistence_ attribute stored by the Clustering
converter when run with the hdbscan algorithm.
Each bar represents one cluster; its height is the persistence score — a measure of how long that cluster survives across the range of density thresholds explored by HDBSCAN. A higher persistence indicates a more robust, stable cluster; a low persistence means the cluster appears only in a narrow density window and may be unreliable.
A dashed horizontal line marks the mean persistence across all clusters. The result also includes a summary table with min, max, and mean values.
This explorer raises an informative error if the last Clustering
converter was not run with HDBSCAN. No column selection is required.
Methods
get_results(self, exploration_path: str, options: Dict[str, Any]) -> Dict[str, Any]
ClusterStabilityExplorerLoad the saved stability result and return it for the frontend.
Parameters
- exploration_path : str
- Path to the JSON file saved by
save_notebook. - options : Dict[str, Any]
- Rendering options from the frontend (unused).
Returns
- Dict[str, Any]
- Dictionary with keys
"data"(Plotly figure JSON string),"type"("plotly_json"), and"config"(empty dict).
launch_exploration(self, _dataset: 'DashAIDataset', explorer_info: DashAI.back.dependencies.database.models.Explorer) -> Dict[str, Any]
ClusterStabilityExplorerBuild a bar chart of HDBSCAN cluster persistence scores.
Parameters
- _dataset : DashAIDataset
- Not used. All data is read from the converter report.
- explorer_info : Explorer
- Explorer record, used for the optional custom title.
Returns
- Dict[str, Any]
- Dictionary with keys
"figure"(JSON-serialised Plotly figure) and"summary"(dict withn_clusters,min_persistence,max_persistence,mean_persistence, andper_clusterlist).
prepare_dataset(self, loaded_dataset: 'DashAIDataset', _columns: List[Dict[str, Any]]) -> 'DashAIDataset'
ClusterStabilityExplorerReturn the dataset unchanged.
Parameters
- loaded_dataset : DashAIDataset
- The full dataset.
- _columns : List[Dict[str, Any]]
- Ignored. Present for API compatibility.
Returns
- DashAIDataset
- The dataset as received, unmodified.
save_notebook(self, notebook_info: DashAI.back.dependencies.database.models.Notebook, explorer_info: DashAI.back.dependencies.database.models.Explorer, save_path: 'Path', result: Any) -> str
ClusterStabilityExplorerSave the stability result (figure + summary) to disk as a JSON file.
Parameters
- notebook_info : Notebook
- The notebook database record (unused).
- explorer_info : Explorer
- The explorer record used for filename generation.
- save_path : Path
- Directory where the file will be saved.
- result : Any
- The dict returned by
launch_exploration, containing"figure"and"summary"keys.
Returns
- str
- The path of the saved JSON file as a POSIX string.
get_credential(self, name: str)
ConfigObjectResolve a registered credential component by name.
Parameters
- name : str
- Credential component class name (e.g. "HuggingFaceCredential").
Returns
- BaseCredential
- An instance of the requested credential component.
get_metadata(cls) -> Dict[str, Any]
BaseExplorerGet metadata for the explorer, used by the DashAI frontend.
Returns
- Dict[str, Any]
- Dictionary containing display name, description, image preview path, category, icon, color, allowed semantic types, allowed dtypes, input cardinality constraints, and any optional capability flags declared by the explorer.
get_schema(cls) -> dict
ConfigObjectGenerates the component related Json Schema.
Returns
- dict
- Dictionary representing the Json Schema of the component.
set_context(self, context: Dict[str, Any]) -> None
BaseExplorerSet optional runtime context for explorers that need extra inputs.
validate_and_transform(self, raw_data: dict) -> dict
ConfigObjectIt takes the data given by the user to initialize the model and returns it with all the objects that the model needs to work.
Parameters
- raw_data : dict
- A dictionary with the data provided by the user to initialize the model.
Returns
- dict
- A validated dictionary with the necessary objects.
validate_columns(cls, explorer_info: DashAI.back.dependencies.database.models.Explorer, column_spec: Dict[str, Dict[str, str]]) -> bool
BaseExplorerValidate that the selected columns satisfy the explorer's constraints.
Parameters
- explorer_info : Explorer
- The database record for the explorer instance, including the selected columns.
- column_spec : Dict[str, Dict[str, str]]
- A mapping from column name to a dict with at least
"type"(semantic type name) and"dtype"(dtype string).
Returns
- bool
- True if all column constraints are satisfied, False otherwise.
validate_parameters(cls, params: Dict[str, Any]) -> bool
BaseExplorerValidate explorer parameters against the explorer's schema.
Parameters
- params : Dict[str, Any]
- The configuration parameters to validate.
Returns
- BaseExplorerSchema
- The validated and parsed schema instance. Subclasses that override this method may return a bool to indicate pass/fail without returning the model instance.