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
Hi,
there are a number of cases where I (and others) observed that error "Something is wrong; all the Accuracy metric values are missing:".
Could the label drop function: factor(myFactor,exclude=NULL) to remove unused factor labels be added to the caret pre-processing WIKI? I think that would be helpful, the WIKI is clearly excellent and the best starter (besides the book) for getting a quick taste of the caret.
Also there could be an reference to PDF An introduction to data cleaning with R.
Not sure how many of these ideas in the article above could be added to the convenience method preProcess {caret}, but data pre-processing is surely one of the main time eaters when dealing with real-world ML data, because of so many levels of failure that are possible.
Example code:
# Random Forest# caret method = "rf"
require(caret)
data(iris)
# restrict iris dataset to two classes setose and versicolorTrainData<-iris[1:100,1:4]
TrainClasses<-iris[1:100,5]
# unfortunately factor levels still exist
summary(TrainClasses)
print(TrainClasses)
rfFit<- train(TrainData, TrainClasses,
method="rf",
trControl= trainControl(method="boot632"))
##Something is wrong; all the Accuracy metric values are missing:## Accuracy Kappa AccuracyApparent KappaApparent## Min. : NA Min. : NA Min. : NA Min. : NA ## 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA 1st Qu.: NA ## Median : NA Median : NA Median : NA Median : NA ## Mean :NaN Mean :NaN Mean :NaN Mean :NaN ## 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA 3rd Qu.: NA ## Max. : NA Max. : NA Max. : NA Max. : NA ## NA's :3 NA's :3 NA's :3 NA's :3 ##Error in train.default(TrainData, TrainClasses, method = "rf", trControl = trainControl(method = "boot632")) : ## Stopping##In addition: There were 50 or more warnings (use warnings() to see the first 50)rfFit
confusionMatrix(rfFit)
#----------------------------------# use TrainData <- iris[1:100,1:4] for two classes # then drop unused labels from factor using factor(exclude=NULL)TrainData<-iris[1:100,1:4]
TrainClasses<-factor(iris[1:100,5],exclude=NULL)
summary(TrainClasses)
print(TrainClasses)
rfFit<- train(TrainData, TrainClasses,
method="rf",
trControl= trainControl(method="boot632"))
rfFit
confusionMatrix(rfFit)
The text was updated successfully, but these errors were encountered:
Hi,
there are a number of cases where I (and others) observed that error "Something is wrong; all the Accuracy metric values are missing:".
Could the label drop function: factor(myFactor,exclude=NULL) to remove unused factor labels be added to the caret pre-processing WIKI? I think that would be helpful, the WIKI is clearly excellent and the best starter (besides the book) for getting a quick taste of the caret.
Also there could be an reference to PDF An introduction to data cleaning with R.
Not sure how many of these ideas in the article above could be added to the convenience method preProcess {caret}, but data pre-processing is surely one of the main time eaters when dealing with real-world ML data, because of so many levels of failure that are possible.
Example code:
The text was updated successfully, but these errors were encountered: