Error while using predict function on extraTrees (R)


#1

When I use predict function on extraTrees object I get following error -

Error in .jcall(et$jobject, “[D”, “getValues”, toJavaMatrix2D(newdata)) : _
_ java.lang.NullPointerException

anyone has a way to resolve this ?

my model:

model_exTree_500 <- extraTrees(as.matrix(train[,features_exT]),as.factor(train$PredCol),
ntree=500,
nodesize=1,
numThreads=5,
mtry = sqrt(ncol(train))
)

Predict function:
pred_exTree <- predict(model_exTree_500, as.matrix(test[,features_exT]))


#2

Hi @sadashivb, are there missing values (NANs) in your data?


#3

I have verified. There are no NAN in the data


#4

Hi,

FYI Pls,

the above error got resolved after I added:

options( java.parameters = “-Xmx2g” )

It was my bad. This was mentioned in the R documents, but I had missed

Thanks @jalFaizy for your time.