diff options
Diffstat (limited to 'src/de/lmu/ifi/dbs/elki/visualization/opticsplot')
9 files changed, 35 insertions, 17 deletions
diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorAdapter.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorAdapter.java index d86c1ae3..5a16c91c 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorAdapter.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorAdapter.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorFromStylingPolicy.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorFromStylingPolicy.java index 53a03d3e..1f9bccdc 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorFromStylingPolicy.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorFromStylingPolicy.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorStatic.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorStatic.java index 920c6d27..b6933e63 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorStatic.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSColorStatic.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCorrelationDimensionalityDistance.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCorrelationDimensionalityDistance.java index d61c8d07..1261c668 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCorrelationDimensionalityDistance.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCorrelationDimensionalityDistance.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -50,4 +50,9 @@ public class OPTICSCorrelationDimensionalityDistance<D extends CorrelationDistan } return reachability.getCorrelationValue(); } + + @Override + public boolean isInfinite(ClusterOrderEntry<D> coe) { + return coe.getReachability().isInfiniteDistance(); + } }
\ No newline at end of file diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCut.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCut.java index d5a1c043..452cf6af 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCut.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCut.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -58,7 +58,7 @@ public class OPTICSCut { public static <D extends Distance<D>> Clustering<Model> makeOPTICSCut(ClusterOrderResult<D> co, OPTICSDistanceAdapter<D> adapter, double epsilon) { List<ClusterOrderEntry<D>> order = co.getClusterOrder(); // Clustering model we are building - Clustering<Model> clustering = new Clustering<Model>("OPTICS Cut Clustering", "optics-cut"); + Clustering<Model> clustering = new Clustering<>("OPTICS Cut Clustering", "optics-cut"); // Collects noise elements ModifiableDBIDs noise = DBIDUtil.newHashSet(); @@ -88,7 +88,7 @@ public class OPTICSCut { if(!current.isEmpty()) { // TODO: do we want a minpts restriction? // But we get have only core points guaranteed anyway. - clustering.addCluster(new Cluster<Model>(current, ClusterModel.CLUSTER)); + clustering.addToplevelCluster(new Cluster<Model>(current, ClusterModel.CLUSTER)); current = DBIDUtil.newHashSet(); } // Add to noise @@ -97,10 +97,10 @@ public class OPTICSCut { } // Any unfinished cluster will also be added if(!current.isEmpty()) { - clustering.addCluster(new Cluster<Model>(current, ClusterModel.CLUSTER)); + clustering.addToplevelCluster(new Cluster<Model>(current, ClusterModel.CLUSTER)); } // Add noise - clustering.addCluster(new Cluster<Model>(noise, true, ClusterModel.CLUSTER)); + clustering.addToplevelCluster(new Cluster<Model>(noise, true, ClusterModel.CLUSTER)); return clustering; } }
\ No newline at end of file diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSDistanceAdapter.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSDistanceAdapter.java index 16b9a323..8a6f13ba 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSDistanceAdapter.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSDistanceAdapter.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -40,5 +40,13 @@ public interface OPTICSDistanceAdapter<D extends Distance<D>> { * @param coe Cluster Order Entry * @return Double value (height) */ - public double getDoubleForEntry(ClusterOrderEntry<D> coe); + double getDoubleForEntry(ClusterOrderEntry<D> coe); + + /** + * Test whether the reachability is infinite. + * + * @param coe Cluster order entry + * @return true, when infinite + */ + boolean isInfinite(ClusterOrderEntry<D> coe); } diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSNumberDistance.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSNumberDistance.java index 697a9fa2..ad7112f3 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSNumberDistance.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSNumberDistance.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -31,7 +31,7 @@ import de.lmu.ifi.dbs.elki.result.optics.ClusterOrderEntry; * * @author Erich Schubert */ -public class OPTICSNumberDistance<D extends NumberDistance<D,?>> implements OPTICSDistanceAdapter<D> { +public class OPTICSNumberDistance<D extends NumberDistance<D, ?>> implements OPTICSDistanceAdapter<D> { /** * Default constructor. */ @@ -46,4 +46,9 @@ public class OPTICSNumberDistance<D extends NumberDistance<D,?>> implements OPTI } return coe.getReachability().doubleValue(); } + + @Override + public boolean isInfinite(ClusterOrderEntry<D> coe) { + return coe.getReachability().isInfiniteDistance(); + } } diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java index b6b6fb31..4663ef1a 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java @@ -4,7 +4,7 @@ package de.lmu.ifi.dbs.elki.visualization.opticsplot; This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures - Copyright (C) 2012 + Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team @@ -219,7 +219,7 @@ public class OPTICSPlot<D extends Distance<D>> implements Result { // calculate range for(ClusterOrderEntry<D> coe : order) { double reach = distanceAdapter.getDoubleForEntry(coe); - if(!Double.isInfinite(reach) && !Double.isNaN(reach)) { + if(!distanceAdapter.isInfinite(coe) && !Double.isNaN(reach)) { range.put(reach); } } @@ -348,7 +348,7 @@ public class OPTICSPlot<D extends Distance<D>> implements Result { final StylingPolicy policy = context.getStyleResult().getStylingPolicy(); final OPTICSColorAdapter opcolor = new OPTICSColorFromStylingPolicy(policy); - OPTICSPlot<D> opticsplot = new OPTICSPlot<D>(co, opcolor); + OPTICSPlot<D> opticsplot = new OPTICSPlot<>(co, opcolor); // co.addChildResult(opticsplot); return opticsplot; } diff --git a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/package-info.java b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/package-info.java index 39838db1..f1837d96 100644 --- a/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/package-info.java +++ b/src/de/lmu/ifi/dbs/elki/visualization/opticsplot/package-info.java @@ -6,7 +6,7 @@ This file is part of ELKI: Environment for Developing KDD-Applications Supported by Index-Structures -Copyright (C) 2012 +Copyright (C) 2013 Ludwig-Maximilians-Universität München Lehr- und Forschungseinheit für Datenbanksysteme ELKI Development Team |