Registry for available core filters, classifiers, etc

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Registry for available core filters, classifiers, etc

Thomas Diesler
Folks,

Is there an API to discover registered core filters, classifiers, etc
i.e. what is available out of the box in weka.jar without extra packages

cheers
— thomas

--------------------------------------------------
Pricipal Software Engineer at RedHat
Fuse Enterprise Integration



_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Registry for available core filters, classifiers, etc

Peter Reutemann
> Is there an API to discover registered core filters, classifiers, etc
> i.e. what is available out of the box in weka.jar without extra packages

Weka uses dynamic classpath discovery, ie, it analyzes the classpath
at startup for classes of derived from certain super classes in
specified packages.

You can use something like this to output the discovered classes
(excluding packages):

import weka.gui.GenericPropertiesCreator;
import java.util.Properties;

public class Blah {
  public static void main(String[] args) {
    Properties props = GenericPropertiesCreator.getGlobalOutputProperties();
    for (Object key: props.keySet()) {
      String keyStr = key.toString();
      System.out.println("\n" + keyStr);
      String[] elements = props.getProperty(keyStr).split(",");
      for (String element: elements)
        System.out.println("  " + element);
    }
  }
}

The "GenericPropertiesCreator.getGlobalOutputProperties()" method
returns a props file with superclasses as keys and the associated
properties are comma-separated lists of discovered classnames.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: Registry for available core filters, classifiers, etc

Michael Hall


> On Jan 25, 2020, at 2:46 PM, Peter Reutemann <[hidden email]> wrote:
>
>> Is there an API to discover registered core filters, classifiers, etc
>> i.e. what is available out of the box in weka.jar without extra packages
>
> Weka uses dynamic classpath discovery, ie, it analyzes the classpath
> at startup for classes of derived from certain super classes in
> specified packages.
>

You can include packages if you do a file search of class path and package jars

                Path packages = Paths.get(System.getProperty("user.home"),"wekafiles","packages");
                paths = new StringBuffer();
                        getWekaPackageJars(packages,paths);
                        cpath = paths.toString();
                        s = new Search(cpath,context,"weka.classifiers.*",false,new Vector<String>(),false,exact,false);
                        result = s.find();
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
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