EdwardRaff / JSAT

Java Statistical Analysis Tool, a Java library for Machine Learning
GNU General Public License v3.0
789 stars 205 forks source link

Null pointer when using BDS feature selector #95

Closed jbax7635 closed 3 years ago

jbax7635 commented 3 years ago

Either i'm not using correctly or when using the BDS selector i keep getting a null pointer

i'm using the selector like this:

Classifier classifier = new LogisticRegression();

DataTransform SFS = new BDS(20, classificationDataSet, classifier , 10 ); // error gets thrown here classificationDataSet.applyTransform(SFS);

stack trace shows:

java.lang.NullPointerException at jsat.classifiers.ClassificationDataSet.addDataPoint(ClassificationDataSet.java:342) at jsat.classifiers.ClassificationDataSet.getSubset(ClassificationDataSet.java:234) at jsat.classifiers.ClassificationDataSet.getSubset(ClassificationDataSet.java:20) at jsat.DataSet.randomSplit(DataSet.java:488) at jsat.DataSet.cvSet(DataSet.java:513) at jsat.classifiers.ClassificationModelEvaluation.evaluateCrossValidation(ClassificationModelEvaluation.java:176) at jsat.datatransform.featureselection.SFS.getScore(SFS.java:315) at jsat.datatransform.featureselection.SFS.SFSSelectFeature(SFS.java:272) at jsat.datatransform.featureselection.BDS.search(BDS.java:195) at jsat.datatransform.featureselection.BDS.(BDS.java:83) at backTester.BackTester.transform(BackTester.java:794) at backTester.BackTester.getEventModel(BackTester.java:676) at backTester.BackTester.runBackTest(BackTester.java:147) at backTester.BackTester.main(BackTester.java:72)

any help would be greatly appreciated

jbax7635 commented 3 years ago

opened twice