fcmOptions
Description
Use an fcmOptions object to specify options for clustering data
using the fcm function. You can specify options such as the
number of clusters, the clustering exponent, and the distance metric.
Creation
Description
returns a default option
object for clustering using opt = fcmOptionsfcm. To modify options, use dot
notation.
specifies options using one or more name-value arguments. For example, opt = fcmOptions(PropertyName=Value)opt =
fcmOptions(NumClusters=3) creates an fcmOptions object and
sets the number of clusters to 3.
Properties
Number of clusters to create, C, specified as one of the following:
"auto"— Cluster the data ten times (C = 2 through 11).Integer greater than 1 — Cluster the data once using the specified number of clusters.
Vector of integers greater than 1 — Cluster the data multiple times, once for each value in
NumClusters.
When NumClusters is "auto" or a vector, the
fcm function returns cluster centers for the optimal number of
clusters, which it determines using a validity index. You can return the clustering
results for the other values of C using the info
output argument of fcm.
Dependencies
If
NumClustersis a scalar integer, it must equal the number of rows inClusterCenters.If
NumClustersis a vector, the minimum number of clusters must equal the number of rows inClusterCenters.
Exponent for the fuzzy partition matrix, specified as a scalar greater than
1.0. This option controls the amount of fuzzy overlap between
clusters, with larger values indicating a greater degree of overlap.
If your data set is wide with significant overlap between potential clusters, then the calculated cluster centers can be very close to each other. In this case, each data point has approximately the same degree of membership in all clusters. To improve your clustering results, decrease this value, which limits the amount of fuzzy overlap during clustering.
For an example of fuzzy overlap adjustment, see Adjust Fuzzy Overlap in Fuzzy C-Means Clustering.
Maximum number of iterations, specified as a positive integer.
Minimum improvement in objective function between two consecutive iterations, specified as a
positive scalar. When the objective function improves by an amount less than
MinImprovement the FCM algorithm stops.
Method for computing distance between data points and cluster centers, specified as one of the following values.
"euclidean"— Compute distance using a Euclidean distance metric, which corresponds to the classical FCM algorithm."mahalanobis"— Compute distance using a Mahalanobis distance metric, which corresponds to the Gustafson-Kessel FCM algorithm."fmle"— Compute distance using fuzzy maximum likelihood estimation (FMLE), which corresponds to the Gath-Geva FCM algorithm. (since R2023b)
Since R2026a
Cluster membership type, specified as one of these values:
"probabilistic"— For a given data point, the sum of membership values across all clusters is equal to 1. This means that the membership values are interpreted as probabilities, indicating the likelihood that a data point belongs to each cluster."possibilistic"— For a given data point, the sum of membership values across all clusters is not constrained to be 1. Instead, each membership value is independent, reflecting the degree of possibility rather than probability.
Since R2026a
Initial fuzzy partition matrix, specified as an
Nc-by-Nd
matrix, where Nc is the number of clusters and
Nd is the number of data points.
Element U(i,j) indicates the
degree of membership μij of the
jth data point in the ith cluster.
When PartitionMatrix is empty, the FCM algorithm randomly
initializes the partition matrix values.
Dependencies
When
ClusterMembershipTypeis"probabilistic", the sum of the membership values for each cluster must be one; that is, the sum of each column ofPartitionMatrixmust be one.PartitionMatrixmust have the same number of rows asClusterCenters.
Since R2023b
Initial cluster centers, specified as a Nc-by-Nf matrix, where Nc is the number of clusters and Nf is the number of data features.
When ClusterCenters is empty, the FCM algorithm derives the initial
cluster centers based on the initial partition matrix.
Dependencies
ClusterCenters must have the same number of rows
as PartitionMatrix.
Since R2026a
Option to display cluster plot after each clustering iteration, specified as one of these values:
true— Display cluster plot.false— Do not display cluster plot.
Option to display objective function for each iteration, specified as one of these values:
true— Display objective function.false— Do not display objective function.
Object Functions
fcm | Fuzzy c-means clustering |
Examples
Create an fcmOptions object for computing three clusters using a maximum of 200 iterations.
opt = fcmOptions(... NumClusters=3,... MaxNumIteration=200);
You can also specify options using dot notation. For example, disable the command-window output of the objective function value for each FCM iteration.
opt.Verbose = false;
Version History
Introduced in R2023aYou can now compute fuzzy clusters with possibilistic membership values by creating an
fcmOptions object and setting the
ClusterMembershipType property to
"possibilistic".
You can now specify an initial partition matrix by creating an
fcmOptions object and setting the PartitionMatrix
property.
You can now display the cluster plot after each clustering iteration by setting the
ShowClusterPlot option to true.
You can now specify initial estimates of the cluster centers by creating an
fcmOptions object and setting the ClusterCenters
property.
You can now specify multiple values for the number of clusters by creating an
fcmOptions object and setting the NumClusters
property to "auto" or a vector of integers.
You can now cluster data using the Gath-Geva FCM algorithm. To use this algorithm,
create an fcmOptions object and set the DistanceMetric
property to "fmle".
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.
Americhe
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)