Hello,

  I have some trouble in achieving the desired parametrisation
  for the weka classifier functions, using the package RWeka.

  The problem is, that the functions
  result=classifier(formula, data, subset, na.action, control = 
Weka_control(mycontrol))
  do not seem to be manipulated by the mycontrol- arguments

  Perhaps this should be resepected via the handlers- argument ,
  but the documentation in this regard is rather sparse. 

# ------------- Examples

file      =system.file("arff","iris.arff",package="RWeka") 
data      =read.arff(file=file)                 
rownames(data)=1:nrow(data)             
colnames(data)[ncol(data)]  ="class"    

library(RWeka)

# Example: no parameter influence
mySMO 
=make_Weka_classifier(name="weka/classifiers/functions/SMO",class=NULL,handlers=list());
     
# Using control =Weka_control()
m1 
=mySMO(formula=class~.,data=data[,],control=Weka_control(K="weka.classifiers.functions.supportVector.PolyKernel",E=2))
    
m2 
=mySMO(formula=class~.,data=data[,],control=Weka_control(K="weka.classifiers.functions.supportVector.PolyKernel",E=3))
 
m3 
=mySMO(formula=class~.,data=data[,],control=c("K","weka.classifiers.functions.supportVector.PolyKernel","E",3))
 
# Using predefinded interface, does not work 
x1      
=SMO(formula=class~.,data=data[,],control=Weka_control(K="weka.classifiers.functions.supportVector.PolyKernel",E=2))
    
x2      
=SMO(formula=class~.,data=data[,],control=Weka_control(K="weka.classifiers.functions.supportVector.PolyKernel",E=3))
    
m1$call   
m2$call   
m3$call         
x1$call
x2$call
# no differences:
m1 
m2 
m3
x1
x2

Any suggestions?
Many thanks
Bjoern

many thanks
bjoern

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to