oph_ccluster_kcluster

Description

Behaviour

It computes clusters from input data through the use of k-means or k-medians algorithms.

Parameters

  • input measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • output measure type: Ophidia typing. Supported types are: ‘oph_double’; ‘oph_float’; ‘oph_long’; ‘oph_int’; ‘oph_short’; ‘oph_byte’.
  • measure: input measures.
  • k: number of requested clusters.
  • method: clustering algorithm. Supported algorithms are:
    • ‘KMEANS’ (default);
    • ‘KMEDIANS’.
  • level: type of output. Supported outputs are:
    • ‘CENTROIDS’: only centroid values for each cluster (spatial information is lost) (output is oph_double);
    • ‘LABELS’: returns an integer between 0 and k-1 for each point according to found clusters (output is oph_int);
    • ‘ALL’ (default): returns the centroid value of the corresponding cluster for each point (output is oph_double).
  • npass: number of iterations for the EM algorithm. At each iteration means or medians are computed and there is a new cluster assignment. With more iterations, results are more accurate. Default value is 1.

Return type

Binary-array.

Examples

Group data into 2 clusters, with 10 EM iterations, and return the centroid value for each input point.

oph_ccluster_kcluster('OPH_DOUBLE','OPH_DOUBLE',measure,2,'KMEANS',10,'ALL')

Operation type

Reduce.

Arguments

Argument name Type Mandatory Values Default Min/Max-value Min/Max-times
input measure type “oph_type” “yes” “‘oph_double’|’oph_float’|’oph_int’|’oph_long’|’oph_short’|’oph_byte’|’oph_ complex_double’|’oph_complex_float’|’oph_complex_int’|’oph_complex_long’”     “1” / “1”
output measure type “oph_type” “yes” “‘oph_double’|’oph_float’|’oph_int’|’oph_long’|’oph_short’|’oph_byte’|’oph_ complex_double’|’oph_complex_float’|’oph_complex_int’|’oph_complex_long’”     “1” / “1”
measure “binary-array” “yes”       “1” / “1”
k “int” “yes”       “1” / “1”
method “string” “no” “‘kmeans’|’kmedians’” “‘kmeans’”   “0” / “1”
level “string” “no” “‘centroids’|’labels’|’al l’” “‘all’”   “0” / “1”
npass “int” “no”   “1”   “0” / “1”