APLOutlierSummarizer extends APLSummarizer { public void setCountColumn(String countColumn) { this.countColumn = countColumn; } APLOutlierSummarizer(boolean useBitmaps); @Override List<String> getAggregateNames(); @Override AggregationOp[] getAggregationOps(); @Override int[][] getEncoded(List<String[]> columns, DataFrame input); @Override double[][] getAggregateColumns(DataFrame input); @Override List<QualityMetric> getQualityMetricList(); @Override List<Double> getThresholds(); @Override double getNumberOutliers(double[][] aggregates); String getCountColumn(); void setCountColumn(String countColumn); double getMinRatioMetric();  }
@Test public void testCubeOrder3() throws Exception { DataFrame df = new DataFrame(); String[] col1 = {"a1", "a2", "a1", "a1"}; String[] col2 = {"b1", "b1", "b2", "b1"}; String[] col3 = {"c1", "c1", "c1", "c2"}; double[] counts = {100, 300, 400, 500}; double[] oCounts = {30, 5, 5, 7}; df.addColumn("col1", col1); df.addColumn("col2", col2); df.addColumn("col3", col3); df.addColumn("counts", counts); df.addColumn("oCounts", oCounts); List<String> explanationAttributes = Arrays.asList( "col1", "col2", "col3" ); APLOutlierSummarizer summ = new APLOutlierSummarizer(false); summ.setCountColumn("counts"); summ.setOutlierColumn("oCounts"); summ.setMinSupport(.1); summ.setMinRatioMetric(3.0); summ.setAttributes(explanationAttributes); summ.process(df); APLExplanation e = summ.getResults(); assertEquals(1, e.getResults().size()); assertTrue(e.prettyPrint().contains("col1=a1")); assertEquals(47.0, e.numOutliers(), 1e-10); }
@Test public void testSimpleOrder3() throws Exception { DataFrame df = new DataFrame(); String[] col1 = {"a1", "a2", "a1", "a1"}; String[] col2 = {"b1", "b1", "b2", "b1"}; String[] col3 = {"c1", "c1", "c1", "c2"}; double[] counts = {1, 1, 1, 1}; double[] oCounts = {1, 0, 0, 0}; df.addColumn("col1", col1); df.addColumn("col2", col2); df.addColumn("col3", col3); df.addColumn("counts", counts); df.addColumn("oCounts", oCounts); List<String> explanationAttributes = Arrays.asList( "col1", "col2", "col3" ); APLOutlierSummarizer summ = new APLOutlierSummarizer(true); summ.setCountColumn("counts"); summ.setOutlierColumn("oCounts"); summ.setMinSupport(.1); summ.setMinRatioMetric(3.0); summ.setAttributes(explanationAttributes); summ.process(df); APLExplanation e = summ.getResults(); assertEquals(1, e.getResults().size()); assertTrue(e.prettyPrint().contains("col1=a1")); assertEquals(1, e.numOutliers(), 1e-10); }