/** * Given a list of useless features, prune the entries from the lexicon. * @param uselessfeatures */ protected void pruneLexicon(int[] uselessfeatures) { lexicon.discardPrunedFeatures(uselessfeatures); for (Feature f : this.uselessFeatureNames) { if (lexicon.contains(f)) { throw new RuntimeException("The features were not correctly removed from the lexicon : " + f.getStringIdentifier()); } } }
/** * Check it out when done, make sure it worked. */ protected void pruneLexicon(int[] uselessfeatures) { super.pruneLexicon(uselessfeatures); for (Feature f : this.uselessFeatureNames) { if (lexicon.contains(f)) { throw new RuntimeException("The features were not correctly removed from the lexicon : " + f.getStringIdentifier()); } } }
if (newLabelLexicon.contains(f)) { key = newLabelLexicon.lookup(f); score = score(exampleFeatures, exampleValues, key);
/** * Helper method for methods like {@link #childLexiconLookup(DiscreteConjunctiveFeature,int)} * that actually does the work of looking up the child feature and updating its parent counts. * * @param f The feature to look up. * @param label The label of the example containing this feature, or -1 if we aren't doing per * class feature counting. **/ protected void incrementParentCounts(Feature f, int label) { int index = f.childLexiconLookup(this, label); // Increment count while preserving sign to indicate mark for removal. if (parents.get(index) == 0) parents.set(index, parentLexicon.contains(f) ? -1 : 1); else if (parents.get(index) > 0) parents.increment(index); else parents.decrement(index); }
if (labelLexicon.contains(f)) { key = labelLexicon.lookup(f); score =
if (labelLexicon.contains(f)) { key = labelLexicon.lookup(f); LinearThresholdUnit ltu = (LinearThresholdUnit) network.get(key);
(short) labeler.allowableValues().length); if (labelLexicon.contains(f)) { int key = labelLexicon.lookup(f); score =
(short) labeler.allowableValues().length); if (labelLexicon.contains(f)) { int key = labelLexicon.lookup(f); LinearThresholdUnit ltu = (LinearThresholdUnit) network.get(key);