Skip to content

Commit c59bb97

Browse files
correctly check all predictor variables are in new data
1 parent 574b696 commit c59bb97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/predict.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ prediction = Maxnet.predict(bradypus_model, env)
2727
"""
2828
function predict(m::MaxnetModel, x; link = CloglogLink(), clamp = false)
2929
predictors = Tables.columntable(x)
30-
for k in keys(predictors)
31-
k in keys(m.predictor_data) || error("$k is not found in the predictors")
30+
for k in keys(m.predictor_data)
31+
k in keys(predictors) || error("$k is not found in the predictors")
3232
end
3333

3434
# clamp the predictors

0 commit comments

Comments
 (0)