@Test public void testThat2PointsFarAwayFrom3PointsNearToEachAreDetectedAsOutliers() throws NicTrackerException { final Set<NicGeoPoint> geoPointsIn = CandidateFixtures.createCandidatesTwoPointsFarAwayFromThreePointsNearToEachOther(); final Set<NicGeoPoint> expected = CandidateFixtures.createCandidatesTwoPointsFarAwayFromThreePointsNearToEachOtherExpected(); final Set<NicGeoPoint> geoPointsOut = poe.removeOutliers(geoPointsIn); assertEquals(expected, geoPointsOut); }
@Override public Set<T> removeOutliers(final Set<T> candidateSet) { if (candidateSet.size() <= 2) { return candidateSet; } final PointList candidates = new PointList(pointFactory, candidateSet); final List<PointDoublePair> centroidDistances = calculateCentroidDistances(candidates); final List<PointDoublePair> medianDistanceDivergences = calculateDistanceDivergences(centroidDistances); removeOutliers(medianDistanceDivergences, candidateSet); return candidateSet; }
PlasmonaOutlierEliminator implements OutlierEliminator<T> { @Override public Set<T> removeOutliers(final Set<T> candidateSet) { if (candidateSet.size() <= 2) { return candidateSet; } final PointList candidates = new PointList(pointFactory, candidateSet); final List<PointDoublePair> centroidDistances = calculateCentroidDistances(candidates); final List<PointDoublePair> medianDistanceDivergences = calculateDistanceDivergences(centroidDistances); removeOutliers(medianDistanceDivergences, candidateSet); return candidateSet; } }
PlasmonaOutlierEliminator implements OutlierEliminator<T> { @Override public Set<T> removeOutliers(final Set<T> candidateSet) { if (candidateSet.size() <= 2) { return candidateSet; } final PointList candidates = new PointList(pointFactory, candidateSet); final List<PointDoublePair> centroidDistances = calculateCentroidDistances(candidates); final List<PointDoublePair> medianDistanceDivergences = calculateDistanceDivergences(centroidDistances); removeOutliers(medianDistanceDivergences, candidateSet); return candidateSet; } PlasmonaOutlierEliminator(PointFactory factory); }
PlasmonaOutlierEliminator implements OutlierEliminator<T> { @Override public Set<T> removeOutliers(final Set<T> candidateSet) { if (candidateSet.size() <= 2) { return candidateSet; } final PointList candidates = new PointList(pointFactory, candidateSet); final List<PointDoublePair> centroidDistances = calculateCentroidDistances(candidates); final List<PointDoublePair> medianDistanceDivergences = calculateDistanceDivergences(centroidDistances); removeOutliers(medianDistanceDivergences, candidateSet); return candidateSet; } PlasmonaOutlierEliminator(PointFactory factory); @Override Set<T> removeOutliers(final Set<T> candidateSet); }
PlasmonaOutlierEliminator implements OutlierEliminator<T> { @Override public Set<T> removeOutliers(final Set<T> candidateSet) { if (candidateSet.size() <= 2) { return candidateSet; } final PointList candidates = new PointList(pointFactory, candidateSet); final List<PointDoublePair> centroidDistances = calculateCentroidDistances(candidates); final List<PointDoublePair> medianDistanceDivergences = calculateDistanceDivergences(centroidDistances); removeOutliers(medianDistanceDivergences, candidateSet); return candidateSet; } PlasmonaOutlierEliminator(PointFactory factory); @Override Set<T> removeOutliers(final Set<T> candidateSet);  }