cratepy.clustering.clusteringphase.SCRMP¶
- class SCRMP(mat_phase, cluster_data_matrix, n_clusters)[source]¶
Bases:
CRMP
Static Cluster-Reduced Material Phase (SCRMP).
- cluster_labels¶
Material phase cluster labels (numpy.ndarray[int] of shape (n_phase_voxels,)).
- Type:
numpy.ndarray (1d)
- perform_base_clustering(self, base_clustering_scheme, min_label=0)[source]¶
Perform SCRMP base clustering.
Constructor.
- Parameters:
mat_phase (str) – Material phase label.
cluster_data_matrix (numpy.ndarray (2d)) – Data matrix (numpy.ndarray of shape (n_phase_voxels, n_features_dims)) containing the clustering features data to perform the material phase cluster analyses.
n_clusters (int) – Number of material phase clusters.
List of Public Methods
Get cluster-reduced material phase adaptivity type.
Get current number of clusters.
Get valid clustering algorithms to compute the CRMP.
Perform SCRMP base clustering.
Methods
- __init__(mat_phase, cluster_data_matrix, n_clusters)[source]¶
Constructor.
- Parameters:
mat_phase (str) – Material phase label.
cluster_data_matrix (numpy.ndarray (2d)) – Data matrix (numpy.ndarray of shape (n_phase_voxels, n_features_dims)) containing the clustering features data to perform the material phase cluster analyses.
n_clusters (int) – Number of material phase clusters.
- static _update_cluster_labels(labels, min_label=0)¶
Update cluster labels starting with the provided minimum label.
- Parameters:
labels (numpy.ndarray (1d)) – Cluster labels (numpy.ndarray[int] of shape (n_items,)).
min_label (int, default=0) – Minimum cluster label.
- Returns:
new_labels (numpy.ndarray (1d)) – Updated cluster labels (numpy.ndarray[int] of shape (n_items,)).
max_label (int) – Maximum cluster label.
- get_clustering_type()[source]¶
Get cluster-reduced material phase adaptivity type.
- Returns:
clustering_type – Type of cluster-reduced material phase.
- Return type:
- get_n_clusters()[source]¶
Get current number of clusters.
- Returns:
n_clusters – Number of material phase clusters.
- Return type:
- static get_valid_clust_algs()[source]¶
Get valid clustering algorithms to compute the CRMP.
- Returns:
clust_algs – Clustering algorithms identifiers (str).
- Return type:
- perform_base_clustering(base_clustering_scheme, min_label=0)[source]¶
Perform SCRMP base clustering.
- Parameters:
base_clustering_scheme (dict) – Prescribed base clustering scheme (item, numpy.ndarray of shape (n_clusterings, 3)) for each material phase (key, str). Each row is associated with a unique clustering characterized by a clustering algorithm (col 1, int), a list of features (col 2, list[int]) and a list of the features data matrix’ indexes (col 3, list[int]).
min_label (int, default=0) – Minimum cluster label.