Decula
Decula

Reputation: 508

Weka EM cluster get "Error: Could not find or load main class test" in eclipse

I want to use weka to cluster tweets in the database in JSP. In GUI, I find only HierarchiccalClusterer and Filteredcluster available for string clustering. Then I find this clusteringdemo sample code from weka official website: https://svn.scms.waikato.ac.nz/svn/weka/trunk/wekaexamples/src/main/java/wekaexamples/clusterers/ClusteringDemo.java

However, after set up the sample arff code in weka directory, I get this error "Error: Could not find or load main class ClusteringDemo". Can anyone help me to find out the reason? I only change filename in the sentence data = DataSource.read(filename);. Besides, my classpath set up correctly for I already done some classifier.

Upvotes: 2

Views: 831

Answers (1)

arutaku
arutaku

Reputation: 6087

1.- Maybe the ClusteringDemo.class is not in your classpath. You should add the class of jar file to your project.

2.- Anyway, you can download the java code from: http://weka.wikispaces.com/file/detail/ClusteringDemo.java Compile and run it (make sure that weka.jar is in your classpath).

3.- If you have added ClusteringDemo.java to your project. Make sure that it has the "package" line (the first line) according to its location. Otherwise Java will not be able to find it.

Good luck using EM, maybe you can also try N-grams + Naive Bayes.

Upvotes: 0

Related Questions