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
Hello,
Previously, I tried all the classification methods as mentioned on your Github and that worked. However, I am trying the supervised method using Random forest and I get the following error consistantly. Please help me out regarding this issue. It will be highly appreciated. Thank you.
Error:
classification<-fieldSegment(mosaic = Test, trainDataset = training_sam)
[1] "Starting supervised classification ..."
Error in predict.randomForest(modelFit, newdata) :
variables in the training data missing in newdata
Hello,
Previously, I tried all the classification methods as mentioned on your Github and that worked. However, I am trying the supervised method using Random forest and I get the following error consistantly. Please help me out regarding this issue. It will be highly appreciated. Thank you.
Error:
classification<-fieldSegment(mosaic = Test, trainDataset = training_sam)
[1] "Starting supervised classification ..."
Error in predict.randomForest(modelFit, newdata) :
variables in the training data missing in newdata
Code:
soil<-fieldView(mosaic = Test, editor = TRUE)
soil<-st_as_sf(st_sample(soil, 200))
soil$class<-'soil'
plants<-fieldView(mosaic = Test, editor = TRUE)
plants<-st_as_sf(st_sample(plants, 200))
plants$class<-'plants'
training_sam<-rbind(soil,plants)
classification<-fieldSegment(mosaic = raster(Test), trainDataset = training_sam)
The text was updated successfully, but these errors were encountered: