Skip to content
Back to formatted view

Raw Message

Message-ID: <E1I8b78-0004BL-VJ@www19.emo.freenet-rz.de>
Date: 2007-07-11T12:16:14Z
From: strinz at freenet.de
Subject: RWeka control parameters classifiers interface

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