Search code examples
rclassificationr-caretnaivebayes

caret package classifiers are not responding


I am trying to model a train data with caret package's classifiers, but it does not respond for a very long time (I have waited for 2 hours). On the other hand, it works for other datasets.

Here is the link to my train data: http://www.htmldersleri.org/train.csv (It is well-known Reuters-21570 data set)

And the command I am using is:

model<-train(class~.,data=train,method="knn")

Note: for any other method (eg: svm, naive bayes, etc.), is stucks anyway.

Note 2: For package e1071, naiveBayes classifier works, but with 0,08% accuacy!

Can anyone tell me what can be the problem? Thanks in advance.


Solution

  • This seems to be multiclass classification problem. I'm not sure if caret supports that. However, I can show you how you would do the same thing with the mlr package

    library(mlr)
    x <- read.csv("http://www.htmldersleri.org/train.csv")
    tsk <- makeClassifTask(data = x, target = 'class')
    #Assess the performane with 10-fold cross-validation
    crossval('classif.knn', tsk)
    

    If you want to know which learners are integrated in mlr that support this kind of task, type listLearners(tsk)