Re: editing a filter

Peter Reutemann <[email protected]> Wed, 23 Nov 2022 11:38:57 +1300
Newsgroups gmane.comp.ai.weka
Message-ID <CAHoQ12JmB799tCZHnGM0igKK2NKhBoKp105COcLNzX5KPP+zeg@mail.gmail.com>
> Hello. Does anyone know where the source code for filters are? I want to edit the Normalize filter and also edit the user interface for the Normalize filter.
> I think I have found the source code for the filter here:
> weka-3.8\weka\src\main\java\weka\filters\unsupervised\attribute\Normalize.java

That is correct.

> but it doesn't seem to control the user interface.

No, Weka's user interface is automatically generated by the
GenericObjectEditor (package weka.gui) using Java beans properties. A
property consists of a get/set method pair that have matching type.
E.g., if you have "double getScale()" and "void setScale(double)" that
will give you the property "scale".

> For instance there is no occurrence of the text 'ignoreClass', although this is present in the UI.

You can find this property in the superclass:
weka.filters.unsupervised.attribute.PotentialClassIgnorer

> Also, although the text 'scale' occurs in Normalize.java, none of those occurrences of scale seem to be generating the text 'scale' on the UI.

If for a property a method can be located that ends in TipText (e.g.,
"scaleTipText"), then the result of this method is used as help text
in the UI.

Be aware that Weka also has command-line handling (from the days
before Weka had a UI). Check the following methods:
- listOptions
- getOptions
- setOptions

Since option handling applies to all option handling classes, the Weka
manual PDF that comes with your installation describes that only in
the section for writing a new classifier ("19.1.4.1
Methods"). Other sections, like for writing filters, reference this
section then.

Cheers, Peter
-- 
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
Mobile +64 22 190 2375
https://www.cs.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
To subscribe, unsubscribe, etc., visit https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html