public Builder() { this.item = new ExperimentCounts(); }
public Builder withExperimentCounts(ExperimentCounts value) { this.item.impressionCounts = value.getImpressionCounts(); this.item.jointActionCounts = value.getJointActionCounts(); this.item.actionCounts = value.getActionCounts(); return this; }
@Override public DailyCounts clone() { DailyCounts cloned; try { cloned = (DailyCounts) super.clone(); } catch (CloneNotSupportedException e) { // Should never happen throw new AnalyticsException("DailyCounts clone not supported: " + e.getMessage(), e); } if (perDay != null) { cloned.perDay = perDay.clone(); } if (cumulative != null) { cloned.cumulative = cumulative.clone(); } return cloned; } }
/** * Creates an ExperimentStatistics object from an ExperimentCounts object. * * @param counts an ExperimentCounts object containing all the counts for this experiment * @param metric the binomial metric object to use for statistics calculations * @param effectSize the effect size of interest to use for statistics calculations * @return ExperimentStatistics */ ExperimentStatistics calculateExperimentStatistics(final ExperimentCounts counts, BinomialMetric metric, double effectSize, Parameters.Mode mode) { ExperimentStatistics statistics = new ExperimentStatistics.Builder() .withExperimentCounts(counts) .withBuckets(calculateBucketStatistics(counts.getBuckets(), metric, effectSize, mode)) .build(); analysisTools.generateRate(statistics, metric); analysisTools.generateProgress(statistics); return statistics; }
@Override public ExperimentCounts clone() { ExperimentCounts cloned = (ExperimentCounts) super.clone(); if (buckets != null) { Map<Bucket.Label, BucketCounts> clonedBuckets = new HashMap<>(); for (Entry<Label, BucketCounts> entry : buckets.entrySet()) { clonedBuckets.put(entry.getKey(), entry.getValue().clone()); } cloned.setBuckets(clonedBuckets); } return cloned; }
Map<Bucket.Label, BucketBasicStatistics> bucketsWithStats = new HashMap<>(); for (BucketCounts bucket : perDayCount.getBuckets().values()) { BucketBasicStatistics bucketWithStats = new BucketBasicStatistics.Builder() .withBucketCounts(bucket) ExperimentStatistics cumulativeStatistics = new ExperimentStatistics.Builder() .withExperimentCounts(cumulativeCount) .withBuckets(calculateBucketStatistics(cumulativeCount.getBuckets(), metric, effectSize, parameters.getMode())) .build();
public Builder withExperimentCounts(ExperimentCounts value) { this.item.impressionCounts = value.getImpressionCounts(); this.item.jointActionCounts = value.getJointActionCounts(); this.item.actionCounts = value.getActionCounts(); return this; }