Guest User

Untitled

a guest
Aug 14th, 2018
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.91 KB | None | 0 0
  1. ERROR While using WEKA API in java code: Class Attribute Not Set?
  2. Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
  3. Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
  4. Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
  5. Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?
  6. weka.core.UnassignedClassException: weka.classifiers.trees.j48.C45PruneableClassifierTree: Class attribute not set!
  7. at weka.core.Capabilities.test(Capabilities.java:1086)
  8. at weka.core.Capabilities.test(Capabilities.java:1018)
  9. at weka.core.Capabilities.testWithFail(Capabilities.java:1297)
  10. .....
  11.  
  12. try{
  13. DatabaseLoader loader = new DatabaseLoader();
  14. loader.setSource("jdbc:mysql://localhost:3306/cuaca","root","491754");
  15. loader.setQuery("select * from data_training");
  16. Instances data = loader.getDataSet();
  17.  
  18. jTextArea1.append(data.toString());
  19.  
  20. String[] options = new String[1];
  21. options[0] = "U"; // unpruned tree
  22. J48 tree = new J48(); // new instance of tree
  23. tree.setOptions(options); // set the option
  24. tree.buildClassifier(data); // build classifier
  25. //Evaluation eval=new Evaluation(data);
  26. //eval.crossValidateModel(tree, data, 10, new Random(1));
  27. //jTextArea1.append(eval.toSummaryString("n HASILNYA n", false));
  28.  
  29. }catch(IOException ioe){ioe.printStackTrace();}
  30. catch(Exception e){e.printStackTrace();}
  31.  
  32. @relation data_training
  33.  
  34. @attribute Tmean numeric
  35. @attribute Tmax numeric
  36. @attribute Td numeric
  37. @attribute RH numeric
  38. @attribute SLP numeric
  39. @attribute STP numeric
  40. @attribute Wind_ave numeric
  41. @attribute Wind_max numeric
  42. @attribute Hujan {Y,T}
  43.  
  44. @data
  45. 25.9,31.6,23.1,93.4,1008.5,998.2,2.6,12.9,Y
  46. 27.6,31.4,22.3,87,1009.6,999.3,0.8,3.1,T
  47. 27.4,32.6,21.9,86.1,1009.4,999.2,4.5,14.3,T
  48. 27.6,32.2,22.4,87.3,1009.1,998.9,2.4,8.2,T
Add Comment
Please, Sign In to add comment