Skip to content

Plotting error rate for incremental classifier

The KnowledgeFlow enables one to plot the error rate (= RMSE, root mean squared error) and the accuracy of an incremental classifier. An incremental classifier is a classifier that does not need to see the whole data at once, but can be trained instance by instance. All classifiers implementing the interface [weka.classifiers.UpdateableClassifier](https://weka.sourceforge.io/doc.dev/weka/classifiers/updateableclassifier.html) are incremental ones.

Setup#

The most basic setup for an incremental classifier is show below, using the classifier NaiveBayesUpdateable:

 ArffLoader
   --instance--> NaiveBayesUpdateable
   --incrementalClassifier--> IncrementalClassifierEvaluator
   --chart--> StripChart
Here is a screenshot of the setup:

Screenshot

You can also download KnowledgeFlow-incremental_classifier.kfml, an XML version of this setup.

Displaying the chart#

  • select a dataset that you want to train the classifier with, via Configure... from the ArffLoader's context menu, e.g., the UCI dataset anneal.
  • select Show chart from the StripChart's context menu (the chart will only be updated if visible!)
  • select Start loading from the ArffLoader's context menu.
  • bring the chart back to front and you should get a graph similar to this one (click to enlarge):

Screenshot

Exporting the chart#

As of 08/07/2008 (or Weka >3.5.7), the chart can be exported to several file formats using the developer version of Weka. The magic key for bringing up the export dialog is <Ctrl+Alt+Shift><Left-Click>.

Since the default black background is not very practical if one wants to embed the chart in a document, one can change the background color via the following property of the Beans.props properties file (and set it to white):

 weka.gui.beans.StripChart.backgroundColour
The text color of the legend can be modified via the following property (and set it to black):

 weka.gui.beans.StripChart$LegendPanel.borderColour
Note: Due to the design of the StripChart (nested JPanels), the EPS export does not work properly. But one can always export it as PNG and then convert it under Linux via the pngtopnm/pnmtops/ps2epsi chain. See commandline help of those tools for more details.

See also#