<code>.google.privacy.dlp.v2.PrivacyMetric.CategoricalStatsConfig categorical_stats_config = 2;
</code>
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();
  }
530030
public com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails
          .DeltaPresenceEstimationResultOrBuilder
      getDeltaPresenceEstimationResultOrBuilder() {
    if (resultCase_ == 9) {
      return (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult)
          result_;
    }
    return com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.DeltaPresenceEstimationResult
        .getDefaultInstance();
  }
568078
public com.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig getLDiversityConfig() {
    if (typeCase_ == 4) {
      return (com.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig) type_;
    }
    return com.google.privacy.dlp.v2.PrivacyMetric.LDiversityConfig.getDefaultInstance();
  }
509020
public com.google.api.ads.adwords.axis.v201809.mcm.ConversionTrackingSettings getConversionTrackingSettings() {
        return conversionTrackingSettings;
    }
1161114
public Map<Integer, Double> chi_square(BaseFeatureData stats)
    {
        Map<Integer, Double> selectedFeatures = new HashMap<Integer, Double>();

        double N1dot, N0dot, N00, N01, N10, N11;
        double chisquareScore;
        Double previousScore;
        for (int feature = 0; feature < stats.featureCategoryJointCount.length; feature++)
        {
            int[] categoryList = stats.featureCategoryJointCount[feature];

            //计算 N1. (含有该特征的文档数量)
            N1dot = 0;
            for (int count : categoryList)
            {
                N1dot += count;
            }

            //还有 N0. (不含该特征的文档数量)
            N0dot = stats.n - N1dot;

            for (int category = 0; category < categoryList.length; category++)
            {

                N11 = categoryList[category]; //N11 是含有该特征并属于该类目的文档数量
                N01 = stats.categoryCounts[category] - N11; //N01 是不含该特征却属于该类目的文档数量

                N00 = N0dot - N01; //N00 是不含该特征也不属于该类目的文档数量
                N10 = N1dot - N11; //N10 是含有该特征却不属于该类目的文档数量

                //基于上述统计数据计算卡方分值
                chisquareScore = stats.n * Math.pow(N11 * N00 - N10 * N01, 2) / ((N11 + N01) * (N11 + N10) * (N10 + N00) * (N01 + N00));

                //如果分数大于临界值则加入特征列表
                if (chisquareScore >= chisquareCriticalValue)
                {
                    previousScore = selectedFeatures.get(feature);
                    if (previousScore == null || chisquareScore > previousScore)
                    {
                        selectedFeatures.put(feature, chisquareScore);
                    }
                }
            }
        }
        if (selectedFeatures.size() == 0) // 当特征全部无法通过卡方检测时，取全集作为特征
        {
            for (int feature = 0; feature < stats.featureCategoryJointCount.length; feature++)
            {
                selectedFeatures.put(feature, 0.);
            }
        }
        if (selectedFeatures.size() > maxSize)
        {
            MaxHeap<Map.Entry<Integer, Double>> maxHeap = new MaxHeap<Map.Entry<Integer, Double>>(maxSize, new Comparator<Map.Entry<Integer, Double>>()
            {
                @Override
                public int compare(Map.Entry<Integer, Double> o1, Map.Entry<Integer, Double> o2)
                {
                    return o1.getValue().compareTo(o2.getValue());
                }
            });
            for (Map.Entry<Integer, Double> entry : selectedFeatures.entrySet())
            {
                maxHeap.add(entry);
            }
            selectedFeatures.clear();
            for (Map.Entry<Integer, Double> entry : maxHeap)
            {
                selectedFeatures.put(entry.getKey(), entry.getValue());
            }
        }

        return selectedFeatures;
    }
351456
public com.google.api.ads.admanager.axis.v201808.CdnConfigurationStatus getCdnConfigurationStatus() {
        return cdnConfigurationStatus;
    }
71862
public com.google.privacy.dlp.v2.RiskAnalysisJobConfig getRiskJob() {
    if (jobCase_ == 3) {
      return (com.google.privacy.dlp.v2.RiskAnalysisJobConfig) job_;
    }
    return com.google.privacy.dlp.v2.RiskAnalysisJobConfig.getDefaultInstance();
  }
9936
public com.google.privacy.dlp.v2.KmsWrappedCryptoKeyOrBuilder getKmsWrappedOrBuilder() {
    if (sourceCase_ == 3) {
      return (com.google.privacy.dlp.v2.KmsWrappedCryptoKey) source_;
    }
    return com.google.privacy.dlp.v2.KmsWrappedCryptoKey.getDefaultInstance();
  }
778702
private boolean isProfilingHeader(final String confidentialData, final ILoggingEvent event) {
        if (!LOGGING_FILTER_NAME.equals(event.getLoggerName())) {
            return false;
        }

        for (final ProfilingFeatureType profileType : ProfilingFeatureType.values()) {
            // See ProfilingDataItem#getKey
            if (confidentialData.startsWith("\"" + profileType.name() + ":")) {
                return true;
            }
        }
        return false;
    }
1319271
public com.google.privacy.dlp.v2.InspectJobConfigOrBuilder getInspectJobOrBuilder() {
    if (jobCase_ == 2) {
      return (com.google.privacy.dlp.v2.InspectJobConfig) job_;
    }
    return com.google.privacy.dlp.v2.InspectJobConfig.getDefaultInstance();
  }
1100497
public com.google.api.ads.admanager.axis.v201805.DaiAuthenticationKeyType getKeyType() {
        return keyType;
    }
216103
public com.google.privacy.dlp.v2.InspectConfig.FindingLimits getLimits() {
    return limits_ == null
        ? com.google.privacy.dlp.v2.InspectConfig.FindingLimits.getDefaultInstance()
        : limits_;
  }
994769
public com.google.privacy.dlp.v2.BucketingConfigOrBuilder getBucketingConfigOrBuilder() {
    if (transformationCase_ == 6) {
      return (com.google.privacy.dlp.v2.BucketingConfig) transformation_;
    }
    return com.google.privacy.dlp.v2.BucketingConfig.getDefaultInstance();
  }
1081169
public com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResultOrBuilder
      getKAnonymityResultOrBuilder() {
    if (resultCase_ == 5) {
      return (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult) result_;
    }
    return com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.KAnonymityResult
        .getDefaultInstance();
  }
370661
public com.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfigOrBuilder
      getNumericalStatsConfigOrBuilder() {
    if (typeCase_ == 1) {
      return (com.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig) type_;
    }
    return com.google.privacy.dlp.v2.PrivacyMetric.NumericalStatsConfig.getDefaultInstance();
  }
239869
public com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult
      getNumericalStatsResult() {
    if (resultCase_ == 3) {
      return (com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult) result_;
    }
    return com.google.privacy.dlp.v2.AnalyzeDataSourceRiskDetails.NumericalStatsResult
        .getDefaultInstance();
  }
104451
public function setCategoricalStatsConfig($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dlp\V2\PrivacyMetric_CategoricalStatsConfig::class);
        $this->writeOneof(2, $var);

        return $this;
    }