How do I write a new classifier or filter?

Basically, a classifier needs to be derived from weka.classifiers.Classifier and a filter from weka.filters.Filter. But this is only part of the story. The following articles cover the development of new schemes in great detail:

If your scheme is outside the usual WEKA packages, you need to make WEKA aware of this package in order to be able to use it in the GUI as well. See How do I add a new classifier, filter, kernel, etc for more information about this.

Note: This is also covered in chapter Extending WEKA of the WEKA manual in versions later than 3.6.1/3.7.0 or snapshots of the stable-3.6/developer version later than 10/01/2010. Furthermore, this chapter also covers clusterers, attribute selection algorithms and associators.