Package com.digitalpebble.classification

Examples of com.digitalpebble.classification.Learner


    // create it
    File directory = new File("./temp");
    if(directory.exists() == false){
     new File("./temp").mkdir();
    }   
    Learner creator = Learner.getLearner("./temp",Learner.LibSVMModelCreator,true);
    creator.setParameters(parameters);
    creator.setMethod(Parameters.WeightingMethod.BOOLEAN);

    RAMTrainingCorpus subjectiveCorpus = getCorpus(fileSubj,"subjective",creator);
    RAMTrainingCorpus objectiveCorpus = getCorpus(fileObj,"objective",creator);
    subjectiveCorpus.addAll(objectiveCorpus);
   
    // filter some of the attributes out based on their LLR score
    creator.keepTopNAttributesLLR(2000);
   
    // prune terms
    // creator.pruneTermsDocFreq(2,subjectiveCorpus.size());
   
    long l0 = System.currentTimeMillis();
    creator.learn(subjectiveCorpus);
    long l1 = System.currentTimeMillis();
    System.err.println("learning done in "+(l1-l0));
  }
View Full Code Here

TOP

Related Classes of com.digitalpebble.classification.Learner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.