Examples of Classifier


Examples of edu.uga.cs.fluxbuster.classification.Classifier

          if(simil){
            ClusterSimilarityCalculator calc2 = new ClusterSimilarityCalculator();
            calc2.updateClusterSimilarities(logdate);
          }
          if(clas){
            Classifier calc3 = new Classifier();
            calc3.updateClusterClasses(logdate, 30);
         
        } catch (Exception e) {
          if(log.isFatalEnabled()){
            log.fatal("", e);
          }
View Full Code Here

Examples of eu.admire.dispel.classifiers.Classifier

   */
  @Override
  protected T doSwitch(int classifierID, EObject theEObject) {
    switch (classifierID) {
      case ClassifiersPackage.CLASSIFIER: {
        Classifier classifier = (Classifier)theEObject;
        T result = caseClassifier(classifier);
        if (result == null) result = caseType(classifier);
        if (result == null) result = caseReferenceableElement(classifier);
        if (result == null) result = caseNamedElement(classifier);
        if (result == null) result = caseCommentable(classifier);
View Full Code Here

Examples of gannuCF.classifiers.Classifier

    System.out.print(".");
    Decision decision=new Decision(target,window);
    // TODO Auto-generated method stub
    if(target.getSenses().size()>1)
    {
      Classifier c;
      if(this.getValue("classifier")==null)
        this.addParameters("classifier:gannuCF.classifiers.NaiveBayes;");
      File f=new File("./data/classifiers/"+this.dict.getCompleteName()+"/"+Dictionary.normalizeLemmaforFile(target.getLemma())+"_"+this.getValue("classifier")+".gcl");
      if(f.exists())
      {
        c=(Classifier)Util.loadObject(f);
      }
      else
      {
       
        c=(Classifier)Class.forName(this.getValue("classifier")).newInstance();
        c.addParameters(this.getParameterString());
        c.train(target);
        File dir=new File("./data/classifiers/"+this.dict.getCompleteName()+"/");
        if(!dir.exists())
          dir.mkdirs();
        Util.writeObject(f, c);
      }
      ArrayList<String> sample=new ArrayList<String>(window.size());     
      for(AmbiguousWord word:window)
      {
        sample.add(word.getLemma());       
      }
      float w[]=c.classify(sample);
      for(int j=0;j<target.getSenses().size();j++)
      {
        ArrayList<String> dwords=new ArrayList<String>(window.size());
        for(AmbiguousWord word:window)
        {
View Full Code Here

Examples of moa.classifiers.Classifier

    @Override
    public void resetLearningImpl() {
      try {
      lock.acquire();   
          this.ensemble = new ArrayDeque<ClassifierInstance>(ensembleSizeOption.getValue());
          Classifier baseLearner = (Classifier) getPreparedClassOption(this.baseLearnerOption);
          baseLearner.resetLearning();
      } catch (InterruptedException e) {
      e.printStackTrace();
    } finally {
      lock.release();
    }
View Full Code Here

Examples of moa.classifiers.Classifier

    @Override
    public void trainOnInstanceImpl(Instance inst) {
      try {
      lock.acquire();
      //Get a new classifier
        Classifier newClassifier = ((Classifier) getPreparedClassOption(this.baseLearnerOption)).copy();
        ensemble.add(new ClassifierInstance(newClassifier));
       
        //If we have too many classifiers
        while(ensemble.size() > ensembleSizeOption.getValue())
          ensemble.pollFirst();
View Full Code Here

Examples of org.apache.mahout.common.Classifier

    FileSystem fs = FileSystem.get(conf);

    log.info("Loading model from: {}", modelPaths);

    Model model;
    Classifier classifier;

    String classifierType = (String) cmdLine.getValue(typeOpt);

    if (classifierType.equalsIgnoreCase("bayes")) {
      log.info("Testing Bayes Classifier");
      model = new BayesModel();
      classifier = new BayesClassifier();
    } else if (classifierType.equalsIgnoreCase("cbayes")) {
      log.info("Testing Complementary Bayes Classifier");
      model = new CBayesModel();
      classifier = new CBayesClassifier();
    } else {
      throw new IllegalArgumentException("Unrecognized classifier type: " + classifierType);
    }

    SequenceFileModelReader.loadModel(model, fs, modelPaths, conf);

    log.info("Done loading model: # labels: {}", model.getLabels().size());

    log.info("Done generating Model");

    String defaultCat = "unknown";
    if (cmdLine.hasOption(defaultCatOpt)) {
      defaultCat = (String) cmdLine.getValue(defaultCatOpt);
    }

    String encoding = "UTF-8";
    if (cmdLine.hasOption(encodingOpt)) {
      encoding = (String) cmdLine.getValue(encodingOpt);
    }
    //Analyzer analyzer = null;
    //if (cmdLine.hasOption(analyzerOpt)) {
      //String className = (String) cmdLine.getValue(analyzerOpt);
      //Class clazz = Class.forName(className);
      //analyzer = (Analyzer) clazz.newInstance();
    //}
    //if (analyzer == null) {
    //  analyzer = new StandardAnalyzer();
    //}
    int gramSize = 1;
    if (cmdLine.hasOption(gramSizeOpt)) {
      gramSize = Integer.parseInt((String) cmdLine
          .getValue(gramSizeOpt));

    }

    String testDirPath = (String) cmdLine.getValue(dirOpt);
    File dir = new File(testDirPath);
    File[] subdirs = dir.listFiles();

    ResultAnalyzer resultAnalyzer = new ResultAnalyzer(model.getLabels(), defaultCat);

    if (subdirs != null) {
      for (File subdir : subdirs) {

        String correctLabel = subdir.getName().split(".txt")[0];
        BufferedReader fileReader = new BufferedReader(new InputStreamReader(
            new FileInputStream(subdir.getPath()), encoding));
        try {
          String line;
          while ((line = fileReader.readLine()) != null) {
 
            Map<String, List<String>> document = Model.generateNGrams(line, gramSize);
            for (Map.Entry<String, List<String>> stringListEntry : document.entrySet()) {
              List<String> strings = stringListEntry.getValue();
              ClassifierResult classifiedLabel = classifier.classify(model,
                  strings.toArray(new String[strings.size()]),
                  defaultCat);
              resultAnalyzer.addInstance(correctLabel, classifiedLabel);
            }
          }
View Full Code Here

Examples of org.dmd.util.parsing.Classifier

 
  public void run(){
        BufferedReader  in = new BufferedReader(new InputStreamReader(System.in));
        String          currLine    = null;
        Classifier    classifier   = new Classifier();
        TokenArrayList  tokens     = null;
//        MvcDoc      mvcdoc    = new MvcDoc();
       
       
        if (autogen.booleanValue()){
         
          for(ConfigVersion version: configFinder.getVersions().values()){
            ConfigLocation loc = version.getLatestVersion();
           
//                DebugInfo.debug(loc.toString());
           
            if (!loc.isFromJAR()){
              // Wasn't in a jar, so try to generate
//                  DebugInfo.debug("Config is not from JAR - generating: " + loc.getConfigName());
              generateFromConfig(version);
            }
           
            aggregateManager.mergeDefinitions(defManager);
          }
         
          System.out.println("DONE");
         
      try {
        if (docdir.length() > 0){
          if (workspace.length() > 0)
              docGenerator.dumpDocumentation(workspace.toString() + "/" + docdir.toString());
          else
            docGenerator.dumpDocumentation(docdir.toString());
        }
      } catch (IOException e) {
        System.err.println(e.toString());
        e.printStackTrace();
        System.exit(1);
      }

          System.exit(0);
        }
       
       
        System.out.println("\nmvw generator - enter the name of a Model View Whatever config\n");
        System.out.println("Enter ? for a list of configs...\n\n");
       
        while(true){
            try{
              String s = in.readLine();
              if (s == null)
                return;
             
                currLine = s.trim();

                if (currLine.length() == 0)
                    continue;
               
                tokens = classifier.classify(currLine, false);
               
                if (tokens.size() == 0)
                  continue;
               
                ConfigVersion currConfig = configFinder.getConfig(tokens.nth(0).getValue());
View Full Code Here

Examples of org.eclipse.uml2.uml.Classifier

   
    for(Generalization oGeneralization : in_oContextClass.getGeneralizations())
    {
      if(oGeneralization.getGeneral() != null)
      {
        Classifier oClassifier = oGeneralization.getGeneral();
        if(oClassifier instanceof org.eclipse.uml2.uml.Class)
        {
          // TODO Mehrvererbung muss noch einbeziehen von welcher Superklasse aus die Zustandsmaschine defineirt wurde
          return getContextEffectSpecificationHelper(in_oOperation, (org.eclipse.uml2.uml.Class)oClassifier);
        }
View Full Code Here

Examples of org.geotools.filter.function.Classifier

    SimpleFeature feature = null;
    // classiferExample start
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    Function classify = ff.function("Quantile", ff.property("name"), ff.literal(2));
   
    Classifier groups = (Classifier) classify.evaluate(collection);
    // classiferExample end
    // classiferExample2 start
    groups.setTitle(0, "Group A");
    groups.setTitle(1, "Group B");
    // classiferExample2 end
   
    // classiferExample3 start
    // groups is a classifier with "Group A" and "Group B"
    Function sort = ff.function("classify", ff.property("name"), ff.literal(groups));
    int slot = (Integer) sort.evaluate(feature);
   
    System.out.println(groups.getTitle(slot)); // ie. "Group A"
    // classiferExample3 end
}
View Full Code Here

Examples of org.goai.classification.api.Classifier

     * 2. Create classification map (classification problem)
     * 3. Run classifier evaluator
     */
    public void run() {
        // create classifier instance
        Classifier classifier =  createClassifier(classifierSrc);
        // create classification problem
        ClassificationProblem<ITEM_TYPE, CLASS_TYPE> classificationProblem = createClassificationProblem(problemSrc);
       
        // create and run classifier evaluation for given problem
        ClassifierEvaluator<ITEM_TYPE, CLASS_TYPE> evaluator = new ClassifierEvaluator<>();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.