Ana Davidson
2012-Dec-07 19:51 UTC
[R] Conditional inference forest error: levels in factors do not match
#Conditional inference forest ("Party" package) error message states that levels in factors of new data do not match original data, but they do... #create conditional inference forest oc_listed.fit1 <- cforest(Listed~ HabMode,controls=cforest_unbiased(ntree=500), data=oc.complete) #use predict function for subset of data #this works correctly predict(oc_listed.fit1,newdata=oc.complete[1:10,]) #use predict on new set of data predict(oc_listed.fit1,newdata=DD_NOT) #produces this error message #Error in checkData(oldData, RET) : #Levels in factors of new data do not match original data #We can show that all of the levels match table(DD_NOT$ORD %in% oc.complete$ORD) #same check sum(!levels(DD_NOT$ORD) %in% levels(oc.complete$ORD)) #equals 0, all levels are the same. #Then why does it fail? Thanks, Ana
Maybe Matching Threads
- CForest Error Logical Subscript Too Long
- cforest - keep.forest = false option? (fwd)
- cforest - keep.forest = false option?
- cforest and cforest_unbiased for testing and training datasets
- Package party Error in model.matrix.default(as.formula(f), data = blocks) :allocMatrix: too many elements specified