Class DistanceFunctionVisualization
- java.lang.Object
-
- elki.visualization.visualizers.scatterplot.selection.DistanceFunctionVisualization
-
- All Implemented Interfaces:
VisualizationProcessor
,VisFactory
public class DistanceFunctionVisualization extends java.lang.Object implements VisFactory
Factory for visualizers to generate an SVG-Element containing dots as markers representing the kNN of the selected Database objects. To use this, add a kNN preprocessor index to your database!- Since:
- 0.5.5
- Author:
- Erich Schubert, Robert Rödler
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DistanceFunctionVisualization.Instance
Instance, visualizing a particular set of kNNs
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
A short name characterizing this Visualizer.
-
Constructor Summary
Constructors Constructor Description DistanceFunctionVisualization()
Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static org.w3c.dom.Element
drawCosine(SVGPlot svgp, Projection2D proj, NumberVector mid, double angle)
Visualizes Cosine and ArcCosine distance functionsstatic double
getLPNormP(AbstractMaterializeKNNPreprocessor<?> kNN)
Get the "p" value of an Lp norm.static boolean
isAngularDistance(AbstractMaterializeKNNPreprocessor<?> kNN)
Test whether the given preprocessor used an angular distance functionVisualization
makeVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Produce a visualization instance for the given taskvoid
processNewResult(VisualizerContext context, java.lang.Object start)
Add visualizers for the given result (tree) to the context.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.visualization.visualizers.VisFactory
allowThumbnails, makeVisualizationOrThumbnail
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
A short name characterizing this Visualizer.- See Also:
- Constant Field Values
-
-
Method Detail
-
makeVisualization
public Visualization makeVisualization(VisualizerContext context, VisualizationTask task, VisualizationPlot plot, double width, double height, Projection proj)
Description copied from interface:VisFactory
Produce a visualization instance for the given task- Specified by:
makeVisualization
in interfaceVisFactory
- Parameters:
context
- Visualization contexttask
- Visualization taskplot
- Plotwidth
- Widthheight
- Heightproj
- Projection- Returns:
- Visualization
-
processNewResult
public void processNewResult(VisualizerContext context, java.lang.Object start)
Description copied from interface:VisFactory
Add visualizers for the given result (tree) to the context.- Specified by:
processNewResult
in interfaceVisFactory
- Specified by:
processNewResult
in interfaceVisualizationProcessor
- Parameters:
context
- Visualization contextstart
- Result to process
-
getLPNormP
public static double getLPNormP(AbstractMaterializeKNNPreprocessor<?> kNN)
Get the "p" value of an Lp norm.- Parameters:
kNN
- kNN preprocessor- Returns:
- p of LP norm, or NaN
-
isAngularDistance
public static boolean isAngularDistance(AbstractMaterializeKNNPreprocessor<?> kNN)
Test whether the given preprocessor used an angular distance function- Parameters:
kNN
- kNN preprocessor- Returns:
- true when angular
-
drawCosine
public static org.w3c.dom.Element drawCosine(SVGPlot svgp, Projection2D proj, NumberVector mid, double angle)
Visualizes Cosine and ArcCosine distance functions- Parameters:
svgp
- SVG Plotproj
- Visualization projectionmid
- mean vectorangle
- Opening angle in radians- Returns:
- path element
-
-