5

I used RWeka to call Weka functions directly in R.

I tried using meta learning (bagging) but failed.

My code is Bagging(classLabel ~ ., data = train, control = Weka_control(W = J48)) However, the following error pops up:

Error in Bagging(classLabel ~ ., data = train, control = Weka_control(W = J48)) : 
  unused argument(s) (data = train, control = Weka_control(W = J48))

I also tried several different base learners but always met such error.

If you successfully used meta learning in RWeka before, please let me know.

Leo5188
  • 1,967
  • 2
  • 17
  • 21
  • 2
    Just tried another writing `optns <- Weka_control(W = "weka.classifiers.trees.REPTree") Bagging <- make_Weka_classifier("weka/classifiers/meta/Bagging") model <- Bagging(classLabel ~ ., data=dat, control = optns)` Surprisingly the R code works now. – Leo5188 Mar 26 '11 at 03:40
  • 1
    Post this as an answer and mark it as the solution. Maybe it will save someone's time who won't have to read your question. – Roman Luštrik Mar 26 '11 at 07:00

1 Answers1

1

Just tried another writing:

optns <- Weka_control(W = "weka.classifiers.trees.REPTree") Bagging <- make_Weka_classifier("weka/classifiers/meta/Bagging") model <- Bagging(classLabel ~ ., data=dat, control = optns)

Surprisingly the R code works now. -Credit Leo5188

MichaelMMeskhi
  • 659
  • 8
  • 26
  • I posted this as an answer as many of my friends have read this page for their problems. So for others mark this as an answer of post if your self. – MichaelMMeskhi Jun 11 '17 at 13:11