This function is for use with clustering models that have been created using the
DBMS_DATA_MINING package or with the Oracle Data Mining Java API. It returns the cluster identifier of the predicted cluster with the highest probability for the set of predictors specified in the
mining_attribute_clause. The value returned is an Oracle
mining_attribute_clause behaves as described for the
PREDICTION function. Please refer to mining_attribute_clause.
Oracle Data Mining Concepts for detailed information on Oracle Data Mining features
Oracle Data Mining Administrator's Guide for information on the demo programs available in the code
Oracle Data Mining Application Developer's Guide for information on writing Oracle Data Mining applications
The following example lists the clusters into which customers of a given dataset have been grouped.
This example, and the prerequisite data mining operations, including the creation of the
dm_sh_clus_sample model and the
dm_sh_sample_apply_prepared view, can be found in the demo file
$ORACLE_HOME/rdbms/demo/dmkmdemo.sql. General information on data mining demo files is available in Oracle Data Mining Administrator's Guide. The example is presented here to illustrate the syntactic use of the function.
SELECT CLUSTER_ID(km_sh_clus_sample USING *) AS clus, COUNT(*) AS cnt FROM km_sh_sample_apply_prepared GROUP BY CLUSTER_ID(km_sh_clus_sample USING *) ORDER BY cnt DESC; CLUS CNT ---------- ---------- 2 580 10 199 6 185 8 115 12 98 16 82 19 81 15 68 18 65 14 27 10 rows selected.