Example #1
0
  // compute the histogram matrix
  public void ComputeHistogram() {
    BagOfPatterns bop = new BagOfPatterns();

    bop.representationType = RepresentationType.Polynomial;

    bop.slidingWindowSize = slidingWindowSize;

    bop.representationType = RepresentationType.Polynomial;
    bop.innerDimension = innerDimension;
    bop.alphabetSize = alphabetSize;
    bop.polyDegree = degree;

    H = bop.CreateWordFrequenciesMatrix(X);
    numPatterns = H.getDimColumns();

    for (int i = 0; i < H.getDimRows(); i++)
      for (int j = 0; j < H.getDimColumns(); j++)
        if (H.get(i, j) == 0) {
          // H.set(i, j, GlobalValues.MISSING_VALUE);
        }

    Logging.println("Histogram Sparsity: " + H.GetSparsityRatio(), LogLevel.DEBUGGING_LOG);
  }