test_class.declarator: scoreSampling
test_class.modifier: private
test_class.original_string: private SimilarityScoreSampling scoreSampling;
test_class.type: SimilarityScoreSampling
test_class.var_name: scoreSampling
test_class.file: phenol-core/src/test/java/org/monarchinitiative/phenol/ontology/scoredist/SimilarityScoreSamplingTest.java
test_class.identifier: SimilarityScoreSamplingTest
test_class.superclass: extends VegetableOntologyTestBase
test_case.body: @Test
    public void test() {
      // TODO: this logic should be moved into the library
      Map<TermId, Integer> recipeToId = new HashMap<>();
      Map<TermId, Set<TermId>> labels = new HashMap<>();
      int nextId = 1;
      for (VegetableRecipeAnnotation a : recipeAnnotations) {
        if (!recipeToId.containsKey(a.getLabel())) {
          recipeToId.put(a.getLabel(), nextId++);
        }
        TermId recipeId = a.getTermId();
        if (!labels.containsKey(recipeId)) {
          labels.put(recipeId, new HashSet<>());
        }
        final Set<TermId> termIds = labels.get(recipeId);
        termIds.add(a.getTermId());
      }
  
      Map<Integer, ScoreDistribution> samplingResult = scoreSampling.performSampling();
      assertEquals(1, samplingResult.size());
      // todo add more testing of distribution
    }
test_case.class_method_signature: SimilarityScoreSamplingTest.test()
test_case.full_signature: @Test public void test()
test_case.identifier: test
test_case.invocations: containsKey getLabel put getLabel getTermId containsKey put get add getTermId performSampling assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(SimilarityScoreSampling.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(SimilarityScoreSampling.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.declarator: ontology
focal_class.modifier: private final
focal_class.original_string: private final Ontology ontology;
focal_class.type: Ontology
focal_class.var_name: ontology
focal_class.declarator: similarity
focal_class.modifier: private final
focal_class.original_string: private final Similarity similarity;
focal_class.type: Similarity
focal_class.var_name: similarity
focal_class.declarator: options
focal_class.modifier: private final
focal_class.original_string: private final ScoreSamplingOptions options;
focal_class.type: ScoreSamplingOptions
focal_class.var_name: options
focal_class.declarator: labels
focal_class.modifier: private final
focal_class.original_string: private final Map<TermId, ? extends Collection<TermId>> labels;
focal_class.type: Map<TermId, ? extends Collection<TermId>>
focal_class.var_name: labels
focal_class.file: phenol-core/src/main/java/org/monarchinitiative/phenol/ontology/scoredist/SimilarityScoreSampling.java
focal_class.identifier: SimilarityScoreSampling
focal_class.class_method_signature: SimilarityScoreSampling.SimilarityScoreSampling(Ontology ontology, Similarity similarity, ScoreSamplingOptions options, Map<TermId, ? extends Collection<TermId>> labels)
focal_class.full_signature: public  SimilarityScoreSampling(Ontology ontology, Similarity similarity, ScoreSamplingOptions options, Map<TermId, ? extends Collection<TermId>> labels)
focal_class.identifier: SimilarityScoreSampling
focal_class.modifiers: public
focal_class.parameters: (Ontology ontology, Similarity similarity, ScoreSamplingOptions options, Map<TermId, ? extends Collection<TermId>> labels)
focal_class.signature:  SimilarityScoreSampling(Ontology ontology, Similarity similarity, ScoreSamplingOptions options, Map<TermId, ? extends Collection<TermId>> labels)
focal_class.class_method_signature: SimilarityScoreSampling.performSampling()
focal_class.full_signature: public Map<Integer, ScoreDistribution> performSampling()
focal_class.identifier: performSampling
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<Integer, ScoreDistribution>
focal_class.signature: Map<Integer, ScoreDistribution> performSampling()
focal_class.class_method_signature: SimilarityScoreSampling.performSamplingForTermCount(Map<TermId, ? extends Collection<TermId>> labels, int numTerms)
focal_class.full_signature: public ScoreDistribution performSamplingForTermCount(Map<TermId, ? extends Collection<TermId>> labels, int numTerms)
focal_class.identifier: performSamplingForTermCount
focal_class.modifiers: public
focal_class.parameters: (Map<TermId, ? extends Collection<TermId>> labels, int numTerms)
focal_class.return: ScoreDistribution
focal_class.signature: ScoreDistribution performSamplingForTermCount(Map<TermId, ? extends Collection<TermId>> labels, int numTerms)
focal_class.class_method_signature: SimilarityScoreSampling.performComputation(TermId objectId, Collection<TermId> terms, int numTerms)
focal_class.full_signature: private ObjectScoreDistribution performComputation(TermId objectId, Collection<TermId> terms, int numTerms)
focal_class.identifier: performComputation
focal_class.modifiers: private
focal_class.parameters: (TermId objectId, Collection<TermId> terms, int numTerms)
focal_class.return: ObjectScoreDistribution
focal_class.signature: ObjectScoreDistribution performComputation(TermId objectId, Collection<TermId> terms, int numTerms)
focal_class.class_method_signature: SimilarityScoreSampling.sampleScoreCumulativeRelFreq(Collection<TermId> terms, int numTerms, int numIterations)
focal_class.full_signature: private TreeMap<Double, Double> sampleScoreCumulativeRelFreq(Collection<TermId> terms, int numTerms, int numIterations)
focal_class.identifier: sampleScoreCumulativeRelFreq
focal_class.modifiers: private
focal_class.parameters: (Collection<TermId> terms, int numTerms, int numIterations)
focal_class.return: TreeMap<Double, Double>
focal_class.signature: TreeMap<Double, Double> sampleScoreCumulativeRelFreq(Collection<TermId> terms, int numTerms, int numIterations)
focal_class.class_method_signature: SimilarityScoreSampling.selectRandomElements(List<E> src, int count)
focal_class.full_signature: private static List<E> selectRandomElements(List<E> src, int count)
focal_class.identifier: selectRandomElements
focal_class.modifiers: private static
focal_class.parameters: (List<E> src, int count)
focal_class.return: List<E>
focal_class.signature: List<E> selectRandomElements(List<E> src, int count)
focal_method.body: public Map<Integer, ScoreDistribution> performSampling() {
      Map<Integer, ScoreDistribution> result = new HashMap<>();
      for (int numTerms = options.getMinNumTerms();
          numTerms <= options.getMaxNumTerms();
          ++numTerms) {
        result.put(numTerms, performSamplingForTermCount(labels, numTerms));
      }
      return result;
    }
focal_method.class_method_signature: SimilarityScoreSampling.performSampling()
focal_method.full_signature: public Map<Integer, ScoreDistribution> performSampling()
focal_method.identifier: performSampling
focal_method.invocations: getMinNumTerms getMaxNumTerms put performSamplingForTermCount
focal_method.modifiers: public
focal_method.parameters: ()
focal_method.return: Map<Integer, ScoreDistribution>
focal_method.signature: Map<Integer, ScoreDistribution> performSampling()