Typical Workflow for Regression Problems - Typical Workflow for Regression Problems - 5.3 English - 68552

AOCL API Guide (68552)

Document_ID
68552
Release_Date
2026-05-13
Version
5.3 English

The standard way using nearest neighbors for regression using AOCL-DA is as follows.

  1. Initialize a aoclda.neighbors.nearest_neighbors() object with options set in the class constructor.

  2. Fit your training data set using aoclda.neighbors.nearest_neighbors.fit().

  3. If only the target values of the test data are required, use aoclda.neighbors.nearest_neighbors.regressor_predict() with search method set to knn or radius_neighbors. Note that previous calls to aoclda.neighbors.nearest_neighbors.kneighbors() or aoclda.neighbors.nearest_neighbors.radius_neighbors() are not required.

  1. Initialize a da_handle with da_handle_type da_handle_nn.

  2. Pass data to the handle using da_nn_set_data_?.

  3. Set the number of neighbors, the radius, the metric or weights used in nearest neighbors using da_options_set_? (see below).

  4. Set the targets corresponding to the training data using da_nn_set_targets_?. This is only required for predicting target values.

  5. If only the target values of the test data are required, use da_nn_regressor_predict_? with search method set to knn_search_mode or radius_search_mode. Note that previous calls to da_nn_kneighbors_? or da_nn_radius_neighbors_? are not required.