Skip to content

neurostatx.cli.PredictFuzzyMembership

Attributes

NameDescription
appCyclopts application for the PredictFuzzyMembership command-line tool.

Functions

NameDescription
PredictFuzzyMembershipPredict fuzzy membership from trained C-Means centroids.

appattributemodule attribute#

app = App(default_parameter=Parameter(negative=()))

Cyclopts application for the PredictFuzzyMembership command-line tool.

PredictFuzzyMembershipfunction#

def PredictFuzzyMembership(in_dataset: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], in_cntr: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], id_column: Annotated[str, Parameter(show_default=False, group='Essential Files Options')], desc_columns: Annotated[int, Parameter(show_default=False, group='Essential Files Options')], out_folder: Annotated[str, Parameter(show_default=False, group='Essential Files Options')] = './output/', m: Annotated[float, Parameter(show_default=True, group='Clustering Options')] = 2, error: Annotated[float, Parameter(show_default=True, group='Clustering Options')] = 1e-06, maxiter: Annotated[int, Parameter(show_default=True, group='Clustering Options')] = 1000, metric: Annotated[DistanceMetrics, Parameter(show_default=True, group='Clustering Options')] = DistanceMetrics.euclidean, pca: Annotated[bool, Parameter(--pca, show_default=True, group='Clustering Options')] = False, pca_model: Annotated[str, Parameter(show_default=True, group='Clustering Options')] = None, parallelplot: Annotated[bool, Parameter(show_default=True, group='Visualization Options')] = False, radarplot: Annotated[bool, Parameter(show_default=True, group='Visualization Options')] = True, cmap: Annotated[str, Parameter(show_default=True, group='Visualization Options')] = 'magma', verbose: Annotated[bool, Parameter(-v, --verbose, group='Optional parameters')] = False, save_parameters: Annotated[bool, Parameter(-s, --save_parameters, group='Optional parameters')] = False, overwrite: Annotated[bool, Parameter(-f, --overwrite, group='Optional parameters')] = False)

Predict fuzzy membership from trained C-Means centroids.

Only the centroids from a trained model are required for the prediction.

Parameters

NameTypeDefaultDescription
in_datasetstrrequiredInput dataset.
in_cntrstrrequiredCentroid file to use for prediction. Should come from a trained C-Means model such as FuzzyClustering.
id_columnstrrequiredName of the column containing the subject’s ID tag. Required for proper handling of IDs and merging multiple datasets.
desc_columnsintrequiredNumber of descriptive columns at the beginning of the dataset to exclude in statistics and descriptive tables.
out_folderstr'./output/'Output folder for the predicted membership matrix. Defaults to ./output/.
mfloat2Exponentiation value to apply on the membership function. Determines the degree of fuzziness of the membership matrix. Defaults to 2.
errorfloat1e-06Error threshold for convergence stopping criterion. Defaults to 1e-6.
maxiterint1000Maximum number of iterations to perform. Defaults to 1000.
metricDistanceMetricsDistanceMetrics.euclideanMetric to use to compute distance between original points and cluster centroids. Defaults to euclidean.
pcaboolFalseIf set, will perform PCA decomposition to 3 components before clustering. Defaults to False.
pca_modelstrNoneIf set, will load a pre-trained PCA model to apply on the dataset. Defaults to None.
parallelplotboolFalseIf true, will output a parallel plot for each cluster solution. Defaults to False.
radarplotboolTrueIf true, will output a radar plot for each cluster solution. Defaults to True.
cmapstr'magma'Colormap to use for plotting. Defaults to magma. See Matplotlib (https://matplotlib.org/stable/tutorials/colors/colormaps.html).
verboseboolFalseIf true, produce verbose output. Defaults to False.
save_parametersboolFalseIf true, will save input parameters to .txt file. Defaults to False.
overwriteboolFalseIf true, force overwriting of existing output files. Defaults to False.

Examples

Terminal window
PredictFuzzyMembership --in_dataset dataset.xlsx --in_cntr
centroids.xlsx --id_column ID --desc_columns 1 --out_folder
predicted_membership_matrix/ --m 2 --error 1e-6 --maxiter 1000
--metric euclidean --verbose --save_parameters --overwrite