neurostatx.cli.PredictFuzzyMembership
Attributes
| Name | Description |
|---|---|
app | Cyclopts application for the PredictFuzzyMembership command-line tool. |
Functions
| Name | Description |
|---|---|
PredictFuzzyMembership | Predict 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
| Name | Type | Default | Description |
|---|---|---|---|
in_dataset | str | required | Input dataset. |
in_cntr | str | required | Centroid file to use for prediction. Should come from a trained C-Means model such as FuzzyClustering. |
id_column | str | required | Name of the column containing the subject’s ID tag. Required for proper handling of IDs and merging multiple datasets. |
desc_columns | int | required | Number of descriptive columns at the beginning of the dataset to exclude in statistics and descriptive tables. |
out_folder | str | './output/' | Output folder for the predicted membership matrix. Defaults to
./output/. |
m | float | 2 | Exponentiation value to apply on the membership function. Determines the degree of fuzziness of the membership matrix. Defaults to 2. |
error | float | 1e-06 | Error threshold for convergence stopping criterion. Defaults to 1e-6. |
maxiter | int | 1000 | Maximum number of iterations to perform. Defaults to 1000. |
metric | DistanceMetrics | DistanceMetrics.euclidean | Metric to use to compute distance between original points and cluster centroids. Defaults to euclidean. |
pca | bool | False | If set, will perform PCA decomposition to 3 components before clustering. Defaults to False. |
pca_model | str | None | If set, will load a pre-trained PCA model to apply on the dataset. Defaults to None. |
parallelplot | bool | False | If true, will output a parallel plot for each cluster solution. Defaults to False. |
radarplot | bool | True | If true, will output a radar plot for each cluster solution. Defaults to True. |
cmap | str | 'magma' | Colormap to use for plotting. Defaults to magma. See Matplotlib
(https://matplotlib.org/stable/tutorials/colors/colormaps.html). |
verbose | bool | False | If true, produce verbose output. Defaults to False. |
save_parameters | bool | False | If true, will save input parameters to .txt file. Defaults to False. |
overwrite | bool | False | If true, force overwriting of existing output files. Defaults to False. |
Examples
PredictFuzzyMembership --in_dataset dataset.xlsx --in_cntrcentroids.xlsx --id_column ID --desc_columns 1 --out_folderpredicted_membership_matrix/ --m 2 --error 1e-6 --maxiter 1000--metric euclidean --verbose --save_parameters --overwrite