Package de.bwaldvogel.liblinear

Examples of de.bwaldvogel.liblinear.Model


      }
      final PrintStream out = System.out;
      final PrintStream err = System.err;
      System.setOut(NoPrintStream.NO_PRINTSTREAM);
      System.setErr(NoPrintStream.NO_PRINTSTREAM);
      Model model = Linear.train(problem, parameter);
      System.setOut(err);
      System.setOut(out);
      problem = null;
      wmodel = model.getFeatureWeights();
      labels = model.getLabels();
      nr_class = model.getNrClass();
      nr_feature = model.getNrFeature();
      if (!saveInstanceFiles) {
        getFile(".ins").delete();
      }
    } catch (OutOfMemoryError e) {
      throw new LibException("Out of memory. Please increase the Java heap size (-Xmx<size>). ", e);
View Full Code Here


      int topAttributesNumber) throws IOException {
    // load the model + the lexicon
    // try to see if we can get a list of the best scores from the model
    // works only for liblinear
    Lexicon lexicon = new Lexicon(lexiconF);
    Model liblinearModel = Model.load(new File(modelPath));
    double[] weights = liblinearModel.getFeatureWeights();
    // dump all the weights
    int numClasses = liblinearModel.getNrClass();
    int numFeatures = liblinearModel.getNrFeature();

    Map<Integer, String> invertedAttributeIndex = lexicon
        .getInvertedIndex();

    Map<String, WeightedAttributeQueue> topAttributesPerLabel = new HashMap<String, WeightedAttributeQueue>(
View Full Code Here

      int topAttributesNumber) throws IOException {
    // load the model + the lexicon
    // try to see if we can get a list of the best scores from the model
    // works only for liblinear
    Lexicon lexicon = new Lexicon(lexiconF);
    Model liblinearModel = Model.load(new File(modelPath));
    double[] weights = liblinearModel.getFeatureWeights();
    // dump all the weights
    int numClasses = liblinearModel.getNrClass();
    int numFeatures = liblinearModel.getNrFeature();

    Map<Integer, String> invertedAttributeIndex = lexicon
        .getInvertedIndex();

    Map<String, WeightedAttributeQueue> topAttributesPerLabel = new HashMap<String, WeightedAttributeQueue>(
View Full Code Here

TOP

Related Classes of de.bwaldvogel.liblinear.Model

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.