public Builder() { this.item = new BucketStatistics(); }
@Override public BucketStatistics clone() { BucketStatistics cloned = (BucketStatistics) super.clone(); if (bucketComparisons != null) { Map<Bucket.Label, BucketComparison> clonedComparisons = new HashMap<>(); for (Entry<Label, BucketComparison> entry : bucketComparisons.entrySet()) { clonedComparisons.put(entry.getKey(), entry.getValue().clone()); } cloned.setBucketComparisons(clonedComparisons); } return cloned; } }
long bucketImpressions = bucket.getImpressionCounts().getUniqueUserCount(); long otherBucketImpressions = otherBucket.getImpressionCounts().getUniqueUserCount(); long bucketUniqueCounts = bucket.getJointActionCounts().getUniqueUserCount(); long otherBucketUniqueCounts = otherBucket.getJointActionCounts().getUniqueUserCount(); Estimate rateDifference; Map<Event.Name, ActionCounts> actionCounts = bucket.getActionCounts(); Map<Event.Name, ActionCounts> otherActionCounts = otherBucket.getActionCounts(); Set<Event.Name> sharedNames = new HashSet<>(actionCounts.keySet()); sharedNames.retainAll(otherActionCounts.keySet()); Bucket.Label otherBucketLabel = otherBucket.getLabel(); BucketComparison comparison = new BucketComparison.Builder() .withOtherLabel(otherBucketLabel) .build(); bucket.addToBucketComparisons(otherBucketLabel, comparison);
Bucket.Label bucketName = bucket.getLabel(); if (bucket.getBucketComparisons() != null) { for (BucketComparison comparison : bucket.getBucketComparisons().values()) { ComparisonStatistics jointComparison = comparison.getJointActionComparison(); if (bucket.getBucketComparisons() != null) { for (BucketComparison comparison : bucket.getBucketComparisons().values()) { Bucket.Label winnerName = comparison.getJointActionComparison().getClearComparisonWinner(); Bucket.Label otherBucketName = comparison.getOtherLabel(); Bucket.Label bucketName = bucket.getLabel(); if (bucket.getBucketComparisons() != null) { for (BucketComparison comparison : bucket.getBucketComparisons().values()) { if (bucket.getBucketComparisons() != null) { for (BucketComparison comparison : bucket.getBucketComparisons().values()) { ActionComparisonStatistics action = comparison.getActionComparisons().get(actionName); if (action != null) {
@Override public ExperimentStatistics clone() { ExperimentStatistics cloned = (ExperimentStatistics) super.clone(); if (jointProgress != null) { cloned.setJointProgress(jointProgress.clone()); } if (experimentProgress != null) { cloned.setExperimentProgress(experimentProgress.clone()); } if (buckets != null) { Map<Bucket.Label, BucketStatistics> clonedBuckets = new HashMap<>(); for (Entry<Label, BucketStatistics> entry : buckets.entrySet()) { clonedBuckets.put(entry.getKey(), entry.getValue().clone()); } cloned.setBuckets(clonedBuckets); } if (actionProgress != null) { Map<Event.Name, ActionProgress> clonedActions = new HashMap<>(); for (Entry<Name, ActionProgress> entry : actionProgress.entrySet()) { clonedActions.put(entry.getKey(), entry.getValue().clone()); } cloned.setActionProgress(clonedActions); } return cloned; }
private void computeClearComparisonWinner(BucketStatistics bucket, BucketStatistics otherBucket, Estimate rateDifference, ComparisonStatistics jointComparison) { if (rateDifference.getEstimate() > 0 && rateDifference.getLowerBound() > 0) { jointComparison.setClearComparisonWinner(bucket.getLabel()); } else if (rateDifference.getEstimate() < 0 && rateDifference.getUpperBound() < 0) { jointComparison.setClearComparisonWinner(otherBucket.getLabel()); } else { jointComparison.setClearComparisonWinner(null); } }
if (!Objects.isNull(bucketStat.getJointActionRate())) { b.setActionRate(bucketStat.getJointActionRate().getEstimate()); b.setLowerBound(bucketStat.getJointActionRate().getLowerBound()); b.setUpperBound(bucketStat.getJointActionRate().getUpperBound());