// TODO: we can also visualize other scores!
List<OutlierResult> ors = ResultUtil.filterResults(result, OutlierResult.class);
for(OutlierResult o : ors) {
IterableIterator<ScatterPlotProjector<?>> ps = ResultUtil.filteredResults(baseResult, ScatterPlotProjector.class);
for(ScatterPlotProjector<?> p : ps) {
final VisualizationTask task = new VisualizationTask(NAME, o.getScores(), p.getRelation(), this);
task.put(VisualizationTask.META_TOOL, true);
task.put(VisualizationTask.META_VISIBLE_DEFAULT, false);
baseResult.getHierarchy().add(o.getScores(), task);
baseResult.getHierarchy().add(p, task);
}
}
List<Relation<?>> rrs = ResultUtil.filterResults(result, Relation.class);
for(Relation<?> r : rrs) {
if(!TypeUtil.DOUBLE.isAssignableFromType(r.getDataTypeInformation())) {
continue;
}
// Skip if we already considered it above
boolean add = true;
for(Result p : baseResult.getHierarchy().getChildren(r)) {
if(p instanceof VisualizationTask && ((VisualizationTask) p).getFactory() instanceof Factory) {
add = false;
break;
}
}
if(add) {
IterableIterator<ScatterPlotProjector<?>> ps = ResultUtil.filteredResults(baseResult, ScatterPlotProjector.class);
for(ScatterPlotProjector<?> p : ps) {
final VisualizationTask task = new VisualizationTask(NAME_GEN, r, p.getRelation(), this);
task.put(VisualizationTask.META_TOOL, true);
task.put(VisualizationTask.META_VISIBLE_DEFAULT, false);
baseResult.getHierarchy().add(r, task);
baseResult.getHierarchy().add(p, task);
}
}
}