I have a problem can any one help me?
When I using machine learning library for java (ml-java) for KNN cluster:
I have a 2D array of features (double type), so to use the ml-java I should convert it to dataset datatype
to do this I convert each record in the features array into instance and I add this instance to dataset
but when I print the dataset data I found the following :
{[0.893139842, 0.550304878, 0.536294691, 0.0, 0.321348315, 0.732189974, 0.0, 0.0, 0.0, 0.0, 0.0];null}
this null value come when I convert the feature records into instance which represent the label of record, so I hava error when I apply the KNN code :
Exception in thread "AWT-EventQueue-1" java.lang.NullPointerException
at net.sf.javaml.classification.evaluation.CrossValid ation.crossValidation(CrossValidation.java:66)
at net.sf.javaml.classification.evaluation.CrossValid ation.crossValidation(CrossValidation.java:111)
at net.sf.javaml.classification.evaluation.CrossValid ation.crossValidation(CrossValidation.java:126)
at multiapp.jButton1ActionPerformed(multiapp.java:468 )
at multiapp.access$100(multiapp.java:39)
at multiapp$2.actionPerformed(multiapp.java:121)
at javax.swing.AbstractButton.fireActionPerformed(Abs tractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed (AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultB uttonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.jav a:6505)
at javax.swing.JComponent.processMouseEvent(JComponen t.java:3321)
at java.awt.Component.processEvent(Component.java:627 0)
at java.awt.Container.processEvent(Container.java:222 9)
at java.awt.Component.dispatchEventImpl(Component.jav a:4861)
at java.awt.Container.dispatchEventImpl(Container.jav a:2287)
at java.awt.Component.dispatchEvent(Component.java:46 87)
at java.awt.LightweightDispatcher.retargetMouseEvent( Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(C ontainer.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Conta iner.java:4422)
at java.awt.Container.dispatchEventImpl(Container.jav a:2273)
at java.awt.Component.dispatchEvent(Component.java:46 87)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.j ava:703)
at java.awt.EventQueue.access$000(EventQueue.java:102 )
at java.awt.EventQueue$3.run(EventQueue.java:662)
at java.awt.EventQueue$3.run(EventQueue.java:660)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:676)
at java.awt.EventQueue$4.run(EventQueue.java:674)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPri vilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java: 673)
at java.awt.EventDispatchThread.pumpOneEventForFilter s(EventDispatchThread.java:244)
at java.awt.EventDispatchThread.pumpEventsForFilter(E ventDispatchThread.java:163)
at java.awt.EventDispatchThread.pumpEventsForHierarch y(EventDispatchThread.java:151)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:147)
at java.awt.EventDispatchThread.pumpEvents(EventDispa tchThread.java:139)
at java.awt.EventDispatchThread.run(EventDispatchThre ad.java:97)
how can I eliminate the null value from the dataset or any way to solve this problem????????/