// Flext attribute setters void dtree::set_training_mode(int training_mode) { bool success = grt_dtree.setTrainingMode(training_mode); if (success == false) { error("unable to set training_mode, hint: must be a value between 0 and " + std::to_string(GRT::DecisionTree::NUM_TRAINING_MODES)); } }
// Flext attribute setters void dtree::set_training_mode(int training_mode) { GRT::Tree::TrainingMode training_mode_ = GRT::Tree::TrainingMode::BEST_ITERATIVE_SPILT; try { training_mode_ = get_grt_training_mode(training_mode); } catch (std::exception& e) { error("unable to set training_mode, hint: must be a value between 0 and " + std::to_string(GRT::Tree::NUM_TRAINING_MODES)); return; } bool success = grt_dtree.setTrainingMode(training_mode_); if (success == false) { error("unable to set training mode"); } }
void dtree::get_remove_features_at_each_split(bool &remove_features_at_each_split) const { remove_features_at_each_split = grt_dtree.getRemoveFeaturesAtEachSpilt(); }
void dtree::get_max_depth(int &max_depth) const { max_depth = grt_dtree.getMaxDepth(); }
void dtree::get_min_samples_per_node(int &min_samples_per_node) const { min_samples_per_node = grt_dtree.getMinNumSamplesPerNode(); }
void dtree::get_num_splitting_steps(int &num_splitting_steps) const { num_splitting_steps = grt_dtree.getNumSplittingSteps(); }
// Flext attribute getters void dtree::get_training_mode(int &training_mode) const { training_mode = grt_dtree.getTrainingMode(); }
void dtree::set_remove_features_at_each_split(bool remove_features_at_each_split) { grt_dtree.setRemoveFeaturesAtEachSpilt(remove_features_at_each_split); }
void dtree::set_max_depth(int max_depth) { grt_dtree.setMaxDepth(max_depth); }
void dtree::set_min_samples_per_node(int min_samples_per_node) { grt_dtree.setMinNumSamplesPerNode(min_samples_per_node); }
void dtree::set_num_splitting_steps(int num_splitting_steps) { grt_dtree.setNumSplittingSteps(num_splitting_steps); }