You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a multinomial logistic regression to estimate proportions of land-use across the globe. After estimating the model with nnet::multinom (which trains fine and suffers no convergence issues), I then use the trained model to predict the probabilities of land use across the globe, using terra::predict, using the following:
where newdata is our proprietary data used to predict across the globe, and lu_model is the trained nnet::multinom model. This behaves inconsistently, with occasional failures, within the same R session, with an error message saying:
# <subscriptOutOfBoundsError in `[<-`(`*tmp*`, keep, , value = matrix(.C(VR_nntest, as.integer(ntr),# as.double(x), tclass = double(ntr * nout), as.double(object$wts))$tclass,# ntr, nout)): subscript out of bounds>
Which suggests that this is some sort of internal problem with the output matrix. I have been able to rectify this through getting the probabilities separately, e.g.:
I am using a multinomial logistic regression to estimate proportions of land-use across the globe. After estimating the model with
nnet::multinom
(which trains fine and suffers no convergence issues), I then use the trained model to predict the probabilities of land use across the globe, usingterra::predict
, using the following:where
newdata
is our proprietary data used to predict across the globe, andlu_model
is the trainednnet::multinom
model. This behaves inconsistently, with occasional failures, within the same R session, with an error message saying:Which suggests that this is some sort of internal problem with the output matrix. I have been able to rectify this through getting the probabilities separately, e.g.:
Leading me to again believe this is a problem with the matrix internals, with this strange inconsistent error.
Apologies for the lack of data/reprex, as mentioned we are working on a proprietary dataset.
The text was updated successfully, but these errors were encountered: