PredictFuzzyMembership
PredictFuzzyMembership(in_dataset, in_cntr, id_column, desc_columns, out_folder=’./output/’, m=2, error=1e-06, maxiter=1000, metric=DistanceMetrics.euclidean, pca=False, pca_model=None, parallelplot=False, radarplot=True, cmap=‘magma’, verbose=False, save_parameters=False, overwrite=False)
Fuzzy Membership Prediction
This script will predict the membership matrix of a dataset using a trained Cmeans model (only the centroids are necessary for the prediction).
Configurations
Details regarding the parameters can be seen below. Regarding the –m parameter, it defines the degree of fuzziness of the resulting membership matrix. Using –m 1 will returns crisp clusters, whereas –m >1 will returned more and more fuzzy clusters. It is recommended to use the same m value as used during training.
Example Usage
Parameters
in_dataset : Input dataset(s) to filter. If multiple files are provided as input, will be merged according to the subject id columns.
in_cntr
: Centroid file to use for prediction. Should come from a trained Cmeans
model (such as FuzzyClustering
).
id_column : Name of the column containing the subject’s ID tag. Required for proper handling of IDs and merging multiple datasets.
desc_columns : Number of descriptive columns at the beginning of the dataset to exclude in statistics and descriptive tables.
out_folder : Output folder for the predicted membership matrix.
m : Exponentiation value to apply on the membership function, will determined the degree of fuzziness of the membership matrix.
error : Error threshold for convergence stopping criterion.
maxiter : Maximum number of iterations to perform.
metric : Metric to use to compute distance between original points and clusters centroids.
pca : If set, will perform PCA decomposition to 3 components before clustering.
pca_model : If set, will load a pre-trained PCA model to apply on the dataset.
parallelplot : If true, will output parallel plot for each cluster solution. Default is False.
radarplot : If true, will output radar plot for each cluster solution. Default is True.
cmap : Colormap to use for plotting. Default is “magma”. See Matplotlib (https://matplotlib.org/stable/tutorials/colors/colormaps.html).
verbose : If true, produce verbose output.
save_parameters : If true, will save input parameters to .txt file.
overwrite : If true, force overwriting of existing output files.