Package org.fnlp.ml.classifier.linear

Examples of org.fnlp.ml.classifier.linear.Linear.saveTo()


      OnlineTrainer trainer = new OnlineTrainer(ms, update,l, factory.getFeatureSize(), 50,0.005f);
      Linear pclassifier = trainer.train(instset,instset);
      pipe.removeTargetPipe();
      pclassifier.setPipe(pipe);
      factory.setStopIncrement(true);
      pclassifier.saveTo(modelFile);
    }
 
}
View Full Code Here


    System.out.print("Done");
  }

  public void optimizeDep(String file) throws LoadModelException, IOException {
    Linear cl= Linear.loadFrom(file)
    cl.saveTo(file+".bak");
    removeZero(cl);
    cl.saveTo(file);
    System.out.print("Done");
  }
View Full Code Here

  public void optimizeDep(String file) throws LoadModelException, IOException {
    Linear cl= Linear.loadFrom(file)
    cl.saveTo(file+".bak");
    removeZero(cl);
    cl.saveTo(file);
    System.out.print("Done");
  }

}
View Full Code Here

    OnlineTrainer trainer = new OnlineTrainer(msolver, update, loss, af.size(), round,
        c);

    Linear classify = trainer.train(train, test);
    String modelFile = path+".m.gz";
    classify.saveTo(modelFile);

    long end = System.currentTimeMillis();
    System.out.println("Total Time: " + (end - start));
    System.out.println("End!");
    (new File(modelFile)).deleteOnExit();
View Full Code Here

    pp.removeTargetPipe();
    pclassifier.setPipe(pp);
    af.setStopIncrement(true);
   
    //将分类器保存到模型文件
    pclassifier.saveTo(modelFile)
    pclassifier = null;
   
    //从模型文件读入分类器
    Linear cl =Linear.loadFrom(modelFile);
   
View Full Code Here

    pp.removeTargetPipe();
    pclassifier.setPipe(pp);
    af.setStopIncrement(true);
   
    //将分类器保存到模型文件
    pclassifier.saveTo(linearModelFile)
    pclassifier = null;
   
    //从模型文件读入分类器
    Linear cl =Linear.loadFrom(linearModelFile);
   
View Full Code Here

    pp.removeTargetPipe();
    pclassifier.setPipe(pp);
    af.setStopIncrement(true);
   
    //将分类器保存到模型文件
    pclassifier.saveTo(modelFile)
    pclassifier = null;
   
    //从模型文件读入分类器
    Linear cl =Linear.loadFrom(modelFile);
   
View Full Code Here

    solver = null;
    loss = null;
    trainer = null;
    System.out.println();
    factory.setStopIncrement(true);
    models.saveTo(modelfile);

  }


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