Typical workflow for decision trees and decision forests - 5.2 English - 68552

AOCL API Guide (68552)

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

The following workflow can be used to fit a decision tree or a decision forest model and use it to make predictions,

Decision trees

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

  2. Fit the model using aoclda.decision_tree.decision_tree.fit().

  3. Evaluate prediction accuracy on test data using aoclda.decision_tree.decision_tree.score().

  4. Make predictions using the fitted model using aoclda.decision_tree.decision_tree.predict().

Decision forests

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

  2. Fit the model using the aoclda.decision_forest.decision_forest.fit().

  3. Evaluate prediction accuracy on test data using aoclda.decision_forest.decision_forest.score().

  4. Make predictions using the fitted model using aoclda.decision_forest.decision_forest.predict().

Decision trees

  1. Initialize a da_handle with da_handle_type da_handle_decision_tree.

  2. Pass data to the handle using da_tree_set_training_data_?.

  3. Set optional parameters, such as maximum depth, using da_options_set_? (see options section).

  4. Fit the model using da_tree_fit_?.

  5. Evaluate prediction accuracy on test data using da_tree_score_?.

  6. Make predictions using the fitted model using da_tree_predict_?.

Decision forests

  1. Initialize a da_handle with da_handle_type da_handle_decision_forest.

  2. Pass data to the handle using da_forest_set_training_data_?.

  3. Set optional parameters, such as maximum depth, using da_options_set_? (see options section).

  4. Fit the model using da_forest_fit_?.

  5. Evaluate prediction accuracy on test data using da_forest_score_?.

  6. Make predictions using the fitted model using da_forest_predict_?.