From c59bb9789feb3fc9c1d5df7a9c691b0f836f5512 Mon Sep 17 00:00:00 2001 From: tiemvanderdeure Date: Tue, 5 Mar 2024 09:38:18 +0300 Subject: [PATCH] correctly check all predictor variables are in new data --- src/predict.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/predict.jl b/src/predict.jl index 73c8c9c..fc2a74c 100644 --- a/src/predict.jl +++ b/src/predict.jl @@ -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