2 Sep 2006 00:32
Re: customized cross validation in weka?
Peter Reutemann <fracpete <at> cs.waikato.ac.nz>
2006-09-01 22:32:13 GMT
2006-09-01 22:32:13 GMT
> Is there a user-defined or cutomised cross validation method > in Weka? I mean, for example, I have 1000 data records and I want to > do a 5-fold CV, I want to take recordes from 1 to 200 as fold1, > 201-400 as fold2 , ..., 801-1000 as fold5. Can I let Weka do cross > validation on these self-defined folds? If you're trying to avoid the randomization/stratification of the data, there's no way around. You will have to implement that yourself. Check out the following method of the weka.classifiers.Evaluation class: crossValidateModel(Classifier,Instances,int,Random) Commenting out the randomize and stratify method calls should give you your desired custom cross-validation. Whether these results are then reliable, that's a different question... NB these changes don't affect the Explorer and the Experimenter, only when you call a classifier from the commandline! HTH Cheers, Peter -- -- Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ http://www.cs.waikato.ac.nz/~fracpete/ +64 (7) 838-4466 Ext. 5174
RSS Feed