Skip to content

Commit

Permalink
correctly check all predictor variables are in new data
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemvanderdeure committed Mar 5, 2024
1 parent 574b696 commit c59bb97
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/predict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ prediction = Maxnet.predict(bradypus_model, env)
"""
function predict(m::MaxnetModel, x; link = CloglogLink(), clamp = false)
predictors = Tables.columntable(x)
for k in keys(predictors)
k in keys(m.predictor_data) || error("$k is not found in the predictors")
for k in keys(m.predictor_data)
k in keys(predictors) || error("$k is not found in the predictors")
end

# clamp the predictors
Expand Down

0 comments on commit c59bb97

Please sign in to comment.