Skip to content

Commit c86c013

Browse files
refactor
1 parent 02522eb commit c86c013

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cpp/APLRRegressor.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,10 +767,8 @@ void APLRRegressor::select_the_best_term_and_update_errors(size_t boosting_step)
767767
}
768768

769769
//Updating current predictions
770-
VectorXd values{terms_eligible_current[best_term].calculate(X_train)};
771-
VectorXd values_validation{terms_eligible_current[best_term].calculate(X_validation)};
772-
linear_predictor_update=values*terms_eligible_current[best_term].coefficient;
773-
linear_predictor_update_validation=values_validation*terms_eligible_current[best_term].coefficient;
770+
linear_predictor_update=terms_eligible_current[best_term].calculate_contribution_to_linear_predictor(X_train);
771+
linear_predictor_update_validation=terms_eligible_current[best_term].calculate_contribution_to_linear_predictor(X_validation);
774772
double error_after_updating_term=calculate_sum_error(calculate_errors(neg_gradient_current,linear_predictor_update,sample_weight_train));
775773
bool no_improvement{std::isgreaterequal(error_after_updating_term,neg_gradient_nullmodel_errors_sum)};
776774
if(no_improvement)

0 commit comments

Comments
 (0)