Skip to content

Commit 2406748

Browse files
code cleaning
1 parent 3dc124c commit 2406748

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

cpp/APLRRegressor.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ void APLRRegressor::initialize(const std::vector<size_t> &prioritized_predictors
599599
linear_predictor_current=VectorXd::Constant(y_train.size(),intercept);
600600
linear_predictor_null_model=linear_predictor_current;
601601
linear_predictor_current_validation=VectorXd::Constant(y_validation.size(),intercept);
602-
predictions_current=transform_linear_predictor_to_predictions(linear_predictor_current,link_function,dispersion_parameter);
603-
predictions_current_validation=transform_linear_predictor_to_predictions(linear_predictor_current_validation,link_function,dispersion_parameter);
602+
predictions_current=transform_linear_predictor_to_predictions(linear_predictor_current,link_function);
603+
predictions_current_validation=transform_linear_predictor_to_predictions(linear_predictor_current_validation,link_function);
604604

605605
validation_error_steps.resize(m);
606606
validation_error_steps.setConstant(std::numeric_limits<double>::infinity());
@@ -770,8 +770,8 @@ void APLRRegressor::update_linear_predictor_and_predictions()
770770
{
771771
linear_predictor_current+=linear_predictor_update;
772772
linear_predictor_current_validation+=linear_predictor_update_validation;
773-
predictions_current=transform_linear_predictor_to_predictions(linear_predictor_current,link_function,dispersion_parameter);
774-
predictions_current_validation=transform_linear_predictor_to_predictions(linear_predictor_current_validation,link_function,dispersion_parameter);
773+
predictions_current=transform_linear_predictor_to_predictions(linear_predictor_current,link_function);
774+
predictions_current_validation=transform_linear_predictor_to_predictions(linear_predictor_current_validation,link_function);
775775
}
776776

777777
void APLRRegressor::update_gradient_and_errors()
@@ -1427,7 +1427,7 @@ VectorXd APLRRegressor::predict(const MatrixXd &X, bool cap_predictions_to_minma
14271427
validate_that_model_can_be_used(X);
14281428

14291429
VectorXd linear_predictor{calculate_linear_predictor(X)};
1430-
VectorXd predictions{transform_linear_predictor_to_predictions(linear_predictor,link_function,dispersion_parameter)};
1430+
VectorXd predictions{transform_linear_predictor_to_predictions(linear_predictor,link_function)};
14311431

14321432
if(cap_predictions_to_minmax_in_training)
14331433
{

cpp/functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ VectorXd calculate_exp_of_linear_predictor_adjusted_for_numerical_problems(const
256256
return exp_of_linear_predictor;
257257
}
258258

259-
VectorXd transform_linear_predictor_to_predictions(const VectorXd &linear_predictor, const std::string &link_function="identity", double dispersion_parameter=1.5)
259+
VectorXd transform_linear_predictor_to_predictions(const VectorXd &linear_predictor, const std::string &link_function="identity")
260260
{
261261
if(link_function=="identity")
262262
return linear_predictor;

0 commit comments

Comments
 (0)