Skip to content

Commit 04a316f

Browse files
refactor
1 parent f924daa commit 04a316f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cpp/APLRRegressor.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,8 @@ VectorXd APLRRegressor::differentiate_predictions()
450450
return 1.0/4.0 * (linear_predictor_current.array()/2.0).cosh().array().pow(-2);
451451
else if(link_function=="log")
452452
{
453-
return (linear_predictor_current.array()-linear_predictor_current.maxCoeff()).array().exp();
453+
double scaling{linear_predictor_current.maxCoeff()};
454+
return (linear_predictor_current.array()-scaling).array().exp();
454455
}
455456
else if(link_function=="tweedie")
456457
{

0 commit comments

Comments
 (0)