Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using meta learning in RWeka

Tags:

java

r

stat

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.

like image 511
Leo5188 Avatar asked Nov 14 '22 01:11

Leo5188


1 Answers

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

like image 110
MichaelMMeskhi Avatar answered Nov 16 '22 16:11

MichaelMMeskhi