g_cluster(G;S;XX;A;N;Z)
Returns a model corresponding to the clustering of points in data.
Function type
Vector only
Syntax
g_cluster(G;S;XX;A;N;Z)
Input
Argument | Type | Description |
---|---|---|
G |
any | A space- or comma-separated list of column names Rows are in the same group
if their values for all of the columns listed in If If any of the columns listed in |
S |
integer | The name of a column in which every row evaluates to a 1 or 0, which determines
whether or not that row is selected to be included in the calculation If
If any of the values in
|
XX |
integer or decimal | A space- or
comma-separated list of column names This denotes the data for clustering. |
A |
text | A string that specifies the clustering algorithm to useA
may have the value:
|
N |
integer | The number of clusters into which to partition the data |
Z |
integer or decimal | A list of two elements Z is a list of two elements that
specify:
If |
Return Value
For every row in each group defined by G
(and for those rows where
S
=1, if specified), g_cluster
applies a clustering algorithm specified by method
A
(as modified by
parameters N
and Z
) to the data in XX
and
returns a special type representing a model for each group in the data.
g_cluster
returns can be used as an argument to:param(M;P;I)
to extract the clustering model parameters, orclassify(XX;M;Z)
to classify data points (i.e., assign them to clusters)
M
is the column containing the result of
g_cluster
, use the following function calls to obtain the desired information:param(M;'centers';D I)
D
'th dimension of the center of theI
'th clusterD
ranges from 1 to the number of elements inXX
aboveI
ranges from 1 toN
above
classify(XX;M;)
- Discrete cluster assignment
I
for each point inXX