OutlierScalingFunction oscaling = (OutlierScalingFunction) scaling;
oscaling.prepare(or);
}
ModifiableDBIDs ids = DBIDUtil.newHashSet(or.getScores().getDBIDs());
DBIDs outlierIds = DatabaseUtil.getObjectsByLabelMatch(database, positiveClassName);
// first value for outliers, second for each object
final AggregatingHistogram<DoubleDoublePair, DoubleDoublePair> hist;
// If we have useful (finite) min/max, use these for binning.
double min = scaling.getMin();
double max = scaling.getMax();
if(Double.isInfinite(min) || Double.isNaN(min) || Double.isInfinite(max) || Double.isNaN(max)) {
hist = FlexiHistogram.DoubleSumDoubleSumHistogram(bins);
}
else {
hist = AggregatingHistogram.DoubleSumDoubleSumHistogram(bins, min, max);
}
// first fill histogram only with values of outliers
DoubleDoublePair positive, negative;
if(!splitfreq) {
positive = new DoubleDoublePair(0., 1. / ids.size());
negative = new DoubleDoublePair(1. / ids.size(), 0.);
}
else {
positive = new DoubleDoublePair(0., 1. / outlierIds.size());
negative = new DoubleDoublePair(1. / (ids.size() - outlierIds.size()), 0.);
}
ids.removeDBIDs(outlierIds);
// fill histogram with values of each object
for(DBID id : ids) {
double result = or.getScores().get(id);