CLiMB.core package
Submodules
CLiMB.core.CLiMB module
- class CLiMB.core.CLiMB.CLiMB(constrained_clusters=3, seed_points=None, density_threshold=0.2, distance_threshold=15, radial_threshold=1, convergence_tolerance=0.4, exploratory_algorithm=None, distance_metric='euclidean', metric_params=None)[source]
Bases:
objectCLustering In Multiphase Boundaries (CLiMB)
A two-phase clustering algorithm designed for datasets with both known and exploratory components. First phase constrains clusters around known regions, second phase identifies new patterns in unassigned points.
- compare_external_blob(path, filename, axis_names, hiding_cluster)[source]
Compare known new blob and the clustered ones
- fit(X, known_labels=None, is_slight_movement=False)[source]
Execute two-stage clustering process
Parameters:
- Xarray-like of shape (n_samples, n_features)
The input samples to cluster.
- known_labelsarray-like, default=None
Known labels for seed points, if available.
- is_slight_movementbool, default=False
Whether to use slight movement.
Returns:
- selfCLiMB
Fitted estimator.
- get_labels()[source]
Get the cluster labels for all points
Returns:
- labelsndarray
Cluster labels for each point
- inverse_transform(scaler)[source]
Transform clustering results back to original scale
Parameters:
- scalerobject with inverse_transform method
The scaler used to normalize the data
- plot_comprehensive_2d(dimensions=(0, 1), axis_labels=None, save_path=None, figsize=(15, 6), dpi=300)[source]
Visualize both clustering stages in 2D
Parameters:
- dimensionstuple, default=(0, 1)
Indices of dimensions to plot
- axis_labelslist, default=None
Labels for X and Y axes
- save_pathstr, default=None
Path to save the figure
- figsizetuple, default=(15, 6)
Figure size
- dpiint, default=300
Figure resolution
Returns:
- figmatplotlib.figure.Figure
The created figure
- plot_comprehensive_3d(axis_labels=None, save_path=None, figsize=(15, 6), dpi=300)[source]
Visualize both clustering stages in 3D
Parameters:
- axis_labelslist, default=None
Labels for X, Y, and Z axes
- save_pathstr, default=None
Path to save the figure
- figsizetuple, default=(15, 6)
Figure size
- dpiint, default=300
Figure resolution
CLiMB.core.KBound module
- class CLiMB.core.KBound.KBound(n_clusters, seeds=None, max_iter=300, density_threshold=0.5, distance_threshold=2.0, radial_threshold=1.0, convergence_tolerance=0.1, distance_metric='euclidean', metric_params=None)[source]
Bases:
object