Re: Issues accessing class attributes of external package distance function
Peter Reutemann <[email protected]> Wed, 20 Jul 2022 13:45:28 +1200
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAHoQ12JoTU=+2KKjS4BYfsCqgToVgdz7R3NwNvwwuiQDY_1hKg@mail.gmail.com> |
> I am trying to fetch the result of a distance metric, implemented as Weka external package, and use it in python via python-weka-wrapper3. > > For this, I augment DilcaDistance.java by the method getMatricesDilca (and build a jar myself), as shown below (most parts of the file are omitted): > > https://svn.cms.waikato.ac.nz/svn/weka/trunk/packages/external/DilcaDistance/src/main/java/weka/core/DilcaDistance.java [...] I just committed some changes to pww3 that allow you to access or call non-public Java fields/methods (NB: a Java security manager may not allow this type of access, so your mileage may vary). The following example script shows the use of the methods "get_non_public_field" and "call_non_public_method" and also applies it to the DilcaDistance class: https://github.com/fracpete/python-weka-wrapper3-examples/blob/master/src/wekaexamples/core/non_public_access.py Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 858-5174 (office) +64 (7) 577-5304 (home office) 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