<code>
.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult k_map_estimation_result = 7;
</code>
333371
public com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult
      getKMapEstimationResult() {
    if (resultCase_ == 7) {
      return (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult) result_;
    }
    return com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KMapEstimationResult
        .getDefaultInstance();
  }
595070
public com.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig getKAnonymityConfig() {
    if (typeCase_ == 3) {
      return (com.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig) type_;
    }
    return com.google.privacy.dlp.v2.PrivacyMetric.KAnonymityConfig.getDefaultInstance();
  }
36010
protected java.util.Map captureStatistics()
    {
        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.entry(this, cclass
                        , "captureStatistics"
                            );

        java.util.Map statistics = super.captureStatistics();

        statistics.put("totalBytesWritten", Long.toString(totalBytesWritten));
        statistics.put("totalNumberOfFlushRequests", Long.toString(totalNumberOfFlushRequests));
        statistics.put("totalNumberOfLogBufferWrites", Long.toString(totalNumberOfLogBufferWrites));
        statistics.put("totalNumberOfThreadsFindingFullLogBuffers", Long.toString(totalNumberOfThreadsFindingFullLogBuffers));
        statistics.put("totalNumberOfFlusHelperWaits", Long.toString(totalNumberOfFlushHelperWaits));
        statistics.put("totalNumberOfLogCycles", Long.toString(totalNumberOfLogCycles));

        statistics.put("writeStalledMilliseconds", Long.toString(writeStalledMilliseconds));
        statistics.put("writeCopyingMilliseconds", Long.toString(writeCopyingMilliseconds));

        statistics.put("flushingMilliseconds", Long.toString(flushingMilliseconds));
        statistics.put("otherMilliseconds", Long.toString(otherMilliseconds));
        statistics.put("flushHelperWaitingMilliseconds", Long.toString(flushHelperWaitingMilliseconds));
        statistics.put("paddingStalledMilliseconds", Long.toString(paddingStalledMilliseconds));
        statistics.put("writeUpdateStatedMilliseconds", Long.toString(writeUpdateStateMilliseconds));

        statistics.put("logFullCheckpointsTriggered", Long.toString(logFullCheckpointsTriggered));
        statistics.put("uncheckedBytes", Long.toString(uncheckedBytes));
        statistics.put("uncheckedBytesUpToTruncatePoint", Long.toString(uncheckedBytesUpToMarkPoint));
        statistics.put("getLogFileSpaceLeft()", Long.toString(getLogFileSpaceLeft()));
        statistics.put("fileLogHeader.fileSize", Long.toString(fileLogHeader.fileSize));
        statistics.put("bufferFilePosition+nextFreeByteInLogBuffer", Long.toString(bufferFilePosition + nextFreeByteInLogBuffer));
        statistics.put("stalledForMultiPartID", Long.toString(stalledForMultiPartID));
        statistics.put("totalPaddingBytesWritten", Long.toString(totalPaddingBytesWritten));
        statistics.put("totalPaddingRecords", Long.toString(totalPaddingRecords));

        String histogram = "(0-15 >15) ";
        for (int n = 0; n < numberOfFlushWaitersFrequency.length; n++) {
            histogram += numberOfFlushWaitersFrequency[n] + " ";
            numberOfFlushWaitersFrequency[n] = 0;
        }
        statistics.put("numberOfFlushWaitersFrequency", histogram);

        histogram = "(0-15 >15) ";
        for (int n = 0; n < numberOfPagesWrittenFrequency.length; n++) {
            histogram += numberOfPagesWrittenFrequency[n] + " ";
            numberOfPagesWrittenFrequency[n] = 0;
        }
        statistics.put("numberOfPagesWritttenFrequency", histogram);

        totalBytesWritten = 0; // Number of bytes written so far.
        totalNumberOfFlushRequests = 0; // Number of times flush() was invoked.
        totalNumberOfLogBufferWrites = 0; // Number of times the logBuffer is has written.
        totalNumberOfThreadsFindingFullLogBuffers = 0;
        totalNumberOfFlushHelperWaits = 0; // Number of times the FlushHelper had nothing to do.
        totalNumberOfLogCycles = 0; // Number of times we have cycled through the log.

        writeStalledMilliseconds = 0;
        writeCopyingMilliseconds = 0;
        flushingMilliseconds = 0;
        otherMilliseconds = 0;
        flushHelperWaitingMilliseconds = 0;
        paddingStalledMilliseconds = 0;
        writeUpdateStateMilliseconds = 0;
        stalledForMultiPartID = 0;
        totalPaddingBytesWritten = 0;
        totalPaddingRecords = 0;

        if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled())
            trace.exit(this, cclass
                       , "captureStatistics"
                       , new Object[] { statistics }
                            );
        return statistics;
    }
754149
protected void estimateDensities(Relation<O> rel, KNNQuery<O> knnq, final DBIDs ids, WritableDataStore<double[]> densities) {
    final int dim = dimensionality(rel);
    final int knum = kmax + 1 - kmin;
    // Initialize storage:
    for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
      densities.put(iter, new double[knum]);
    }
    // Distribute densities:
    FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Computing densities", ids.size(), LOG) : null;
    double iminbw = (minBandwidth > 0.) ? 1. / (minBandwidth * scale) : Double.POSITIVE_INFINITY;
    for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
      KNNList neighbors = knnq.getKNNForDBID(iter, kmax + 1);
      int k = 1, idx = 0;
      double sum = 0.;
      for(DoubleDBIDListIter kneighbor = neighbors.iter(); k <= kmax && kneighbor.valid(); kneighbor.advance(), k++) {
        sum += kneighbor.doubleValue();
        if(k < kmin) {
          continue;
        }
        final double ibw = Math.min(k / (sum * scale), iminbw);
        final double sca = MathUtil.powi(ibw, dim);
        for(DoubleDBIDListIter neighbor = neighbors.iter(); neighbor.valid(); neighbor.advance()) {
          final double dens;
          if(sca < Double.POSITIVE_INFINITY) { // NaNs with duplicate points!
            dens = sca * kernel.density(neighbor.doubleValue() * ibw);
          }
          else {
            dens = neighbor.doubleValue() == 0. ? 1. : 0.;
          }
          densities.get(neighbor)[idx] += dens;
          if(dens < CUTOFF) {
            break;
          }
        }
        ++idx; // Only if k >= kmin
      }
      LOG.incrementProcessed(prog);
    }
    LOG.ensureCompleted(prog);
  }
256498
public java.util.List<
          ? extends com.google.privacy.dlp.v2.TransformationSummary.SummaryResultOrBuilder>
      getResultsOrBuilderList() {
    return results_;
  }
1090043
public com.google.privacy.dlp.v2.DatastoreKey getDatastoreKey() {
    if (typeCase_ == 2) {
      return (com.google.privacy.dlp.v2.DatastoreKey) type_;
    }
    return com.google.privacy.dlp.v2.DatastoreKey.getDefaultInstance();
  }
12780
public com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadataOrBuilder
      getImageBoundingPolyDetailsOrBuilder() {
    if (detailsCase_ == 11) {
      return (com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelImageBoundingPolyOperationMetadata
        .getDefaultInstance();
  }
910939
@java.lang.Deprecated
  public java.util.Map<java.lang.String, com.google.cloud.automl.v1beta1.DataStats>
      getFieldStats() {
    return getFieldStatsMap();
  }
1017192
public static double getToleranceDistance(View view, GoogleMap map) {

        BoundingBox boundingBox = getBoundingBox(map);

        double boundingBoxWidth = TileBoundingBoxMapUtils.getLongitudeDistance(boundingBox);
        double boundingBoxHeight = TileBoundingBoxMapUtils.getLatitudeDistance(boundingBox);

        int viewWidth = view.getWidth();
        int viewHeight = view.getHeight();

        double meters = 0;

        if (viewWidth > 0 && viewHeight > 0) {

            double widthMeters = boundingBoxWidth / viewWidth;
            double heightMeters = boundingBoxHeight / viewHeight;

            meters = Math.min(widthMeters, heightMeters);
        }

        return meters;
    }
407700
public com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata
      getImageSegmentationDetails() {
    if (detailsCase_ == 15) {
      return (com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelImageSegmentationOperationMetadata
        .getDefaultInstance();
  }
1090654
@Reference(authors = "M. Steinbach, G. Karypis, V. Kumar", //
      title = "A Comparison of Document Clustering Techniques", //
      booktitle = "KDD workshop on text mining. Vol. 400. No. 1", //
      url = "http://glaros.dtc.umn.edu/gkhome/fetch/papers/docclusterKDDTMW00.pdf", //
      bibkey = "conf/kdd/SteinbachKK00")
  public double f1Measure() {
    return Util.f1Measure(purity(), inversePurity());
  }
175056
public com.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfigOrBuilder
      getCategoricalStatsConfigOrBuilder() {
    if (typeCase_ == 2) {
      return (com.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig) type_;
    }
    return com.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig.getDefaultInstance();
  }
547665
private SerFunction<?,?> determineUnmapFunction(String lastOperationName){
		return Ops.classify.name().equals(lastOperationName) ? this.shuffleResultNormalizer : s -> s; 
	}
9445
public com.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata
      getTextEntityExtractionDetails() {
    if (detailsCase_ == 13) {
      return (com.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata)
          details_;
    }
    return com.google.cloud.datalabeling.v1beta1.LabelTextEntityExtractionOperationMetadata
        .getDefaultInstance();
  }
1238901
@Override
    public KeyFrameMeta analyzeKeyFrames() {
        if (keyframeMeta != null) {
            return keyframeMeta;
        }
        try {
            lock.lockInterruptibly();
            // check for cached keyframe informations
            if (keyframeCache != null) {
                keyframeMeta = keyframeCache.loadKeyFrameMeta(file);
                if (keyframeMeta != null) {
                    // Keyframe data loaded, create other mappings
                    duration = keyframeMeta.duration;
                    posTimeMap = new HashMap<>();
                    for (int i = 0; i < keyframeMeta.positions.length; i++) {
                        posTimeMap.put(keyframeMeta.positions[i], (long) keyframeMeta.timestamps[i]);
                    }
                    return keyframeMeta;
                }
            }
            // create a holder for the metadata
            keyframeMeta = new KeyFrameMeta();
            // Lists of video positions and timestamps
            List<Long> positionList = new ArrayList<>();
            List<Integer> timestampList = new ArrayList<>();
            // Lists of audio positions and timestamps
            List<Long> audioPositionList = new ArrayList<>();
            List<Integer> audioTimestampList = new ArrayList<>();
            long origPos = getCurrentPosition();
            // point to the first tag
            setCurrentPosition(9);
            // number of tags read
            int totalValidTags = 0;
            // start off as audio only
            boolean audioOnly = true;
            while (hasMoreTags()) {
                long pos = getCurrentPosition();
                // read tag header and duration
                ITag tmpTag = null;
                try {
                    tmpTag = readTagHeader();
                } catch (UnsupportedDataTypeException e) {
                    log.warn("analyzeKeyFrames", e);
                }
                if (tmpTag != null) {
                    totalValidTags++;
                } else {
                    break;
                }
                duration = tmpTag.getTimestamp();
                if (tmpTag.getDataType() == IoConstants.TYPE_VIDEO) {
                    if (audioOnly) {
                        audioOnly = false;
                        audioPositionList.clear();
                        audioTimestampList.clear();
                    }
                    if (firstVideoTag == -1) {
                        firstVideoTag = pos;
                    }
                    // Grab Frame type
                    fillBuffer(1);
                    int frametype = in.get();
                    if (keyframeMeta.videoCodecId == -1) {
                        keyframeMeta.videoCodecId = frametype & MASK_VIDEO_CODEC;
                    }
                    if (((frametype & MASK_VIDEO_FRAMETYPE) >> 4) == FLAG_FRAMETYPE_KEYFRAME) {
                        positionList.add(pos);
                        timestampList.add(tmpTag.getTimestamp());
                    }
                } else if (tmpTag.getDataType() == IoConstants.TYPE_AUDIO) {
                    if (firstAudioTag == -1) {
                        firstAudioTag = pos;
                    }
                    // Grab Frame type
                    fillBuffer(1);
                    int frametype = in.get() & 0xff;
                    if (keyframeMeta.audioCodecId == -1) {
                        keyframeMeta.audioCodecId = (frametype & MASK_SOUND_FORMAT) >> 4;
                    }
                    if (audioOnly) {
                        audioPositionList.add(pos);
                        audioTimestampList.add(tmpTag.getTimestamp());
                    }
                }
                // XXX Paul: this 'properly' handles damaged FLV files - as far as duration/size is concerned
                long newPosition = pos + tmpTag.getBodySize() + 15;
                // log.debug("---->" + in.remaining() + " limit=" + in.limit() + "
                // new pos=" + newPosition);
                if (newPosition >= getTotalBytes()) {
                    log.error("New position exceeds limit");
                    if (log.isDebugEnabled()) {
                        log.debug("-----\nKeyframe analysis\n\tdata type={} bodysize={}\n\tremaining={} limit={}\n\tnew pos={} pos={}\n-----", 
                                new Object[] { tmpTag.getDataType(), tmpTag.getBodySize(), getRemainingBytes(), getTotalBytes(), newPosition, pos });
                    }
                    //XXX Paul: A runtime exception is probably not needed here
                    log.info("New position {} exceeds limit {}", newPosition, getTotalBytes());
                    //just break from the loop
                    break;
                } else {
                    setCurrentPosition(newPosition);
                }
            }
            // restore the pos
            setCurrentPosition(origPos);
            log.debug("Total valid tags found: {}", totalValidTags);
            keyframeMeta.duration = duration;
            posTimeMap = new HashMap<Long, Long>();
            if (audioOnly) {
                // The flv only contains audio tags, use their lists
                // to support pause and seeking
                positionList = audioPositionList;
                timestampList = audioTimestampList;
            }
            keyframeMeta.audioOnly = audioOnly;
            keyframeMeta.positions = new long[positionList.size()];
            keyframeMeta.timestamps = new int[timestampList.size()];
            for (int i = 0; i < keyframeMeta.positions.length; i++) {
                keyframeMeta.positions[i] = positionList.get(i);
                keyframeMeta.timestamps[i] = timestampList.get(i);
                posTimeMap.put((long) positionList.get(i), (long) timestampList.get(i));
            }
            if (keyframeCache != null) {
                keyframeCache.saveKeyFrameMeta(file, keyframeMeta);
            }
        } catch (InterruptedException e) {
            log.warn("Exception acquiring lock", e);
        } finally {
            if (lock.isLocked()) {
                lock.unlock();
            }
        }
        return keyframeMeta;
    }
980034
@Reference(authors = "D. Pelleg, A. Moore", //
      title = "X-means: Extending K-means with Efficient Estimation on the Number of Clusters", //
      booktitle = "Proc. 17th Int. Conf. on Machine Learning (ICML 2000)", //
      url = "http://www.pelleg.org/shared/hp/download/xmeans.ps", //
      bibkey = "DBLP:conf/icml/PellegM00")
  public static <V extends NumberVector> double logLikelihood(Relation<V> relation, Clustering<? extends MeanModel> clustering, NumberVectorDistanceFunction<? super V> distanceFunction) {
    List<? extends Cluster<? extends MeanModel>> clusters = clustering.getAllClusters();
    // number of clusters
    final int m = clusters.size();

    // number of objects in the clustering
    int n = 0;
    // cluster sizes
    int[] n_i = new int[m];
    // total variance
    double d = 0.;
    // variances
    double[] d_i = new double[m];

    // Iterate over clusters:
    Iterator<? extends Cluster<? extends MeanModel>> it = clusters.iterator();
    for(int i = 0; it.hasNext(); ++i) {
      Cluster<? extends MeanModel> cluster = it.next();
      n += n_i[i] = cluster.size();
      d += d_i[i] = varianceOfCluster(cluster, distanceFunction, relation);
    }

    // No remaining variance, if every point is on its own:
    if(n <= m) {
      return Double.NEGATIVE_INFINITY;
    }

    // Total variance (corrected for bias)
    final double logv = FastMath.log(d / (n - m));

    final int dim = RelationUtil.dimensionality(relation);
    // log likelihood of this clustering
    double logLikelihood = 0.;

    // Aggregate
    for(int i = 0; i < m; i++) {
      logLikelihood += n_i[i] * FastMath.log(n_i[i]) // Post. entropy Rn log Rn
          - n_i[i] * .5 * MathUtil.LOGTWOPI // Rn/2 log2pi
          - n_i[i] * dim * .5 * logv // Rn M/2 log sigma^2
          - (d_i[i] - m) * .5; // (Rn-K)/2
    }
    logLikelihood -= n * FastMath.log(n); // Prior entropy, sum_i Rn log R
    return logLikelihood;
  }
743
public static double calculateLofWithoutUpdate(int kn, LofPoint targetPoint, LofDataSet dataSet)
    {
        // 対象点のK距離、K距離近傍を算出する。
        KDistanceResult kResult = calculateKDistance(kn, targetPoint, dataSet);

        LofPoint tmpPoint = targetPoint.deepCopy();
        tmpPoint.setkDistance(kResult.getkDistance());
        tmpPoint.setkDistanceNeighbor(kResult.getkDistanceNeighbor());

        updateLrd(tmpPoint, dataSet);

        // 対象の局所外れ係数を算出する。
        double lof = calculateLof(tmpPoint, dataSet);
        return lof;
    }