What is predict value of GBM model in R? and why NaN residual?

Well, I have a GBM model for nematode density with some predictor variables (SI = Spectral Index).

However, my model showed "NaN" residual with poisson distribution, and when I used predicted(gbm.fit) or gbm.fit$fit showed continuous values, but I have discrete values.

What should I use, predicted(gbm.fit) or gbm.fit$fit? What does gbm.fit$fit give me?

Can anyone help me with a problem?

This is the gbm algorithm used:

  gbm.fit <- gbm(

  formula = juv ~ NDRE + WI + GRAY + RSVI + VDVI,

  distribution = "poisson",

  data = data_base,

  n.trees = 5000,

  interaction.depth = 15,

  bag.fraction = 3,

  shrinkage = 0.01,

       cv.folds = 5,

  n.cores = NULL, # will use all cores by default

  verbose = FALSE
    )

Then I do:

sqrt(min(gbm.fit$fit))

Which produces this error:

Warning in sqrt(min(gbm.fit$cv.error)) : NaNs produced
[1] NaN
measure = read_xlsx("quantification.xlsx")


Comments

Popular posts from this blog

Today Walkin 14th-Sept

Spring Elasticsearch Operations

Hibernate Search - Elasticsearch with JSON manipulation