Examples of train()


Examples of org.data2semantics.proppred.predictors.SVMPropertyPredictor.train()

    // Create a new SVM property predictor
    SVMPropertyPredictor pred = new SVMPropertyPredictor();
   
    // Train on the first 100 instances
    pred.train(dataset, instances.subList(0, 100), labels.subList(0, 100), blackLists);
   
    // Predict on the rest, note that we also need the blacklists here, since the labels already occur in the test set as well,
    // because we do not use an unlabeled test set, which we would use in an application setting.
    List<Value> predictions = pred.predict(dataset, instances.subList(100,instances.size()), blackLists);
   
View Full Code Here

Examples of org.encog.ensemble.GenericEnsembleML.train()

      GenericEnsembleML newML = new GenericEnsembleML(mlFactory.createML(dataSetFactory.getInputData().getInputSize(), dataSetFactory.getInputData().getIdealSize()),mlFactory.getLabel());
      do {
        mlFactory.reInit(newML.getMl());
        MLTrain train = trainFactory.getTraining(newML.getMl(), thisSet);
        newML.setTraining(train);
        newML.train(targetAccuracy,verbose);
      } while (newML.getError(testset) > selectionError);
      double newWeight = getWeightedError(newML,thisSet);
      members.add(newML);
      weights.add(newWeight);
      D = updateD(newML,thisSet,D);
View Full Code Here

Examples of org.fnlp.app.tc.TextClassifier.train()

   
    TextClassifier tc = new TextClassifier();
    System.out.println("训练模型");
    //用不同的Reader读取相应格式的文件
    Reader reader = new FileReader(trainDataPath,"UTF-8",".data");
    tc.train(reader, modelFile);
    /**
     * 分类器使用
     */
    String str = "韦德:不拿冠军就是失败 詹皇:没拿也不意味失败";
    String label = (String) tc.classify(str).getLabel(0);
View Full Code Here

Examples of org.fnlp.ml.classifier.bayes.BayesTrainer.train()

    System.out.print("..Spliting complete!\n");

    System.out.print("Training...\n");
    af.setStopIncrement(true);
    BayesTrainer trainer=new BayesTrainer();
    BayesClassifier classifier= (BayesClassifier) trainer.train(trainset);
    System.out.print("..Training complete!\n");
    System.out.print("Saving model...\n");
    classifier.saveTo(bayesModelFile)
    classifier = null;
    System.out.print("..Saving model complete!\n");
View Full Code Here

Examples of org.fnlp.ml.classifier.hier.PATrainer.train()

    BaseGenerator featureGen = new BaseGenerator();
    ZeroOneLoss loss = new ZeroOneLoss();
    Inferencer msolver = new MultiLinearMax(featureGen, al, null,2);

    PATrainer trainer = new PATrainer(msolver, featureGen, loss, round,c, null);
    Linear pclassifier = trainer.train(train, null);
   
    String modelFile = path+".m.gz";
    pclassifier.saveTo(modelFile);

    long end = System.currentTimeMillis();
View Full Code Here

Examples of org.fnlp.ml.classifier.linear.OnlineTrainer.train()

    }else{
      trainer = new OnlineTrainer(inference, update, loss,
          features.size(), iterNum, c);
    }

    cl = trainer.train(trainSet, testSet);

    if(cl!=null&&newmodel!=null)
      saveTo(newmodel);
    else
      saveTo(model);
View Full Code Here

Examples of org.fnlp.nlp.parser.dep.train.JointParerTrainer.train()


    JointParerTrainer trainer = new JointParerTrainer(model);
    int maxite = 100;
    float c = 0.01f;
    trainer.train(allfile, maxite, c);
   
    float thres = 0.00001f;
    ModelOptimization op = new ModelOptimization(thres);
    op.optimizeDep(model);
   
View Full Code Here

Examples of org.fnlp.train.pos.POSTrain.train()

    pos.model = model;
    pos.train = trainfile;
    pos.templateFile = templates;
    pos.iterNum = 50;
    pos.c = 0.01f;
    pos.train();   
   

    eval(pos);   
   
    /////////////////////////////////////////
View Full Code Here

Examples of org.jasen.core.engine.JasenTrainer.train()

                if(command.toLowerCase().trim().startsWith("load")) {
                    trainer.setLoad(true);
                }

                trainer.init();
                trainer.train();
             }
        }
        catch (Exception e)
        {
            e.printStackTrace ();
View Full Code Here

Examples of org.mitre.jcarafe.jarafe.JarafeMETrainer.train()

    {
      Set<String> featureSet = currentTrainingInstance.getFeatureSet();
      List<String> featureList = new ArrayList<String>(featureSet);
      trainer.addTrainingInstance(currentTrainingInstance.getExpectedValue(), featureList);
    }
    String model = trainer.train();
    //For testing: print out the model as a string -Alex Yeh

    writeModelToFile(model, trainingDirectory, "i2b2.model");

    // decoding
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.