cratepy.ioput.readprocedures.read_cluster_analysis_scheme

read_cluster_analysis_scheme(file, file_path, keyword, material_phases, clustering_features)[source]

Read cluster analysis scheme.

The specification of the data associated with the cluster analysis scheme has the following input data file syntax:

Clustering_Analysis_Scheme
< phase_id > < clustering_type >
    base_clustering
    < clustering_algorithm_id > < feature_id > [< feature_id >]
    adaptive_clustering
    < clustering_algorithm_id > < feature_id > [< feature_id >]
    adaptivity_parameters < adapt_criterion_id > < adapt_type_id >
    < adapt_parameter_name > < value >
    < adapt_parameter_name > < value >
< phase_id > < clustering_type >
...

where phase_id (int) is the material identifier, clustering_type is the clustering type ({static, adaptive}), clustering_algorithm_id (int) is the clustering algorithm identifier, feature_id (int) is the clustering feature identifier, adapt_criterion_id`(int) is the clustering adaptivity criterion identifier, `adapt_type_id (int) is the adaptive cluster-reduced material phase type identifier, and adapt_parameter_name is the adaptive parameter name.


Parameters:
  • file (file) – Data file.

  • file_path (str) – Data file path.

  • keyword (str) – Keyword.

  • material_phases (list[str]) – RVE material phases labels (str).

  • clustering_features (list[str]) – Available clustering features.

Returns:

  • clustering_type (dict) – Clustering type (item, {‘static’, ‘adaptive’}) of each material phase (key, str).

  • 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]).

  • adaptive_clustering_scheme (dict) – Prescribed adaptive 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]).

  • adapt_criterion_data (dict) – Clustering adaptivity criterion (item, dict) associated with each material phase (key, str). This dictionary contains the adaptivity criterion to be used and the required parameters.

  • adaptivity_type (dict) – Clustering adaptivity type (item, dict) associated with each material phase (key, str). This dictionary contains the adaptivity type to be used and the required parameters.

  • adaptivity_control_feature (dict) – Clustering adaptivity control feature (item, str) associated with each material phase (key, str).