Package org.apache.ctakes.ytex.kernel.model

Examples of org.apache.ctakes.ytex.kernel.model.FeatureRank


          evaluation = d.getMutualInformation(yEntropy);
        } else {
          evaluation = d.getInfoGain();
        }
        if (evaluation > 1e-3) {
          FeatureRank r = new FeatureRank(fe,
              conceptJointDistro.getKey(), evaluation);
          featureRankList.add(r);
        }
      }
    }
View Full Code Here


    this.classifierEvaluationDao.saveFeatureEvaluation(fe, features);
    if (!bAll) {
      // save the parent-child links
      for (Map.Entry<FeatureRank, Set<FeatureRank>> childParentEntry : childParentMap
          .entrySet()) {
        FeatureRank child = childParentEntry.getKey();
        for (FeatureRank parent : childParentEntry.getValue()) {
          FeatureParentChild parchd = new FeatureParentChild();
          parchd.setFeatureRankParent(parent);
          parchd.setFeatureRankChild(child);
          this.classifierEvaluationDao.saveFeatureParentChild(parchd);
View Full Code Here

    Set<String> childConcepts = new HashSet<String>();
    addSubtree(childConcepts, cr);
    for (String childConceptId : childConcepts) {
      // only add the child to the map if it exists in the corpus
      if (conceptICMap.containsKey(childConceptId)) {
        FeatureRank chd = mapChildConcept.get(childConceptId);
        // create the child if it does not already exist
        if (chd == null) {
          chd = new FeatureRank(fe, childConceptId, 0d);
          mapChildConcept.put(childConceptId, chd);
        }
        // give the child the mutual info of the parent with the highest
        // score
        double rawEvaluation = conceptRawEvalMap
            .containsKey(childConceptId) ? conceptRawEvalMap
            .get(childConceptId) : minInfo;
        double imputedEvaluation = (imputeWeight * parentConcept
            .getEvaluation())
            + ((1 - imputeWeight) * rawEvaluation);
        if (chd.getEvaluation() < imputedEvaluation) {
          chd.setEvaluation(imputedEvaluation);
        }
        // add the relationship to the parentChildMap
        // do this only if the childParentMap is not null
        if (childParentMap != null) {
          Set<FeatureRank> parents = childParentMap.get(chd);
View Full Code Here

        conceptFreq.size());
    // update information content
    double log2inv = -1d / Math.log(2);
    for (Map.Entry<String, Double> cfreq : conceptFreq.entrySet()) {
      if (cfreq.getValue() > 0) {
        FeatureRank featureRank = new FeatureRank(eval, cfreq.getKey(),
            log2inv * Math.log(cfreq.getValue() / totalFreq));
        featureRankList.add(featureRank);
      }
    }
    // the rank is irrelevant, but rank the features anyways
View Full Code Here

      cr.setIntrinsicInfoContent(ic);
      if (ic > maxIC)
        maxIC = ic;
      if (log.isDebugEnabled())
        log.debug(icInfo.getConcept().getConceptID() + "=" + ic);
      listFeatureRank.add(new FeatureRank(fe, icInfo.getConcept()
          .getConceptID(), ic, depthArray[icInfo.getConcept()
          .getNodeIndex()]));
    }
    cg.setDepthMax(maxDepth);
    cg.setIntrinsicICMax(maxIC);
View Full Code Here

    List<FeatureRank> featureRanks = new ArrayList<FeatureRank>(
        rankedAttributes.length);
    for (int i = 0; i < rankedAttributes.length; i++) {
      int index = (int) rankedAttributes[i][0];
      double eval = rankedAttributes[i][1];
      FeatureRank r = new FeatureRank();
      r.setFeatureEval(fe);
      r.setFeatureName(inst.attribute(index).name());
      r.setRank(i + 1);
      r.setEvaluation(eval);
      featureRanks.add(r);
    }
    // delete this feature evaluation if it exists
    classifierEvaluationDao.deleteFeatureEvaluation(corpusName,
        featureSetName, label, fe.getEvaluationType(),
View Full Code Here

TOP

Related Classes of org.apache.ctakes.ytex.kernel.model.FeatureRank

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.