0

My goal is to test how well a Multilayer Perceptron classifies the 20 newsgroups data. I keep getting only 5% accuracy with this method but can obtain ~90% with other classification methods such as Naive Bayes and KNN. I'm sure I am doing it wrong, so here is my code in hopes that someone can point me in the right direction:

    newsgroups_data.setClassIndex(newsgroups_data.numAttributes() - 1);
    StringToWordVector filter = new StringToWordVector();

    FilteredClassifier classifier = new FilteredClassifier(); 
    classifier.setFilter(filter); 

    MultilayerPerceptron mlp = new MultilayerPerceptron();

    mlp.setTrainingTime(300); //This alone takes an hour or more
    mlp.setLearningRate(0.01);
    mlp.setHiddenLayers("1"); 
    mlp.setReset(false);

    classifier.setClassifier(mlp);
    classifier.buildClassifier(newsgroups_data);

    Evaluation eval = new Evaluation(newsgroups_data);
Istvan Nagy
  • 310
  • 4
  • 13
GiH
  • 365
  • 4
  • 16

1 Answers1

0
mlp.setHiddenLayers("1")

means you want to use one hidden layer with one node in it (that means you're setting up a neural network with ONE total neurons).