Package com.yahoo.labs.taxomo.util

Examples of com.yahoo.labs.taxomo.util.StateSet


   
    File modelFile = new File(jsapResult.getString("model-file"));
    File taxoFile = new File(jsapResult.getString("taxonomy-file"));
    int numSequences = jsapResult.getInt("num-sequences");
   
    StateSet taxo = new StateSet( modelFile, new Taxonomy(taxoFile) );
    Model hmm = new Model(modelFile, taxo);
   
    for( int i=0; i<numSequences; i++) {
      ArrayList<String> seq = hmm.sequence();
      System.out.println(seq2str(seq));
View Full Code Here


   *
   * @param aCandidate
   * @return
   */
  int[] symbol2stateNum(Candidate aCandidate) {
    StateSet taxo = new StateSet(tree, aCandidate);
    int[] symbol2localState = taxo.getSymbolNum2StateNum();
    int[] symbol2globalState = new int[symbol2localState.length];

    for (int symbol = 0; symbol < symbol2globalState.length; symbol++) {
      symbol2globalState[symbol] = state2num.getInt(taxo.getState(symbol2localState[symbol]).name());
    }
    return symbol2globalState;
  }
View Full Code Here

      logger.setLevel(Level.DEBUG);
    }

    File modelFile = new File(jsapResult.getString("model-file"));
    File taxoFile = new File(jsapResult.getString("taxonomy-file"));
    StateSet stateSet = new StateSet(modelFile, new Taxonomy(taxoFile));
    Model hmm = new Model(modelFile, stateSet);

    if (jsapResult.userSpecified("input-file")) {
      File inputFile = new File(jsapResult.getString("input-file"));
      BufferedReader br = new BufferedReader(new FileReader(inputFile));
View Full Code Here

    }
  }

  void doSlowEvaluation(Candidate candidate) {
    loggerPrintIterationNumber(candidate);
    StateSet taxo = new StateSet(tree, candidate);
    FrequencyTable frequencyTable = new FrequencyTable(symbolTransitions, taxo);
    double perf = frequencyTable.sumLogProb();
    logger.debug("LogProb (slow evaluation) = " + perf);
    candidate.setLogProbability(perf);
    results.put(candidate, new Integer(iterationNumber++));
View Full Code Here

    results.put(candidate, new Integer(iterationNumber++));
  }

  void debugDoSlowEvaluation(Candidate candidate) {
    loggerPrintIterationNumber(candidate);
    StateSet taxo = new StateSet(tree, candidate);
    FrequencyTable frequencyTable = new FrequencyTable(symbolTransitions, taxo);
    double perf = frequencyTable.sumLogProb();
    logger.debug("LogProb (slow evaluation, debug only) = " + perf);
  }
View Full Code Here

        winner = resultsSorted[i];
        break;
      }
    }
       
    StateSet taxo = new StateSet(tree, winner);
    FrequencyTable frequencyTable = new FrequencyTable(symbolTransitions, taxo);
    Model hmm = new Model(frequencyTable, taxo);
    return hmm;
  }
View Full Code Here

  Model model1;

  @Before
  public void setUp() throws Exception {
    set1 = new StateSet(UtilTest.class.getResourceAsStream(MODELFILE1), new Taxonomy(TREEFILE1, UtilTest.class.getResourceAsStream(TREEFILE1)));
    model1 = new Model(UtilTest.class.getResourceAsStream(MODELFILE1), set1);

    assertEquals(5, model1.nbStates());
  }
View Full Code Here

TOP

Related Classes of com.yahoo.labs.taxomo.util.StateSet

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.