Examples of Taxonomy


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

    final int nClusters = jsapResult.getInt("clusters");
    final int clusteringIterations = jsapResult.getInt("passes");

    // Load tree
    File taxoFile = new File(jsapResult.getString("taxonomy-file"));
    Taxonomy tree = new Taxonomy(taxoFile);

    // Build initial candidate
    Candidate initialCandidate;
    if (jsapResult.userSpecified("init-explicit")) {
      initialCandidate = new Candidate(tree, Util.split(jsapResult.getString("init-explicit")), null, null);
View Full Code Here

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

   
    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

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

      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

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

      logger.setLevel(Level.DEBUG);
    }

    File inputFile = new File(jsapResult.getString("input-file"));
    File taxoFile = new File(jsapResult.getString("taxonomy-file"));
    Taxonomy tree = new Taxonomy(taxoFile);
    Candidate initialCandidate;

    if (jsapResult.userSpecified("init-explicit")) {
      initialCandidate = new Candidate(tree, Util.split(jsapResult.getString("init-explicit")), null, null);
View Full Code Here

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

  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

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

  Class<SearchStrategy> strategy;

  @Before
  public void setUp() throws Exception {
    taxo1 = new Taxonomy(TAXOFILE1, LearnModelTest.class.getResourceAsStream(TAXOFILE1));
    sym1 = new SymbolTransitionFrequencies(taxo1);
    sym1.processStream(LearnModelTest.class.getResourceAsStream(SEQFILE1));
    LearnModel.logger.setLevel(Level.ERROR);
    strategy = getStrategy(CloserToOrigin.class.getName());
  }
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.train.validation.Taxonomy

        // find all the taxa for the ancestors
        HashMap<String, Taxonomy> labeledTaxonMap = new HashMap<String, Taxonomy>();
        labeledTaxonMap.put(factory.getRoot().getTaxonomy().getHierLevel(), factory.getRoot().getTaxonomy());
        int pid = factory.getRoot().getTaxonomy().getTaxID();
        for ( int i = 1 ; i < resultFacade.getAncestors().size(); i++){
            Taxonomy tax = factory.getTaxonomy(resultFacade.getSeqName(), (String) resultFacade.getAncestors().get(i), pid, i);
            labeledTaxonMap.put(tax.getHierLevel(), tax);
            pid = tax.getTaxID();
        }


        List<ValidationClassificationResult> hitList = resultFacade.getRankAssignment();
        for ( ValidationClassificationResult curRankResult: hitList){
            String curRank = curRankResult.getBestClass().getTaxonomy().getHierLevel();
            // find the corresponding ancestor at the current rank
            Taxonomy matchingRankTaxon = labeledTaxonMap.get(curRank);
            if ( matchingRankTaxon == null) {  // no match rank found
                // System.err.println("no matching rank labeled taxon found for " + resultFacade.getSeqName() + " at " + curRank );
                continue;
            }
            HashSet<String> nodeNameSet = rankNodeMap.get(curRank);
            if ( nodeNameSet != null){
                  
                int bootstrap = (int)(curRankResult.getNumOfVotes()*100);
                //System.err.println( "rank: " + curRank + "\t" + matchingRankTaxon.getName() + "\t" + nodeNameSet.contains( matchingRankTaxon.getName()) + "\t" + bootstrap +"\t");
                if ( nodeNameSet.contains( matchingRankTaxon.getName())){  // TP or FN
                    for( int b = 0; b <= bootstrap; b++){
                        ((StatusCount)statusCountList.get(b).get(curRank)).incNumTP(1);
                    }
                    for( int b = bootstrap+1; b < statusCountList.size(); b++){
                        ((StatusCount)statusCountList.get(b).get(curRank)).incNumFN(1);
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.train.validation.Taxonomy

            HierarchyTree treex = nodeMap.get((String) seqx.getAncestors().get(seqx.getAncestors().size() - 1));
            for ( int j = i+1; j < seqList.size(); j++){
                LineageSequence seqy = seqList.get(j);
                HierarchyTree treey = nodeMap.get((String) seqy.getAncestors().get(seqy.getAncestors().size() - 1));
               
                Taxonomy lowestCommonAnc = findLowestCommonAncestor(treex, treey);              
                PairwiseAlignment result = PairwiseAligner.align(seqx.getSeqString().replaceAll("U", "T"), seqy.getSeqString().replaceAll("U", "T"), scoringMatrix, mode);
                double distance = dist.getDistance(result.getAlignedSeqj().getBytes(), result.getAlignedSeqi().getBytes(), 0);

                if ( show_alignment){
                    System.out.println(">\t" + seqx.getSeqName() + "\t" + seqy.getSeqName() + "\t" + String.format("%.3f", distance) + "\t" + lowestCommonAnc.getHierLevel());
                    System.out.println(result.getAlignedSeqi() + "\n");
                    System.out.println(result.getAlignedSeqj() + "\n");
                }
       
                ArrayList<Double> distList = distanceMap.get(lowestCommonAnc);
View Full Code Here

Examples of edu.msu.cme.rdp.classifier.train.validation.Taxonomy

        while(parent != null) {
            ancestory.add(parent);
            parent = parent.getParent();
        }
       
        Taxonomy lowestCommonAnc = ancestorx.get(ancestorx.size() -1).getTaxonomy();
        for ( int i = 2; i <= ancestorx.size() ; i++){
            if (  (ancestory.size() -i ) >= 0 ){
                if ( ancestorx.get( ancestorx.size() -i).getTaxonomy().equals(ancestory.get( ancestory.size() -i).getTaxonomy()) ){
                    lowestCommonAnc = ancestorx.get( ancestorx.size() -i).getTaxonomy();
                }
View Full Code Here

Examples of name.abuchen.portfolio.model.Taxonomy

    @Test
    public void testThatSecuritiesAreGroupedIntoClassifications()
    {
        Client client = new Client();

        Taxonomy taxonomy = new TaxonomyBuilder() //
                        .addClassification("debt") //
                        .addClassification("equity") //
                        .addClassification("realestate") //
                        .addTo(client);

        Security a = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1000) //
                        .assign(taxonomy, "debt") //
                        .addTo(client);

        Security c = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1200) //
                        .assign(taxonomy, "equity") //
                        .addTo(client);

        Security d = new SecurityBuilder() //
                        .addPrice("2010-01-01", 1200) //
                        .assign(taxonomy, "equity") //
                        .addTo(client);

        Portfolio portfolio = new PortfolioBuilder() //
                        .inbound_delivery(a, "2010-01-01", 1000000, 10000) //
                        .inbound_delivery(c, "2010-01-01", 1000000, 12000) //
                        .inbound_delivery(d, "2010-01-01", 1000000, 12000) //
                        .addTo(client);

        PortfolioSnapshot snapshot = PortfolioSnapshot.create(portfolio, new DateTime("2010-01-01").toDate());
        assertNotNull(snapshot);

        GroupByTaxonomy grouping = snapshot.groupByTaxonomy(taxonomy);

        AssetCategory debt = grouping.byClassification(taxonomy.getClassificationById("debt"));
        assertThat(debt.getValuation(), is(10000L));
        assertThat(debt.getPositions().size(), is(1));

        AssetCategory stocks = grouping.byClassification(taxonomy.getClassificationById("equity"));
        assertThat(stocks.getValuation(), is(24000L));
        assertThat(stocks.getPositions().size(), is(2));

        AssetCategory realEstate = grouping.byClassification(taxonomy.getClassificationById("realestate"));
        assertThat(realEstate, nullValue());
    }
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.