Dear all, I've got a problem when using multi search in java, so I wonderd if anyone could help. I referred to this site,https://github.com/fracpete/multisearch-weka-package and used multisearch version “2017.10.1". Here is my code. ————————————————————————————————— Classifier classifyModel = new RandomForest(); MultiSearch multi_search = new MultiSearch(); multi_search.setAlgorithm(new DefaultSearch()); multi_search.setClassifier(classifyModel); multi_search.buildClassifier(Data); Evaluation evaluation = new Evaluation(Data); evaluation.crossValidateModel(multi_search, Data, 10, new Random(1)); ————————————————————————————————— The Date file is sparse form and it is binary classification. ————————————————————————————————— @attribute @@class@@ {clean,buggy} @attribute Add Lines numeric @attribute Delete Lines numeric @attribute Distribution modified Lines numeric @attribute SumOfDeveloper numeric @attribute AGE numeric @attribute numOfSubsystems numeric @attribute numOfDirectories numeric @attribute numOfFiles numeric @attribute NUC numeric @attribute developerExperience numeric @attribute REXP numeric @attribute SEXP numeric @attribute LT numeric @data {1 0.078431,2 0.098039,3 4.986,4 1,5 16,6 7,7 20,8 55,9 0.254545,10 56,11 48,12 7,13 102} {1 0.030303,2 0.030303,3 2.026,4 3,7 18,8 36,9 0.333333,10 25,11 25,13 33} {0 buggy,1 0.012821,2 0.012821,3 1.753,4 1,6 1,7 1,8 7,9 0.428571,10 242,11 145.75,12 12,13 78} {1 46,3 2.842,4 1,6 3,7 4,8 9,9 0.333333,10 26,11 26,12 13} {1 0.084967,2 0.098039,4 2,6 1,7 1,8 1,9 1,10 39,11 39,12 14,13 153} {1 0.008197,2 0.008197,3 1.19,4 1,7 3,8 5,9 0.6,10 33,11 33,13 854} …. ————————————————————————————————— The Exception occur in "multi_search.buildClassifier(Data)” line. Here is the exceptions I've got. ————————————————————————————————— java.beans.IntrospectionException: Method not found: isRidge at java.desktop/java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:110) at java.desktop/java.beans.PropertyDescriptor.<init>(PropertyDescriptor.java:74) at weka.core.PropertyPath.find(PropertyPath.java:386) at weka.core.SetupGenerator.setup(SetupGenerator.java:592) at weka.classifiers.meta.multisearch.DefaultEvaluationTask.doRun(DefaultEvaluationTask.java:83) at weka.classifiers.meta.multisearch.AbstractEvaluationTask.call(AbstractEvaluationTask.java:105) at weka.classifiers.meta.multisearch.AbstractEvaluationTask.call(AbstractEvaluationTask.java:32) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at java.base/java.lang.Thread.run(Thread.java:835) ————————————————————————————————— I used weka version “3.9.5" and “3.9.2". In addition, I tried to java version 13, 12 and 11. Thanks. With sincere regards, Sujin. _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
It looks like this is doing something with serialization. Possibly the new or old serialized version has or had a isRidge method that the other doesn’t. You could try to delete/rename your wekafiles, then reinstall multi search and see if that works. You could try just updating or reinstalling multi search first but it could be serializing or caching something somewhere else in wekafiles. _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
> ava.beans.IntrospectionException: Method not found: isRidge
> > > It looks like this is doing something with serialization. > Possibly the new or old serialized version has or had a isRidge method that the other doesn’t. > You could try to delete/rename your wekafiles, then reinstall multi search and see if that works. > You could try just updating or reinstalling multi search first but it could be serializing or caching something somewhere else in wekafiles. No, serialization is not the issue. By changing the classifier to tune to RandomForest, but not updating the parameters to explore ("setParameters"), you get this error message. The default search parameter looks at the "ridge" option of the LinearRegression classifier. Unfortunately, Java outputs a bit of a cryptic message there: after failing to find "getRidge" it looks for "isRidge" and then uses that in the error message. MultiSearch uses no "magic" for optimizing parameters at all. Since there could be a very large number of options to explore in the feature space, you specify which ones to look at. E.g., if you wanted to find the optimal number of features ("numFeatures" in GenericObjectEditor) that the underlying RandomTree should look at, you could use something like this: import weka.classifiers.Classifier; import weka.classifiers.trees.RandomForest; import weka.classifiers.meta.MultiSearch; import weka.core.setupgenerator.MathParameter; MultiSearch multi_search = new MultiSearch(); param = new MathParameter(); param.setProperty("numFeatures"); param.setMin(0); param.setMax(5); param.setStep(1); param.setExpression("I"); multi_search.setParameters(new AbstractParameter[]{param}); multi_search.setAlgorithm(new DefaultSearch()); Classifier classifyModel = new RandomForest(); multi_search.setClassifier(classifyModel); multi_search.buildClassifier(Data); Evaluation evaluation = new Evaluation(Data); evaluation.crossValidateModel(multi_search, Data, 10, new Random(1)); [NB: The above code has not been compiled.] If your parameters are nested deeper in the classifier, then you need to specify the path through the objects. The project homepage has an example on a FilteredClassifier setup: https://github.com/fracpete/multisearch-weka-package#example Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 577-5304 http://www.cms.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/ _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
> By changing the classifier to tune to RandomForest, but not updating > the parameters to explore ("setParameters"), you get this error > message. The default search parameter looks at the "ridge" option of > the LinearRegression classifier Should this throw an error if setParameters is not done rather than assuming LinearRegression ones as a default? If I’m understanding correctly. _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
> > By changing the classifier to tune to RandomForest, but not updating
> > the parameters to explore ("setParameters"), you get this error > > message. The default search parameter looks at the "ridge" option of > > the LinearRegression classifier > > Should this throw an error if setParameters is not done rather than assuming LinearRegression ones as a default? > If I’m understanding correctly. All parameters in MultiSearch have default values. If you change all other parameters, apart from the parameters one, there is no way of knowing whether this was merely due to a typo or you forgot to change that parameter completely. Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 577-5304 http://www.cms.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/ _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
> On Feb 16, 2021, at 6:58 PM, Peter Reutemann <[hidden email]> wrote: > >>> By changing the classifier to tune to RandomForest, but not updating >>> the parameters to explore ("setParameters"), you get this error >>> message. The default search parameter looks at the "ridge" option of >>> the LinearRegression classifier >> >> Should this throw an error if setParameters is not done rather than assuming LinearRegression ones as a default? >> If I’m understanding correctly. > > All parameters in MultiSearch have default values. If you change all > other parameters, apart from the parameters one, there is no way of > knowing whether this was merely due to a typo or you forgot to change > that parameter completely. > Looking at the code maybe something like… In MultiSearch.java If (!m_classifier.equals(defaultClassifier()) && m_parameters[0].toString().equals(m_DefaultParameters[0].toString())) indicate classifier changed but default parameters unchanged error Might be some more complicated than that but seems possible. Assuming parameters would map to the classifier somehow. _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
> Looking at the code maybe something like…
> > In MultiSearch.java > > If (!m_classifier.equals(defaultClassifier()) && m_parameters[0].toString().equals(m_DefaultParameters[0].toString())) > indicate classifier changed but default parameters unchanged error > > Might be some more complicated than that but seems possible. Assuming parameters would map to the classifier somehow. Rather than trying something like this, a general check through all the parameters whether the specified object path is available would be more useful. Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 577-5304 http://www.cms.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/ _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
> On Feb 16, 2021, at 7:34 PM, Peter Reutemann <[hidden email]> wrote: > >> Looking at the code maybe something like… >> >> In MultiSearch.java >> >> If (!m_classifier.equals(defaultClassifier()) && m_parameters[0].toString().equals(m_DefaultParameters[0].toString())) >> indicate classifier changed but default parameters unchanged error >> >> Might be some more complicated than that but seems possible. Assuming parameters would map to the classifier somehow. > > Rather than trying something like this, a general check through all > the parameters whether the specified object path is available would be > more useful. > True, would catch other possible errors as well. _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
> >> Looking at the code maybe something like…
> >> > >> In MultiSearch.java > >> > >> If (!m_classifier.equals(defaultClassifier()) && m_parameters[0].toString().equals(m_DefaultParameters[0].toString())) > >> indicate classifier changed but default parameters unchanged error > >> > >> Might be some more complicated than that but seems possible. Assuming parameters would map to the classifier somehow. > > > > Rather than trying something like this, a general check through all > > the parameters whether the specified object path is available would be > > more useful. > > > > True, would catch other possible errors as well. Just pushed out a new release: 2021.2.17 The Maven artifacts might still take some time before they appear on Maven Central (sync has been triggered). Cheers, Peter -- Peter Reutemann Dept. of Computer Science University of Waikato, NZ +64 (7) 577-5304 http://www.cms.waikato.ac.nz/~fracpete/ http://www.data-mining.co.nz/ _______________________________________________ Wekalist mailing list -- [hidden email] Send posts to [hidden email] 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 |
Free forum by Nabble | Edit this page |