コード例 #1
0
  private void computeValueHistograms(
      RDFDataSource source, RDFDataDescriptor desc, RbcAttribute targetAttribute)
      throws RDFDatabaseException {
    int numOfClassLabels = targetAttribute.getDomainSize();
    int numOfAttributeValues = mAttribute.getDomainSize();

    if (mValueHistograms == null) {
      mValueHistograms = CollectionUtil.makeList();
      for (int j = 0; j < numOfClassLabels; j++) {
        Map<URI, Double> histogram = CollectionUtil.makeMap();
        mValueHistograms.add(histogram);
      }
    }

    for (int j = 0; j < numOfClassLabels; j++) {
      Map<URI, Double> valueHistogram = mValueHistograms.get(j);
      for (int k = 0; k < numOfAttributeValues; k++) {
        URI key = mCut.get().get(k);
        if (valueHistogram.containsKey(key)) continue;

        SuffStatQueryParameter queryParam =
            new SuffStatQueryParameter(desc.getTargetType(), targetAttribute, j, mAttribute, k);
        ISufficentStatistic tempSuffStat = source.getBernoulliSufficientStatistic(queryParam);
        double valueCount = tempSuffStat.getValue().intValue();
        valueHistogram.put(key, valueCount);

        // System.out.println(queryParam);
        // System.out.println(tempSuffStat.getValue());
      }
    }
  }
コード例 #2
0
 public IterativeBestScore() {
   mList = CollectionUtil.makeList();
   mCurrentDepth = 0;
   mCurrentMaxDepth = 2;
 }
コード例 #3
0
 public AggregatedInstances(List<URI> instanceURIs) {
   mURIs = instanceURIs;
   mInstances = CollectionUtil.makeList();
 }