title: How to save WEKA classifier errors to arff file using Python?
body: <p>I want to save the classifier errors to arff file using weka's python3 wrapper. To accomplish this using the weka GUI, I first run any classifier, then right-click the item from the result list and click &quot;Visualize classifier errors&quot;. This opens a window (refer image). Then to save the arff file I just click the save button. Since I need to do this for many files and for different classifiers, I can't do this manually.</p>
  <p><a href="https://i.stack.imgur.com/4UFe5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4UFe5.png" alt="" /></a></p>
  <p>Hence, I wrote the following code:</p>
  <pre><code>from weka.core.converters import Loader
  from weka.classifiers import FilteredClassifier, Classifier
  from weka.filters import Filter
  from weka.classifiers import Evaluation
  from weka.core.classes import Random
  
  PATH = &quot;file.arff&quot;
  
  loader = Loader(classname=&quot;weka.core.converters.ArffLoader&quot;)
  data = loader.load_file(PATH)
  data.class_is_last()
  
  remove = Filter(classname=&quot;weka.filters.unsupervised.attribute.Remove&quot;, options=[&quot;-R&quot;, &quot;1&quot;])
  cls = Classifier(classname=&quot;weka.classifiers.trees.J48&quot;, options=[&quot;-C&quot;, &quot;0.25&quot;, &quot;-M&quot;, &quot;2&quot;])
  
  fc = FilteredClassifier()
  fc.filter = remove
  fc.classifier = cls
  
  evl = Evaluation(data)
  evl.crossvalidate_model(classifier=fc, data=data, num_folds=10, rnd=Random(1))
  </code></pre>
  <p>But, how will I save the classifier errors using weka's python3 wrapper?</p>