Typical workflow for k-means clustering - 5.2 English - 68552

AOCL API Guide (68552)

Document ID
68552
Release Date
2025-12-29
Version
5.2 English

The standard way of using k-means clustering in AOCL-DA is as follows.

  1. Initialize a aoclda.clustering.kmeans() object with options set in the class constructor.

  2. Compute the k-means clusters using aoclda.clustering.kmeans.fit().

  3. Perform further transformations or predictions using aoclda.clustering.kmeans.transform() or aoclda.clustering.kmeans.predict().

  4. Extract results from the aoclda.clustering.kmeans() object via its class attributes.

  1. Initialize a da_handle with da_handle_type da_handle_kmeans.

  2. Set the number of clusters required and other options using da_options_set_? (see below).

  3. Pass data to the handle using da_kmeans_set_data_?.

  4. Optionally set the initial centres using da_kmeans_set_init_centres_?.

  5. Compute the k-means clusters using da_kmeans_compute_?.

  6. Perform further computations as required, using da_kmeans_transform_? or da_kmeans_predict_?.

  7. Extract results using da_handle_get_result_?.