id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
63,300
elki-project/elki
elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/projection/random/RandomSubsetProjectionFamily.java
RandomSubsetProjectionFamily.randomPermutation
public static int[] randomPermutation(final int[] out, Random random) { for(int i = out.length - 1; i > 0; i--) { // Swap with random preceeding element. int ri = random.nextInt(i + 1); int tmp = out[ri]; out[ri] = out[i]; out[i] = tmp; } return out; }
java
public static int[] randomPermutation(final int[] out, Random random) { for(int i = out.length - 1; i > 0; i--) { // Swap with random preceeding element. int ri = random.nextInt(i + 1); int tmp = out[ri]; out[ri] = out[i]; out[i] = tmp; } return out; }
[ "public", "static", "int", "[", "]", "randomPermutation", "(", "final", "int", "[", "]", "out", ",", "Random", "random", ")", "{", "for", "(", "int", "i", "=", "out", ".", "length", "-", "1", ";", "i", ">", "0", ";", "i", "--", ")", "{", "// Sw...
Perform a random permutation of the array, in-place. Knuth / Fisher-Yates style shuffle TODO: move to shared code. @param out Existing output array @param random Random generator. @return Same array.
[ "Perform", "a", "random", "permutation", "of", "the", "array", "in", "-", "place", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/projection/random/RandomSubsetProjectionFamily.java#L95-L104
63,301
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGUpdateSynchronizer.java
JSVGUpdateSynchronizer.makeRunnerIfNeeded
protected void makeRunnerIfNeeded() { // We don't need to make a SVG runner when there are no pending updates. boolean stop = true; for(WeakReference<UpdateRunner> wur : updaterunner) { UpdateRunner ur = wur.get(); if(ur == null) { updaterunner.remove(wur); } else if(!ur.isEm...
java
protected void makeRunnerIfNeeded() { // We don't need to make a SVG runner when there are no pending updates. boolean stop = true; for(WeakReference<UpdateRunner> wur : updaterunner) { UpdateRunner ur = wur.get(); if(ur == null) { updaterunner.remove(wur); } else if(!ur.isEm...
[ "protected", "void", "makeRunnerIfNeeded", "(", ")", "{", "// We don't need to make a SVG runner when there are no pending updates.", "boolean", "stop", "=", "true", ";", "for", "(", "WeakReference", "<", "UpdateRunner", ">", "wur", ":", "updaterunner", ")", "{", "Updat...
Join the runnable queue of a component.
[ "Join", "the", "runnable", "queue", "of", "a", "component", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/JSVGUpdateSynchronizer.java#L87-L142
63,302
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/thumbs/ThumbnailVisualization.java
ThumbnailVisualization.fullRedraw
@Override public void fullRedraw() { if(!(getWidth() > 0 && getHeight() > 0)) { LoggingUtil.warning("Thumbnail of zero size requested: " + visFactory); return; } if(thumbid < 0) { // LoggingUtil.warning("Generating new thumbnail " + this); layer.appendChild(SVGUtil.svgWaitIcon(plot...
java
@Override public void fullRedraw() { if(!(getWidth() > 0 && getHeight() > 0)) { LoggingUtil.warning("Thumbnail of zero size requested: " + visFactory); return; } if(thumbid < 0) { // LoggingUtil.warning("Generating new thumbnail " + this); layer.appendChild(SVGUtil.svgWaitIcon(plot...
[ "@", "Override", "public", "void", "fullRedraw", "(", ")", "{", "if", "(", "!", "(", "getWidth", "(", ")", ">", "0", "&&", "getHeight", "(", ")", ">", "0", ")", ")", "{", "LoggingUtil", ".", "warning", "(", "\"Thumbnail of zero size requested: \"", "+", ...
Perform a full redraw.
[ "Perform", "a", "full", "redraw", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/thumbs/ThumbnailVisualization.java#L137-L159
63,303
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/Centroid.java
Centroid.make
public static Centroid make(Relation<? extends NumberVector> relation, DBIDs ids) { final int dim = RelationUtil.dimensionality(relation); Centroid c = new Centroid(dim); double[] elems = c.elements; int count = 0; for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { NumberVector v ...
java
public static Centroid make(Relation<? extends NumberVector> relation, DBIDs ids) { final int dim = RelationUtil.dimensionality(relation); Centroid c = new Centroid(dim); double[] elems = c.elements; int count = 0; for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) { NumberVector v ...
[ "public", "static", "Centroid", "make", "(", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ",", "DBIDs", "ids", ")", "{", "final", "int", "dim", "=", "RelationUtil", ".", "dimensionality", "(", "relation", ")", ";", "Centroid", "c", "="...
Static constructor from an existing relation. @param relation Relation to use @param ids IDs to use @return Centroid
[ "Static", "constructor", "from", "an", "existing", "relation", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/Centroid.java#L155-L175
63,304
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/DTWDistanceFunction.java
DTWDistanceFunction.firstRow
protected void firstRow(double[] buf, int band, NumberVector v1, NumberVector v2, int dim2) { // First cell: final double val1 = v1.doubleValue(0); buf[0] = delta(val1, v2.doubleValue(0)); // Width of valid area: final int w = (band >= dim2) ? dim2 - 1 : band; // Fill remaining part of buffer: ...
java
protected void firstRow(double[] buf, int band, NumberVector v1, NumberVector v2, int dim2) { // First cell: final double val1 = v1.doubleValue(0); buf[0] = delta(val1, v2.doubleValue(0)); // Width of valid area: final int w = (band >= dim2) ? dim2 - 1 : band; // Fill remaining part of buffer: ...
[ "protected", "void", "firstRow", "(", "double", "[", "]", "buf", ",", "int", "band", ",", "NumberVector", "v1", ",", "NumberVector", "v2", ",", "int", "dim2", ")", "{", "// First cell:", "final", "double", "val1", "=", "v1", ".", "doubleValue", "(", "0",...
Fill the first row. @param buf Buffer @param band Bandwidth @param v1 First vector @param v2 Second vector @param dim2 Dimensionality of second
[ "Fill", "the", "first", "row", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/DTWDistanceFunction.java#L137-L148
63,305
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/GaussStddevWeight.java
GaussStddevWeight.getWeight
@Override public double getWeight(double distance, double max, double stddev) { if(stddev <= 0) { return 1; } double normdistance = distance / stddev; return scaling * FastMath.exp(-.5 * normdistance * normdistance) / stddev; }
java
@Override public double getWeight(double distance, double max, double stddev) { if(stddev <= 0) { return 1; } double normdistance = distance / stddev; return scaling * FastMath.exp(-.5 * normdistance * normdistance) / stddev; }
[ "@", "Override", "public", "double", "getWeight", "(", "double", "distance", ",", "double", "max", ",", "double", "stddev", ")", "{", "if", "(", "stddev", "<=", "0", ")", "{", "return", "1", ";", "}", "double", "normdistance", "=", "distance", "/", "st...
Get Gaussian Weight using standard deviation for scaling. max is ignored.
[ "Get", "Gaussian", "Weight", "using", "standard", "deviation", "for", "scaling", ".", "max", "is", "ignored", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/GaussStddevWeight.java#L44-L51
63,306
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/TokenizedReader.java
TokenizedReader.nextLineExceptComments
public boolean nextLineExceptComments() throws IOException { while(nextLine()) { if(comment == null || !comment.reset(buf).matches()) { tokenizer.initialize(buf, 0, buf.length()); return true; } } return false; }
java
public boolean nextLineExceptComments() throws IOException { while(nextLine()) { if(comment == null || !comment.reset(buf).matches()) { tokenizer.initialize(buf, 0, buf.length()); return true; } } return false; }
[ "public", "boolean", "nextLineExceptComments", "(", ")", "throws", "IOException", "{", "while", "(", "nextLine", "(", ")", ")", "{", "if", "(", "comment", "==", "null", "||", "!", "comment", ".", "reset", "(", "buf", ")", ".", "matches", "(", ")", ")",...
Read the next line into the tokenizer. @return The next line, or {@code null}.
[ "Read", "the", "next", "line", "into", "the", "tokenizer", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/TokenizedReader.java#L64-L72
63,307
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGArrow.java
SVGArrow.makeArrow
public static Element makeArrow(SVGPlot svgp, Direction dir, double x, double y, double size) { final double hs = size / 2.; switch(dir){ case LEFT: return new SVGPath().drawTo(x + hs, y + hs).drawTo(x - hs, y).drawTo(x + hs, y - hs).drawTo(x + hs, y + hs).close().makeElement(svgp); case DOWN: ...
java
public static Element makeArrow(SVGPlot svgp, Direction dir, double x, double y, double size) { final double hs = size / 2.; switch(dir){ case LEFT: return new SVGPath().drawTo(x + hs, y + hs).drawTo(x - hs, y).drawTo(x + hs, y - hs).drawTo(x + hs, y + hs).close().makeElement(svgp); case DOWN: ...
[ "public", "static", "Element", "makeArrow", "(", "SVGPlot", "svgp", ",", "Direction", "dir", ",", "double", "x", ",", "double", "y", ",", "double", "size", ")", "{", "final", "double", "hs", "=", "size", "/", "2.", ";", "switch", "(", "dir", ")", "{"...
Draw an arrow at the given position. Note: the arrow is an unstyled svg path. You need to apply style afterwards. @param svgp Plot to draw to @param dir Direction to draw @param x Center x coordinate @param y Center y coordinate @param size Arrow size @return SVG Element
[ "Draw", "an", "arrow", "at", "the", "given", "position", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGArrow.java#L66-L81
63,308
elki-project/elki
elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/set/HammingDistanceFunction.java
HammingDistanceFunction.hammingDistanceNumberVector
private double hammingDistanceNumberVector(NumberVector o1, NumberVector o2) { final int d1 = o1.getDimensionality(), d2 = o2.getDimensionality(); int differences = 0; int d = 0; for(; d < d1 && d < d2; d++) { double v1 = o1.doubleValue(d), v2 = o2.doubleValue(d); if(v1 != v1 || v2 != v2) { ...
java
private double hammingDistanceNumberVector(NumberVector o1, NumberVector o2) { final int d1 = o1.getDimensionality(), d2 = o2.getDimensionality(); int differences = 0; int d = 0; for(; d < d1 && d < d2; d++) { double v1 = o1.doubleValue(d), v2 = o2.doubleValue(d); if(v1 != v1 || v2 != v2) { ...
[ "private", "double", "hammingDistanceNumberVector", "(", "NumberVector", "o1", ",", "NumberVector", "o2", ")", "{", "final", "int", "d1", "=", "o1", ".", "getDimensionality", "(", ")", ",", "d2", "=", "o2", ".", "getDimensionality", "(", ")", ";", "int", "...
Version for number vectors. @param o1 First vector @param o2 Second vector @return hamming distance
[ "Version", "for", "number", "vectors", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/set/HammingDistanceFunction.java#L126-L152
63,309
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/HilbertSpatialSorter.java
HilbertSpatialSorter.interleaveBits
public static long[] interleaveBits(long[] coords, int iter) { final int numdim = coords.length; final long[] bitset = BitsUtil.zero(numdim); // convert longValues into zValues final long mask = 1L << 63 - iter; for(int dim = 0; dim < numdim; dim++) { if((coords[dim] & mask) != 0) { Bi...
java
public static long[] interleaveBits(long[] coords, int iter) { final int numdim = coords.length; final long[] bitset = BitsUtil.zero(numdim); // convert longValues into zValues final long mask = 1L << 63 - iter; for(int dim = 0; dim < numdim; dim++) { if((coords[dim] & mask) != 0) { Bi...
[ "public", "static", "long", "[", "]", "interleaveBits", "(", "long", "[", "]", "coords", ",", "int", "iter", ")", "{", "final", "int", "numdim", "=", "coords", ".", "length", ";", "final", "long", "[", "]", "bitset", "=", "BitsUtil", ".", "zero", "("...
Select the "iter" highest bit from each dimension. @param coords Input coordinates @param iter Bit position (from highest position) @return One bit per dimension
[ "Select", "the", "iter", "highest", "bit", "from", "each", "dimension", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/HilbertSpatialSorter.java#L290-L301
63,310
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizationTree.java
VisualizationTree.visChanged
public void visChanged(VisualizationItem item) { for(int i = vlistenerList.size(); --i >= 0;) { final VisualizationListener listener = vlistenerList.get(i); if(listener != null) { listener.visualizationChanged(item); } } }
java
public void visChanged(VisualizationItem item) { for(int i = vlistenerList.size(); --i >= 0;) { final VisualizationListener listener = vlistenerList.get(i); if(listener != null) { listener.visualizationChanged(item); } } }
[ "public", "void", "visChanged", "(", "VisualizationItem", "item", ")", "{", "for", "(", "int", "i", "=", "vlistenerList", ".", "size", "(", ")", ";", "--", "i", ">=", "0", ";", ")", "{", "final", "VisualizationListener", "listener", "=", "vlistenerList", ...
A visualization item has changed. @param item Item that has changed
[ "A", "visualization", "item", "has", "changed", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizationTree.java#L85-L92
63,311
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizationTree.java
VisualizationTree.setVisible
public static void setVisible(VisualizerContext context, VisualizationTask task, boolean visibility) { // Hide other tools if(visibility && task.isTool()) { Hierarchy<Object> vistree = context.getVisHierarchy(); for(It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); ite...
java
public static void setVisible(VisualizerContext context, VisualizationTask task, boolean visibility) { // Hide other tools if(visibility && task.isTool()) { Hierarchy<Object> vistree = context.getVisHierarchy(); for(It<VisualizationTask> iter2 = vistree.iterAll().filter(VisualizationTask.class); ite...
[ "public", "static", "void", "setVisible", "(", "VisualizerContext", "context", ",", "VisualizationTask", "task", ",", "boolean", "visibility", ")", "{", "// Hide other tools", "if", "(", "visibility", "&&", "task", ".", "isTool", "(", ")", ")", "{", "Hierarchy",...
Utility function to change Visualizer visibility. @param context Visualization context @param task Visualization task @param visibility Visibility value
[ "Utility", "function", "to", "change", "Visualizer", "visibility", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizationTree.java#L221-L233
63,312
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AGNES.java
AGNES.findMerge
protected int findMerge(int end, MatrixParadigm mat, PointerHierarchyRepresentationBuilder builder) { assert (end > 0); final DBIDArrayIter ix = mat.ix, iy = mat.iy; final double[] matrix = mat.matrix; double mindist = Double.POSITIVE_INFINITY; int x = -1, y = -1; // Find minimum: for(int ox...
java
protected int findMerge(int end, MatrixParadigm mat, PointerHierarchyRepresentationBuilder builder) { assert (end > 0); final DBIDArrayIter ix = mat.ix, iy = mat.iy; final double[] matrix = mat.matrix; double mindist = Double.POSITIVE_INFINITY; int x = -1, y = -1; // Find minimum: for(int ox...
[ "protected", "int", "findMerge", "(", "int", "end", ",", "MatrixParadigm", "mat", ",", "PointerHierarchyRepresentationBuilder", "builder", ")", "{", "assert", "(", "end", ">", "0", ")", ";", "final", "DBIDArrayIter", "ix", "=", "mat", ".", "ix", ",", "iy", ...
Perform the next merge step in AGNES. @param end Active set size @param mat Matrix storage @param builder Pointer representation builder @return the index that has disappeared, for shrinking the working set
[ "Perform", "the", "next", "merge", "step", "in", "AGNES", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AGNES.java#L224-L254
63,313
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/TextbookMultivariateGaussianModel.java
TextbookMultivariateGaussianModel.updateCholesky
private void updateCholesky() { // TODO: further improve handling of degenerated cases? CholeskyDecomposition chol = new CholeskyDecomposition(covariance); if(!chol.isSPD()) { // Add a small value to the diagonal, to reduce some rounding problems. double s = 0.; for(int i = 0; i < covarian...
java
private void updateCholesky() { // TODO: further improve handling of degenerated cases? CholeskyDecomposition chol = new CholeskyDecomposition(covariance); if(!chol.isSPD()) { // Add a small value to the diagonal, to reduce some rounding problems. double s = 0.; for(int i = 0; i < covarian...
[ "private", "void", "updateCholesky", "(", ")", "{", "// TODO: further improve handling of degenerated cases?", "CholeskyDecomposition", "chol", "=", "new", "CholeskyDecomposition", "(", "covariance", ")", ";", "if", "(", "!", "chol", ".", "isSPD", "(", ")", ")", "{"...
Update the cholesky decomposition.
[ "Update", "the", "cholesky", "decomposition", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/TextbookMultivariateGaussianModel.java#L203-L225
63,314
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java
ClassParameter.validate
@Override public boolean validate(Class<? extends C> obj) throws ParameterException { if(obj == null) { throw new UnspecifiedParameterException(this); } if(!restrictionClass.isAssignableFrom(obj)) { throw new WrongParameterValueException(this, obj.getName(), "Given class not a subclass / imple...
java
@Override public boolean validate(Class<? extends C> obj) throws ParameterException { if(obj == null) { throw new UnspecifiedParameterException(this); } if(!restrictionClass.isAssignableFrom(obj)) { throw new WrongParameterValueException(this, obj.getName(), "Given class not a subclass / imple...
[ "@", "Override", "public", "boolean", "validate", "(", "Class", "<", "?", "extends", "C", ">", "obj", ")", "throws", "ParameterException", "{", "if", "(", "obj", "==", "null", ")", "{", "throw", "new", "UnspecifiedParameterException", "(", "this", ")", ";"...
Checks if the given parameter value is valid for this ClassParameter. If not a parameter exception is thrown.
[ "Checks", "if", "the", "given", "parameter", "value", "is", "valid", "for", "this", "ClassParameter", ".", "If", "not", "a", "parameter", "exception", "is", "thrown", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java#L139-L148
63,315
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/AbstractVisualization.java
AbstractVisualization.addListeners
protected void addListeners() { // Listen for result changes, including the one we monitor context.addResultListener(this); context.addVisualizationListener(this); // Listen for database events only when needed. if(task.has(UpdateFlag.ON_DATA)) { context.addDataStoreListener(this); } }
java
protected void addListeners() { // Listen for result changes, including the one we monitor context.addResultListener(this); context.addVisualizationListener(this); // Listen for database events only when needed. if(task.has(UpdateFlag.ON_DATA)) { context.addDataStoreListener(this); } }
[ "protected", "void", "addListeners", "(", ")", "{", "// Listen for result changes, including the one we monitor", "context", ".", "addResultListener", "(", "this", ")", ";", "context", ".", "addVisualizationListener", "(", "this", ")", ";", "// Listen for database events on...
Add the listeners according to the mask.
[ "Add", "the", "listeners", "according", "to", "the", "mask", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/AbstractVisualization.java#L102-L110
63,316
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java
GeneratorSingleCluster.addGenerator
public void addGenerator(Distribution gen) { if(trans != null) { throw new AbortException("Generators may no longer be added when transformations have been applied."); } axes.add(gen); dim++; }
java
public void addGenerator(Distribution gen) { if(trans != null) { throw new AbortException("Generators may no longer be added when transformations have been applied."); } axes.add(gen); dim++; }
[ "public", "void", "addGenerator", "(", "Distribution", "gen", ")", "{", "if", "(", "trans", "!=", "null", ")", "{", "throw", "new", "AbortException", "(", "\"Generators may no longer be added when transformations have been applied.\"", ")", ";", "}", "axes", ".", "a...
Add a new generator to the cluster. No transformations must have been added so far! @param gen Distribution generator
[ "Add", "a", "new", "generator", "to", "the", "cluster", ".", "No", "transformations", "must", "have", "been", "added", "so", "far!" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java#L119-L125
63,317
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java
GeneratorSingleCluster.addRotation
public void addRotation(int axis1, int axis2, double angle) { if(trans == null) { trans = new AffineTransformation(dim); } trans.addRotation(axis1, axis2, angle); }
java
public void addRotation(int axis1, int axis2, double angle) { if(trans == null) { trans = new AffineTransformation(dim); } trans.addRotation(axis1, axis2, angle); }
[ "public", "void", "addRotation", "(", "int", "axis1", ",", "int", "axis2", ",", "double", "angle", ")", "{", "if", "(", "trans", "==", "null", ")", "{", "trans", "=", "new", "AffineTransformation", "(", "dim", ")", ";", "}", "trans", ".", "addRotation"...
Apply a rotation to the generator @param axis1 First axis (0 &lt;= axis1 &lt; dim) @param axis2 Second axis (0 &lt;= axis2 &lt; dim) @param angle Angle in Radians
[ "Apply", "a", "rotation", "to", "the", "generator" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java#L134-L139
63,318
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java
GeneratorSingleCluster.addTranslation
public void addTranslation(double[] v) { if(trans == null) { trans = new AffineTransformation(dim); } trans.addTranslation(v); }
java
public void addTranslation(double[] v) { if(trans == null) { trans = new AffineTransformation(dim); } trans.addTranslation(v); }
[ "public", "void", "addTranslation", "(", "double", "[", "]", "v", ")", "{", "if", "(", "trans", "==", "null", ")", "{", "trans", "=", "new", "AffineTransformation", "(", "dim", ")", ";", "}", "trans", ".", "addTranslation", "(", "v", ")", ";", "}" ]
Add a translation to the generator @param v translation double[]
[ "Add", "a", "translation", "to", "the", "generator" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java#L146-L151
63,319
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java
GeneratorSingleCluster.generate
@Override public List<double[]> generate(int count) { ArrayList<double[]> result = new ArrayList<>(count); while(result.size() < count) { double[] d = new double[dim]; for(int i = 0; i < dim; i++) { d[i] = axes.get(i).nextRandom(); } if(trans != null) { d = trans.apply(...
java
@Override public List<double[]> generate(int count) { ArrayList<double[]> result = new ArrayList<>(count); while(result.size() < count) { double[] d = new double[dim]; for(int i = 0; i < dim; i++) { d[i] = axes.get(i).nextRandom(); } if(trans != null) { d = trans.apply(...
[ "@", "Override", "public", "List", "<", "double", "[", "]", ">", "generate", "(", "int", "count", ")", "{", "ArrayList", "<", "double", "[", "]", ">", "result", "=", "new", "ArrayList", "<>", "(", "count", ")", ";", "while", "(", "result", ".", "si...
Generate the given number of additional points. @see de.lmu.ifi.dbs.elki.data.synthetic.bymodel.GeneratorInterface#generate(int)
[ "Generate", "the", "given", "number", "of", "additional", "points", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/data/synthetic/bymodel/GeneratorSingleCluster.java#L221-L241
63,320
elki-project/elki
addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java
SameSizeKMeansAlgorithm.run
@Override public Clustering<MeanModel> run(Database database, Relation<V> relation) { // Database objects to process final DBIDs ids = relation.getDBIDs(); // Choose initial means double[][] means = initializer.chooseInitialMeans(database, relation, k, getDistanceFunction()); // Setup cluster assi...
java
@Override public Clustering<MeanModel> run(Database database, Relation<V> relation) { // Database objects to process final DBIDs ids = relation.getDBIDs(); // Choose initial means double[][] means = initializer.chooseInitialMeans(database, relation, k, getDistanceFunction()); // Setup cluster assi...
[ "@", "Override", "public", "Clustering", "<", "MeanModel", ">", "run", "(", "Database", "database", ",", "Relation", "<", "V", ">", "relation", ")", "{", "// Database objects to process", "final", "DBIDs", "ids", "=", "relation", ".", "getDBIDs", "(", ")", "...
Run k-means with cluster size constraints. @param database Database @param relation relation to use @return result
[ "Run", "k", "-", "means", "with", "cluster", "size", "constraints", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java#L108-L135
63,321
elki-project/elki
addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java
SameSizeKMeansAlgorithm.initializeMeta
protected WritableDataStore<Meta> initializeMeta(Relation<V> relation, double[][] means) { NumberVectorDistanceFunction<? super V> df = getDistanceFunction(); // The actual storage final WritableDataStore<Meta> metas = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFacto...
java
protected WritableDataStore<Meta> initializeMeta(Relation<V> relation, double[][] means) { NumberVectorDistanceFunction<? super V> df = getDistanceFunction(); // The actual storage final WritableDataStore<Meta> metas = DataStoreUtil.makeStorage(relation.getDBIDs(), DataStoreFactory.HINT_HOT | DataStoreFacto...
[ "protected", "WritableDataStore", "<", "Meta", ">", "initializeMeta", "(", "Relation", "<", "V", ">", "relation", ",", "double", "[", "]", "[", "]", "means", ")", "{", "NumberVectorDistanceFunction", "<", "?", "super", "V", ">", "df", "=", "getDistanceFuncti...
Initialize the metadata storage. @param relation Relation to process @param means Mean vectors @return Initialized storage
[ "Initialize", "the", "metadata", "storage", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java#L144-L166
63,322
elki-project/elki
addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java
SameSizeKMeansAlgorithm.transfer
protected void transfer(final WritableDataStore<Meta> metas, Meta meta, ModifiableDBIDs src, ModifiableDBIDs dst, DBIDRef id, int dstnum) { src.remove(id); dst.add(id); meta.primary = dstnum; metas.put(id, meta); // Make sure the storage is up to date. }
java
protected void transfer(final WritableDataStore<Meta> metas, Meta meta, ModifiableDBIDs src, ModifiableDBIDs dst, DBIDRef id, int dstnum) { src.remove(id); dst.add(id); meta.primary = dstnum; metas.put(id, meta); // Make sure the storage is up to date. }
[ "protected", "void", "transfer", "(", "final", "WritableDataStore", "<", "Meta", ">", "metas", ",", "Meta", "meta", ",", "ModifiableDBIDs", "src", ",", "ModifiableDBIDs", "dst", ",", "DBIDRef", "id", ",", "int", "dstnum", ")", "{", "src", ".", "remove", "(...
Transfer a single element from one cluster to another. @param metas Meta storage @param meta Meta of current object @param src Source cluster @param dst Destination cluster @param id Object ID @param dstnum Destination cluster number
[ "Transfer", "a", "single", "element", "from", "one", "cluster", "to", "another", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/tutorial/src/main/java/tutorial/clustering/SameSizeKMeansAlgorithm.java#L357-L362
63,323
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HoeffdingsDDependenceMeasure.java
HoeffdingsDDependenceMeasure.toPValue
public double toPValue(double d, int n) { double b = d / 30 + 1. / (36 * n); double z = .5 * MathUtil.PISQUARE * MathUtil.PISQUARE * n * b; // Exponential approximation if(z < 1.1 || z > 8.5) { double e = FastMath.exp(0.3885037 - 1.164879 * z); return (e > 1) ? 1 : (e < 0) ? 0 : e; } ...
java
public double toPValue(double d, int n) { double b = d / 30 + 1. / (36 * n); double z = .5 * MathUtil.PISQUARE * MathUtil.PISQUARE * n * b; // Exponential approximation if(z < 1.1 || z > 8.5) { double e = FastMath.exp(0.3885037 - 1.164879 * z); return (e > 1) ? 1 : (e < 0) ? 0 : e; } ...
[ "public", "double", "toPValue", "(", "double", "d", ",", "int", "n", ")", "{", "double", "b", "=", "d", "/", "30", "+", "1.", "/", "(", "36", "*", "n", ")", ";", "double", "z", "=", ".5", "*", "MathUtil", ".", "PISQUARE", "*", "MathUtil", ".", ...
Convert Hoeffding D value to a p-value. @param d D value @param n Data set size @return p-value
[ "Convert", "Hoeffding", "D", "value", "to", "a", "p", "-", "value", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HoeffdingsDDependenceMeasure.java#L170-L193
63,324
elki-project/elki
elki-core-parallel/src/main/java/de/lmu/ifi/dbs/elki/parallel/ParallelExecutor.java
ParallelExecutor.run
public static void run(DBIDs ids, Processor... procs) { ParallelCore core = ParallelCore.getCore(); core.connect(); try { // TODO: try different strategies anyway! ArrayDBIDs aids = DBIDUtil.ensureArray(ids); final int size = aids.size(); int numparts = core.getParallelism(); /...
java
public static void run(DBIDs ids, Processor... procs) { ParallelCore core = ParallelCore.getCore(); core.connect(); try { // TODO: try different strategies anyway! ArrayDBIDs aids = DBIDUtil.ensureArray(ids); final int size = aids.size(); int numparts = core.getParallelism(); /...
[ "public", "static", "void", "run", "(", "DBIDs", "ids", ",", "Processor", "...", "procs", ")", "{", "ParallelCore", "core", "=", "ParallelCore", ".", "getCore", "(", ")", ";", "core", ".", "connect", "(", ")", ";", "try", "{", "// TODO: try different strat...
Run a task on all available CPUs. @param ids IDs to process @param procs Processors to run
[ "Run", "a", "task", "on", "all", "available", "CPUs", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-parallel/src/main/java/de/lmu/ifi/dbs/elki/parallel/ParallelExecutor.java#L63-L96
63,325
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java
OPTICSPlot.replot
public void replot() { width = co.size(); height = (int) Math.ceil(width * .2); ratio = width / (double) height; height = height < MIN_HEIGHT ? MIN_HEIGHT : height > MAX_HEIGHT ? MAX_HEIGHT : height; if(scale == null) { scale = computeScale(co); } BufferedImage img = new BufferedImage...
java
public void replot() { width = co.size(); height = (int) Math.ceil(width * .2); ratio = width / (double) height; height = height < MIN_HEIGHT ? MIN_HEIGHT : height > MAX_HEIGHT ? MAX_HEIGHT : height; if(scale == null) { scale = computeScale(co); } BufferedImage img = new BufferedImage...
[ "public", "void", "replot", "(", ")", "{", "width", "=", "co", ".", "size", "(", ")", ";", "height", "=", "(", "int", ")", "Math", ".", "ceil", "(", "width", "*", ".2", ")", ";", "ratio", "=", "width", "/", "(", "double", ")", "height", ";", ...
Trigger a redraw of the OPTICS plot
[ "Trigger", "a", "redraw", "of", "the", "OPTICS", "plot" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java#L111-L139
63,326
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java
OPTICSPlot.scaleToPixel
public int scaleToPixel(double reach) { return (Double.isInfinite(reach) || Double.isNaN(reach)) ? 0 : // (int) Math.round(scale.getScaled(reach, height - .5, .5)); }
java
public int scaleToPixel(double reach) { return (Double.isInfinite(reach) || Double.isNaN(reach)) ? 0 : // (int) Math.round(scale.getScaled(reach, height - .5, .5)); }
[ "public", "int", "scaleToPixel", "(", "double", "reach", ")", "{", "return", "(", "Double", ".", "isInfinite", "(", "reach", ")", "||", "Double", ".", "isNaN", "(", "reach", ")", ")", "?", "0", ":", "//", "(", "int", ")", "Math", ".", "round", "(",...
Scale a reachability distance to a pixel value. @param reach Reachability @return Pixel value.
[ "Scale", "a", "reachability", "distance", "to", "a", "pixel", "value", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java#L147-L150
63,327
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java
OPTICSPlot.getSVGPlotURI
public String getSVGPlotURI() { if(plotnum < 0) { plotnum = ThumbnailRegistryEntry.registerImage(plot); } return ThumbnailRegistryEntry.INTERNAL_PREFIX + plotnum; }
java
public String getSVGPlotURI() { if(plotnum < 0) { plotnum = ThumbnailRegistryEntry.registerImage(plot); } return ThumbnailRegistryEntry.INTERNAL_PREFIX + plotnum; }
[ "public", "String", "getSVGPlotURI", "(", ")", "{", "if", "(", "plotnum", "<", "0", ")", "{", "plotnum", "=", "ThumbnailRegistryEntry", ".", "registerImage", "(", "plot", ")", ";", "}", "return", "ThumbnailRegistryEntry", ".", "INTERNAL_PREFIX", "+", "plotnum"...
Get the SVG registered plot number @return Plot URI
[ "Get", "the", "SVG", "registered", "plot", "number" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java#L252-L257
63,328
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java
OPTICSPlot.plotForClusterOrder
public static OPTICSPlot plotForClusterOrder(ClusterOrder co, VisualizerContext context) { // Check for an existing plot // ArrayList<OPTICSPlot<D>> plots = ResultUtil.filterResults(co, // OPTICSPlot.class); // if (plots.size() > 0) { // return plots.get(0); // } final StylingPolicy policy =...
java
public static OPTICSPlot plotForClusterOrder(ClusterOrder co, VisualizerContext context) { // Check for an existing plot // ArrayList<OPTICSPlot<D>> plots = ResultUtil.filterResults(co, // OPTICSPlot.class); // if (plots.size() > 0) { // return plots.get(0); // } final StylingPolicy policy =...
[ "public", "static", "OPTICSPlot", "plotForClusterOrder", "(", "ClusterOrder", "co", ",", "VisualizerContext", "context", ")", "{", "// Check for an existing plot", "// ArrayList<OPTICSPlot<D>> plots = ResultUtil.filterResults(co,", "// OPTICSPlot.class);", "// if (plots.size() > 0) {",...
Static method to find an optics plot for a result, or to create a new one using the given context. @param co Cluster order @param context Context (for colors and reference clustering) @return New or existing optics plot
[ "Static", "method", "to", "find", "an", "optics", "plot", "for", "a", "result", "or", "to", "create", "a", "new", "one", "using", "the", "given", "context", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSPlot.java#L278-L289
63,329
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LUDecomposition.java
LUDecomposition.inverse
public double[][] inverse() { // Build permuted identity matrix efficiently: double[][] b = new double[piv.length][m]; for(int i = 0; i < piv.length; i++) { b[piv[i]][i] = 1.; } return solveInplace(b); }
java
public double[][] inverse() { // Build permuted identity matrix efficiently: double[][] b = new double[piv.length][m]; for(int i = 0; i < piv.length; i++) { b[piv[i]][i] = 1.; } return solveInplace(b); }
[ "public", "double", "[", "]", "[", "]", "inverse", "(", ")", "{", "// Build permuted identity matrix efficiently:", "double", "[", "]", "[", "]", "b", "=", "new", "double", "[", "piv", ".", "length", "]", "[", "m", "]", ";", "for", "(", "int", "i", "...
Find the inverse matrix. @return Inverse matrix @throws ArithmeticException Matrix is rank deficient.
[ "Find", "the", "inverse", "matrix", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/LUDecomposition.java#L330-L337
63,330
elki-project/elki
elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/SimplePolygonParser.java
SimplePolygonParser.parseLine
private boolean parseLine() { cureid = null; curpoly = null; curlbl = null; polys.clear(); coords.clear(); labels.clear(); Matcher m = COORD.matcher(reader.getBuffer()); for(/* initialized by nextLineExceptComments */; tokenizer.valid(); tokenizer.advance()) { m.region(tokenizer.g...
java
private boolean parseLine() { cureid = null; curpoly = null; curlbl = null; polys.clear(); coords.clear(); labels.clear(); Matcher m = COORD.matcher(reader.getBuffer()); for(/* initialized by nextLineExceptComments */; tokenizer.valid(); tokenizer.advance()) { m.region(tokenizer.g...
[ "private", "boolean", "parseLine", "(", ")", "{", "cureid", "=", "null", ";", "curpoly", "=", "null", ";", "curlbl", "=", "null", ";", "polys", ".", "clear", "(", ")", ";", "coords", ".", "clear", "(", ")", ";", "labels", ".", "clear", "(", ")", ...
Parse a single line. @return {@code true} if the line was read successful.
[ "Parse", "a", "single", "line", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/SimplePolygonParser.java#L181-L235
63,331
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/workflow/OutputStep.java
OutputStep.runResultHandlers
public void runResultHandlers(ResultHierarchy hier, Database db) { // Run result handlers for(ResultHandler resulthandler : resulthandlers) { Thread.currentThread().setName(resulthandler.toString()); resulthandler.processNewResult(hier, db); } }
java
public void runResultHandlers(ResultHierarchy hier, Database db) { // Run result handlers for(ResultHandler resulthandler : resulthandlers) { Thread.currentThread().setName(resulthandler.toString()); resulthandler.processNewResult(hier, db); } }
[ "public", "void", "runResultHandlers", "(", "ResultHierarchy", "hier", ",", "Database", "db", ")", "{", "// Run result handlers", "for", "(", "ResultHandler", "resulthandler", ":", "resulthandlers", ")", "{", "Thread", ".", "currentThread", "(", ")", ".", "setName...
Run the result handlers. @param hier Result to run on @param db Database
[ "Run", "the", "result", "handlers", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/workflow/OutputStep.java#L66-L72
63,332
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/workflow/OutputStep.java
OutputStep.setDefaultHandlerVisualizer
@SuppressWarnings("unchecked") public static void setDefaultHandlerVisualizer() { defaultHandlers = new ArrayList<>(1); Class<? extends ResultHandler> clz; try { clz = (Class<? extends ResultHandler>) Thread.currentThread().getContextClassLoader().loadClass(// "de.lmu.ifi.dbs.elki.result.A...
java
@SuppressWarnings("unchecked") public static void setDefaultHandlerVisualizer() { defaultHandlers = new ArrayList<>(1); Class<? extends ResultHandler> clz; try { clz = (Class<? extends ResultHandler>) Thread.currentThread().getContextClassLoader().loadClass(// "de.lmu.ifi.dbs.elki.result.A...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "void", "setDefaultHandlerVisualizer", "(", ")", "{", "defaultHandlers", "=", "new", "ArrayList", "<>", "(", "1", ")", ";", "Class", "<", "?", "extends", "ResultHandler", ">", "clz", ";", ...
Set the default handler to the Batik addon visualizer, if available.
[ "Set", "the", "default", "handler", "to", "the", "Batik", "addon", "visualizer", "if", "available", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/workflow/OutputStep.java#L85-L97
63,333
elki-project/elki
elki-core-parallel/src/main/java/de/lmu/ifi/dbs/elki/parallel/ParallelCore.java
ParallelCore.connect
public synchronized void connect() { if(executor == null) { executor = new ThreadPoolExecutor(0, processors, 10L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); executor.allowCoreThreadTimeOut(true); } if(++connected == 1) { executor.allowCoreThreadTimeOut(false); execu...
java
public synchronized void connect() { if(executor == null) { executor = new ThreadPoolExecutor(0, processors, 10L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); executor.allowCoreThreadTimeOut(true); } if(++connected == 1) { executor.allowCoreThreadTimeOut(false); execu...
[ "public", "synchronized", "void", "connect", "(", ")", "{", "if", "(", "executor", "==", "null", ")", "{", "executor", "=", "new", "ThreadPoolExecutor", "(", "0", ",", "processors", ",", "10L", ",", "TimeUnit", ".", "MILLISECONDS", ",", "new", "LinkedBlock...
Connect to the executor.
[ "Connect", "to", "the", "executor", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-parallel/src/main/java/de/lmu/ifi/dbs/elki/parallel/ParallelCore.java#L99-L108
63,334
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java
XYCurve.add
public void add(double x, double y) { data.add(x); data.add(y); minx = Math.min(minx, x); maxx = Math.max(maxx, x); miny = Math.min(miny, y); maxy = Math.max(maxy, y); }
java
public void add(double x, double y) { data.add(x); data.add(y); minx = Math.min(minx, x); maxx = Math.max(maxx, x); miny = Math.min(miny, y); maxy = Math.max(maxy, y); }
[ "public", "void", "add", "(", "double", "x", ",", "double", "y", ")", "{", "data", ".", "add", "(", "x", ")", ";", "data", ".", "add", "(", "y", ")", ";", "minx", "=", "Math", ".", "min", "(", "minx", ",", "x", ")", ";", "maxx", "=", "Math"...
Add a coordinate pair, but don't simplify @param x X coordinate @param y Y coordinate
[ "Add", "a", "coordinate", "pair", "but", "don", "t", "simplify" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java#L134-L141
63,335
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java
XYCurve.addAndSimplify
public void addAndSimplify(double x, double y) { // simplify curve when possible: final int len = data.size(); if (len >= 4) { // Look at the previous 2 points final double l1x = data.get(len - 4); final double l1y = data.get(len - 3); final double l2x = data.get(len - 2); fina...
java
public void addAndSimplify(double x, double y) { // simplify curve when possible: final int len = data.size(); if (len >= 4) { // Look at the previous 2 points final double l1x = data.get(len - 4); final double l1y = data.get(len - 3); final double l2x = data.get(len - 2); fina...
[ "public", "void", "addAndSimplify", "(", "double", "x", ",", "double", "y", ")", "{", "// simplify curve when possible:", "final", "int", "len", "=", "data", ".", "size", "(", ")", ";", "if", "(", "len", ">=", "4", ")", "{", "// Look at the previous 2 points...
Add a coordinate pair, performing curve simplification if possible. @param x X coordinate @param y Y coordinate
[ "Add", "a", "coordinate", "pair", "performing", "curve", "simplification", "if", "possible", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java#L149-L179
63,336
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java
XYCurve.rescale
public void rescale(double sx, double sy) { for (int i = 0; i < data.size(); i += 2) { data.set(i, sx * data.get(i)); data.set(i + 1, sy * data.get(i + 1)); } maxx *= sx; maxy *= sy; }
java
public void rescale(double sx, double sy) { for (int i = 0; i < data.size(); i += 2) { data.set(i, sx * data.get(i)); data.set(i + 1, sy * data.get(i + 1)); } maxx *= sx; maxy *= sy; }
[ "public", "void", "rescale", "(", "double", "sx", ",", "double", "sy", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "data", ".", "size", "(", ")", ";", "i", "+=", "2", ")", "{", "data", ".", "set", "(", "i", ",", "sx", "*", ...
Rescale the graph. @param sx Scaling factor for X axis @param sy Scaling factor for Y axis
[ "Rescale", "the", "graph", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYCurve.java#L261-L268
63,337
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/insert/MinimumEnlargementInsert.java
MinimumEnlargementInsert.choosePath
private IndexTreePath<E> choosePath(AbstractMTree<?, N, E, ?> tree, E object, IndexTreePath<E> subtree) { N node = tree.getNode(subtree.getEntry()); // leaf if(node.isLeaf()) { return subtree; } // Initialize from first: int bestIdx = 0; E bestEntry = node.getEntry(0); double bes...
java
private IndexTreePath<E> choosePath(AbstractMTree<?, N, E, ?> tree, E object, IndexTreePath<E> subtree) { N node = tree.getNode(subtree.getEntry()); // leaf if(node.isLeaf()) { return subtree; } // Initialize from first: int bestIdx = 0; E bestEntry = node.getEntry(0); double bes...
[ "private", "IndexTreePath", "<", "E", ">", "choosePath", "(", "AbstractMTree", "<", "?", ",", "N", ",", "E", ",", "?", ">", "tree", ",", "E", "object", ",", "IndexTreePath", "<", "E", ">", "subtree", ")", "{", "N", "node", "=", "tree", ".", "getNod...
Chooses the best path of the specified subtree for insertion of the given object. @param tree the tree to insert into @param object the entry to search @param subtree the subtree to be tested for insertion @return the path of the appropriate subtree to insert the given object
[ "Chooses", "the", "best", "path", "of", "the", "specified", "subtree", "for", "insertion", "of", "the", "given", "object", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/insert/MinimumEnlargementInsert.java#L61-L86
63,338
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/MergedParameterization.java
MergedParameterization.rewind
public void rewind() { synchronized(used) { for(ParameterPair pair : used) { current.addParameter(pair); } used.clear(); } }
java
public void rewind() { synchronized(used) { for(ParameterPair pair : used) { current.addParameter(pair); } used.clear(); } }
[ "public", "void", "rewind", "(", ")", "{", "synchronized", "(", "used", ")", "{", "for", "(", "ParameterPair", "pair", ":", "used", ")", "{", "current", ".", "addParameter", "(", "pair", ")", ";", "}", "used", ".", "clear", "(", ")", ";", "}", "}" ...
Rewind the configuration to the initial situation
[ "Rewind", "the", "configuration", "to", "the", "initial", "situation" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameterization/MergedParameterization.java#L86-L93
63,339
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/estimator/UniformEnhancedMinMaxEstimator.java
UniformEnhancedMinMaxEstimator.estimate
public UniformDistribution estimate(double min, double max, final int count) { double grow = (count > 1) ? 0.5 * (max - min) / (count - 1) : 0.; return new UniformDistribution(Math.max(min - grow, -Double.MAX_VALUE), Math.min(max + grow, Double.MAX_VALUE)); }
java
public UniformDistribution estimate(double min, double max, final int count) { double grow = (count > 1) ? 0.5 * (max - min) / (count - 1) : 0.; return new UniformDistribution(Math.max(min - grow, -Double.MAX_VALUE), Math.min(max + grow, Double.MAX_VALUE)); }
[ "public", "UniformDistribution", "estimate", "(", "double", "min", ",", "double", "max", ",", "final", "int", "count", ")", "{", "double", "grow", "=", "(", "count", ">", "1", ")", "?", "0.5", "*", "(", "max", "-", "min", ")", "/", "(", "count", "-...
Estimate from simple characteristics. @param min Minimum @param max Maximum @param count Number of observations @return Distribution
[ "Estimate", "from", "simple", "characteristics", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/estimator/UniformEnhancedMinMaxEstimator.java#L71-L74
63,340
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/WeibullDistribution.java
WeibullDistribution.cdf
public static double cdf(double val, double k, double lambda, double theta) { return (val > theta) ? // (1.0 - FastMath.exp(-FastMath.pow((val - theta) / lambda, k))) // : val == val ? 0.0 : Double.NaN; }
java
public static double cdf(double val, double k, double lambda, double theta) { return (val > theta) ? // (1.0 - FastMath.exp(-FastMath.pow((val - theta) / lambda, k))) // : val == val ? 0.0 : Double.NaN; }
[ "public", "static", "double", "cdf", "(", "double", "val", ",", "double", "k", ",", "double", "lambda", ",", "double", "theta", ")", "{", "return", "(", "val", ">", "theta", ")", "?", "//", "(", "1.0", "-", "FastMath", ".", "exp", "(", "-", "FastMa...
CDF of Weibull distribution @param val Value @param k Shape parameter @param lambda Scale parameter @param theta Shift offset parameter @return CDF at position x.
[ "CDF", "of", "Weibull", "distribution" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/WeibullDistribution.java#L195-L199
63,341
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/WeibullDistribution.java
WeibullDistribution.quantile
public static double quantile(double val, double k, double lambda, double theta) { if(val < 0.0 || val > 1.0) { return Double.NaN; } else if(val == 0) { return 0.0; } else if(val == 1) { return Double.POSITIVE_INFINITY; } else { return theta + lambda * FastMath.pow(-F...
java
public static double quantile(double val, double k, double lambda, double theta) { if(val < 0.0 || val > 1.0) { return Double.NaN; } else if(val == 0) { return 0.0; } else if(val == 1) { return Double.POSITIVE_INFINITY; } else { return theta + lambda * FastMath.pow(-F...
[ "public", "static", "double", "quantile", "(", "double", "val", ",", "double", "k", ",", "double", "lambda", ",", "double", "theta", ")", "{", "if", "(", "val", "<", "0.0", "||", "val", ">", "1.0", ")", "{", "return", "Double", ".", "NaN", ";", "}"...
Quantile function of Weibull distribution @param val Value @param k Shape parameter @param lambda Scale parameter @param theta Shift offset parameter @return Quantile function at position x.
[ "Quantile", "function", "of", "Weibull", "distribution" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/WeibullDistribution.java#L215-L228
63,342
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCARunner.java
PCARunner.processIds
public PCAResult processIds(DBIDs ids, Relation<? extends NumberVector> database) { return processCovarMatrix(covarianceMatrixBuilder.processIds(ids, database)); }
java
public PCAResult processIds(DBIDs ids, Relation<? extends NumberVector> database) { return processCovarMatrix(covarianceMatrixBuilder.processIds(ids, database)); }
[ "public", "PCAResult", "processIds", "(", "DBIDs", "ids", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "database", ")", "{", "return", "processCovarMatrix", "(", "covarianceMatrixBuilder", ".", "processIds", "(", "ids", ",", "database", ")", ")", ...
Run PCA on a collection of database IDs. @param ids a collection of ids @param database the database used @return PCA result
[ "Run", "PCA", "on", "a", "collection", "of", "database", "IDs", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCARunner.java#L73-L75
63,343
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCARunner.java
PCARunner.processQueryResult
public PCAResult processQueryResult(DoubleDBIDList results, Relation<? extends NumberVector> database) { return processCovarMatrix(covarianceMatrixBuilder.processQueryResults(results, database)); }
java
public PCAResult processQueryResult(DoubleDBIDList results, Relation<? extends NumberVector> database) { return processCovarMatrix(covarianceMatrixBuilder.processQueryResults(results, database)); }
[ "public", "PCAResult", "processQueryResult", "(", "DoubleDBIDList", "results", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "database", ")", "{", "return", "processCovarMatrix", "(", "covarianceMatrixBuilder", ".", "processQueryResults", "(", "results", ...
Run PCA on a QueryResult Collection. @param results a collection of QueryResults @param database the database used @return PCA result
[ "Run", "PCA", "on", "a", "QueryResult", "Collection", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/PCARunner.java#L84-L86
63,344
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/QRDecomposition.java
QRDecomposition.isFullRank
public boolean isFullRank() { // Find maximum: double t = 0.; for(int j = 0; j < n; j++) { double v = Rdiag[j]; if(v == 0) { return false; } v = Math.abs(v); t = v > t ? v : t; } t *= 1e-15; // Numerical precision threshold. for(int j = 1; j < n; j++) { ...
java
public boolean isFullRank() { // Find maximum: double t = 0.; for(int j = 0; j < n; j++) { double v = Rdiag[j]; if(v == 0) { return false; } v = Math.abs(v); t = v > t ? v : t; } t *= 1e-15; // Numerical precision threshold. for(int j = 1; j < n; j++) { ...
[ "public", "boolean", "isFullRank", "(", ")", "{", "// Find maximum:", "double", "t", "=", "0.", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "n", ";", "j", "++", ")", "{", "double", "v", "=", "Rdiag", "[", "j", "]", ";", "if", "(", "...
Is the matrix full rank? @return true if R, and hence A, has full rank.
[ "Is", "the", "matrix", "full", "rank?" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/QRDecomposition.java#L143-L161
63,345
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/QRDecomposition.java
QRDecomposition.rank
public int rank(double t) { int rank = n; for(int j = 0; j < n; j++) { if(Math.abs(Rdiag[j]) <= t) { --rank; } } return rank; }
java
public int rank(double t) { int rank = n; for(int j = 0; j < n; j++) { if(Math.abs(Rdiag[j]) <= t) { --rank; } } return rank; }
[ "public", "int", "rank", "(", "double", "t", ")", "{", "int", "rank", "=", "n", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "n", ";", "j", "++", ")", "{", "if", "(", "Math", ".", "abs", "(", "Rdiag", "[", "j", "]", ")", "<=", ...
Get the matrix rank? @param t Tolerance threshold @return Rank of R
[ "Get", "the", "matrix", "rank?" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/QRDecomposition.java#L169-L177
63,346
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/XYPlotVisualization.java
XYPlotVisualization.setupCSS
private void setupCSS(VisualizerContext context, SVGPlot svgp, XYPlot plot) { StyleLibrary style = context.getStyleLibrary(); for(XYPlot.Curve curve : plot) { CSSClass csscls = new CSSClass(this, SERIESID + curve.getColor()); // csscls.setStatement(SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE, "0.2%"); ...
java
private void setupCSS(VisualizerContext context, SVGPlot svgp, XYPlot plot) { StyleLibrary style = context.getStyleLibrary(); for(XYPlot.Curve curve : plot) { CSSClass csscls = new CSSClass(this, SERIESID + curve.getColor()); // csscls.setStatement(SVGConstants.SVG_STROKE_WIDTH_ATTRIBUTE, "0.2%"); ...
[ "private", "void", "setupCSS", "(", "VisualizerContext", "context", ",", "SVGPlot", "svgp", ",", "XYPlot", "plot", ")", "{", "StyleLibrary", "style", "=", "context", ".", "getStyleLibrary", "(", ")", ";", "for", "(", "XYPlot", ".", "Curve", "curve", ":", "...
Setup the CSS classes for the plot. @param svgp Plot @param plot Plot to render
[ "Setup", "the", "CSS", "classes", "for", "the", "plot", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/visunproj/XYPlotVisualization.java#L135-L152
63,347
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/EigenPair.java
EigenPair.compareTo
@Override public int compareTo(EigenPair o) { if(this.eigenvalue < o.eigenvalue) { return -1; } if(this.eigenvalue > o.eigenvalue) { return +1; } return 0; }
java
@Override public int compareTo(EigenPair o) { if(this.eigenvalue < o.eigenvalue) { return -1; } if(this.eigenvalue > o.eigenvalue) { return +1; } return 0; }
[ "@", "Override", "public", "int", "compareTo", "(", "EigenPair", "o", ")", "{", "if", "(", "this", ".", "eigenvalue", "<", "o", ".", "eigenvalue", ")", "{", "return", "-", "1", ";", "}", "if", "(", "this", ".", "eigenvalue", ">", "o", ".", "eigenva...
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object's eigenvalue is greater than, equal to, or less than the specified object's eigenvalue. @param o the Eigenvector to be compared. @return a negative integer, zero, or a positive integer as th...
[ "Compares", "this", "object", "with", "the", "specified", "object", "for", "order", ".", "Returns", "a", "negative", "integer", "zero", "or", "a", "positive", "integer", "as", "this", "object", "s", "eigenvalue", "is", "greater", "than", "equal", "to", "or",...
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/EigenPair.java#L66-L75
63,348
elki-project/elki
elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/MixtureModelOutlierScaling.java
MixtureModelOutlierScaling.calcPosterior
protected static double calcPosterior(double f, double alpha, double mu, double sigma, double lambda) { final double pi = calcP_i(f, mu, sigma); final double qi = calcQ_i(f, lambda); return (alpha * pi) / (alpha * pi + (1.0 - alpha) * qi); }
java
protected static double calcPosterior(double f, double alpha, double mu, double sigma, double lambda) { final double pi = calcP_i(f, mu, sigma); final double qi = calcQ_i(f, lambda); return (alpha * pi) / (alpha * pi + (1.0 - alpha) * qi); }
[ "protected", "static", "double", "calcPosterior", "(", "double", "f", ",", "double", "alpha", ",", "double", "mu", ",", "double", "sigma", ",", "double", "lambda", ")", "{", "final", "double", "pi", "=", "calcP_i", "(", "f", ",", "mu", ",", "sigma", ")...
Compute the a posterior probability for the given parameters. @param f value @param alpha Alpha (mixing) parameter @param mu Mu (for gaussian) @param sigma Sigma (for gaussian) @param lambda Lambda (for exponential) @return Probability
[ "Compute", "the", "a", "posterior", "probability", "for", "the", "given", "parameters", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/utilities/scaling/outlier/MixtureModelOutlierScaling.java#L129-L133
63,349
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/cash/CASHInterval.java
CASHInterval.split
public void split() { if(hasChildren()) { return; } final boolean issplit = (maxSplitDimension >= (getDimensionality() - 1)); final int childLevel = issplit ? level + 1 : level; final int splitDim = issplit ? 0 : maxSplitDimension + 1; final double splitPoint = getMin(splitDim) + (getMax(...
java
public void split() { if(hasChildren()) { return; } final boolean issplit = (maxSplitDimension >= (getDimensionality() - 1)); final int childLevel = issplit ? level + 1 : level; final int splitDim = issplit ? 0 : maxSplitDimension + 1; final double splitPoint = getMin(splitDim) + (getMax(...
[ "public", "void", "split", "(", ")", "{", "if", "(", "hasChildren", "(", ")", ")", "{", "return", ";", "}", "final", "boolean", "issplit", "=", "(", "maxSplitDimension", ">=", "(", "getDimensionality", "(", ")", "-", "1", ")", ")", ";", "final", "int...
Splits this interval into 2 children.
[ "Splits", "this", "interval", "into", "2", "children", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/cash/CASHInterval.java#L263-L311
63,350
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/application/GeneratorXMLSpec.java
GeneratorXMLSpec.run
@Override public void run() { MultipleObjectsBundle data = generator.loadData(); if(LOG.isVerbose()) { LOG.verbose("Writing output ..."); } try { if(outputFile.exists() && LOG.isVerbose()) { LOG.verbose("The file " + outputFile + " already exists, " + "the generator result will be ...
java
@Override public void run() { MultipleObjectsBundle data = generator.loadData(); if(LOG.isVerbose()) { LOG.verbose("Writing output ..."); } try { if(outputFile.exists() && LOG.isVerbose()) { LOG.verbose("The file " + outputFile + " already exists, " + "the generator result will be ...
[ "@", "Override", "public", "void", "run", "(", ")", "{", "MultipleObjectsBundle", "data", "=", "generator", ".", "loadData", "(", ")", ";", "if", "(", "LOG", ".", "isVerbose", "(", ")", ")", "{", "LOG", ".", "verbose", "(", "\"Writing output ...\"", ")",...
Runs the wrapper with the specified arguments.
[ "Runs", "the", "wrapper", "with", "the", "specified", "arguments", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/application/GeneratorXMLSpec.java#L89-L110
63,351
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/random/RandomFactory.java
RandomFactory.getGlobalSeed
private static long getGlobalSeed() { String sseed = System.getProperty("elki.seed"); return (sseed != null) ? Long.parseLong(sseed) : System.nanoTime(); }
java
private static long getGlobalSeed() { String sseed = System.getProperty("elki.seed"); return (sseed != null) ? Long.parseLong(sseed) : System.nanoTime(); }
[ "private", "static", "long", "getGlobalSeed", "(", ")", "{", "String", "sseed", "=", "System", ".", "getProperty", "(", "\"elki.seed\"", ")", ";", "return", "(", "sseed", "!=", "null", ")", "?", "Long", ".", "parseLong", "(", "sseed", ")", ":", "System",...
Initialize the default random. @return seed for the random generator factory.
[ "Initialize", "the", "default", "random", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/random/RandomFactory.java#L57-L60
63,352
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/distribution/Assignments.java
Assignments.computeFirstCover
public double computeFirstCover(boolean leaf) { double max = 0.; for(DistanceEntry<E> e : firstAssignments) { double cover = leaf ? e.getDistance() : (e.getEntry().getCoveringRadius() + e.getDistance()); max = cover > max ? cover : max; } return max; }
java
public double computeFirstCover(boolean leaf) { double max = 0.; for(DistanceEntry<E> e : firstAssignments) { double cover = leaf ? e.getDistance() : (e.getEntry().getCoveringRadius() + e.getDistance()); max = cover > max ? cover : max; } return max; }
[ "public", "double", "computeFirstCover", "(", "boolean", "leaf", ")", "{", "double", "max", "=", "0.", ";", "for", "(", "DistanceEntry", "<", "E", ">", "e", ":", "firstAssignments", ")", "{", "double", "cover", "=", "leaf", "?", "e", ".", "getDistance", ...
Compute the covering radius of the first assignment. @param leaf {@code true} if in leaf mode. @return Covering radius.
[ "Compute", "the", "covering", "radius", "of", "the", "first", "assignment", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/distribution/Assignments.java#L90-L97
63,353
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/distribution/Assignments.java
Assignments.computeSecondCover
public double computeSecondCover(boolean leaf) { double max = 0.; for(DistanceEntry<E> e : secondAssignments) { double cover = leaf ? e.getDistance() : (e.getEntry().getCoveringRadius() + e.getDistance()); max = cover > max ? cover : max; } return max; }
java
public double computeSecondCover(boolean leaf) { double max = 0.; for(DistanceEntry<E> e : secondAssignments) { double cover = leaf ? e.getDistance() : (e.getEntry().getCoveringRadius() + e.getDistance()); max = cover > max ? cover : max; } return max; }
[ "public", "double", "computeSecondCover", "(", "boolean", "leaf", ")", "{", "double", "max", "=", "0.", ";", "for", "(", "DistanceEntry", "<", "E", ">", "e", ":", "secondAssignments", ")", "{", "double", "cover", "=", "leaf", "?", "e", ".", "getDistance"...
Compute the covering radius of the second assignment. @param leaf {@code true} if in leaf mode. @return Covering radius.
[ "Compute", "the", "covering", "radius", "of", "the", "second", "assignment", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/distribution/Assignments.java#L105-L112
63,354
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/UpdatableHeap.java
UpdatableHeap.offerAt
protected void offerAt(final int pos, O e) { if(pos == NO_VALUE) { // resize when needed if(size + 1 > queue.length) { resize(size + 1); } index.put(e, size); size++; heapifyUp(size - 1, e); heapModified(); return; } assert (pos >= 0) : "Unexpected neg...
java
protected void offerAt(final int pos, O e) { if(pos == NO_VALUE) { // resize when needed if(size + 1 > queue.length) { resize(size + 1); } index.put(e, size); size++; heapifyUp(size - 1, e); heapModified(); return; } assert (pos >= 0) : "Unexpected neg...
[ "protected", "void", "offerAt", "(", "final", "int", "pos", ",", "O", "e", ")", "{", "if", "(", "pos", "==", "NO_VALUE", ")", "{", "// resize when needed", "if", "(", "size", "+", "1", ">", "queue", ".", "length", ")", "{", "resize", "(", "size", "...
Offer element at the given position. @param pos Position @param e Element
[ "Offer", "element", "at", "the", "given", "position", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/UpdatableHeap.java#L111-L132
63,355
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/UpdatableHeap.java
UpdatableHeap.removeObject
public O removeObject(O e) { int pos = index.getInt(e); return (pos >= 0) ? removeAt(pos) : null; }
java
public O removeObject(O e) { int pos = index.getInt(e); return (pos >= 0) ? removeAt(pos) : null; }
[ "public", "O", "removeObject", "(", "O", "e", ")", "{", "int", "pos", "=", "index", ".", "getInt", "(", "e", ")", ";", "return", "(", "pos", ">=", "0", ")", "?", "removeAt", "(", "pos", ")", ":", "null", ";", "}" ]
Remove the given object from the queue. @param e Object to remove @return Existing entry
[ "Remove", "the", "given", "object", "from", "the", "queue", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/heap/UpdatableHeap.java#L164-L167
63,356
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java
HSMDependenceMeasure.sumMatrix
private long sumMatrix(int[][] mat) { long ret = 0; for(int i = 0; i < mat.length; i++) { final int[] row = mat[i]; for(int j = 0; j < row.length; j++) { ret += row[j]; } } return ret; }
java
private long sumMatrix(int[][] mat) { long ret = 0; for(int i = 0; i < mat.length; i++) { final int[] row = mat[i]; for(int j = 0; j < row.length; j++) { ret += row[j]; } } return ret; }
[ "private", "long", "sumMatrix", "(", "int", "[", "]", "[", "]", "mat", ")", "{", "long", "ret", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mat", ".", "length", ";", "i", "++", ")", "{", "final", "int", "[", "]", "row",...
Compute the sum of a matrix. @param mat Matrix @return Sum of all elements
[ "Compute", "the", "sum", "of", "a", "matrix", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java#L129-L138
63,357
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java
HSMDependenceMeasure.countAboveThreshold
private int countAboveThreshold(int[][] mat, double threshold) { int ret = 0; for(int i = 0; i < mat.length; i++) { int[] row = mat[i]; for(int j = 0; j < row.length; j++) { if(row[j] >= threshold) { ret++; } } } return ret; }
java
private int countAboveThreshold(int[][] mat, double threshold) { int ret = 0; for(int i = 0; i < mat.length; i++) { int[] row = mat[i]; for(int j = 0; j < row.length; j++) { if(row[j] >= threshold) { ret++; } } } return ret; }
[ "private", "int", "countAboveThreshold", "(", "int", "[", "]", "[", "]", "mat", ",", "double", "threshold", ")", "{", "int", "ret", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "mat", ".", "length", ";", "i", "++", ")", "{", ...
Count the number of cells above the threshold. @param mat Matrix @param threshold Threshold @return Number of elements above the threshold.
[ "Count", "the", "number", "of", "cells", "above", "the", "threshold", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java#L147-L158
63,358
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java
HSMDependenceMeasure.houghTransformation
private int[][] houghTransformation(boolean[][] mat) { final int xres = mat.length, yres = mat[0].length; final double tscale = STEPS * .66 / (xres + yres); final int[][] ret = new int[STEPS][STEPS]; for(int x = 0; x < mat.length; x++) { final boolean[] row = mat[x]; for(int y = 0; y < mat[...
java
private int[][] houghTransformation(boolean[][] mat) { final int xres = mat.length, yres = mat[0].length; final double tscale = STEPS * .66 / (xres + yres); final int[][] ret = new int[STEPS][STEPS]; for(int x = 0; x < mat.length; x++) { final boolean[] row = mat[x]; for(int y = 0; y < mat[...
[ "private", "int", "[", "]", "[", "]", "houghTransformation", "(", "boolean", "[", "]", "[", "]", "mat", ")", "{", "final", "int", "xres", "=", "mat", ".", "length", ",", "yres", "=", "mat", "[", "0", "]", ".", "length", ";", "final", "double", "t...
Perform a hough transformation on the binary image in "mat". @param mat Binary image @return Hough transformation of image.
[ "Perform", "a", "hough", "transformation", "on", "the", "binary", "image", "in", "mat", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java#L166-L186
63,359
elki-project/elki
elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java
HSMDependenceMeasure.drawLine
private static void drawLine(int x0, int y0, int x1, int y1, boolean[][] pic) { final int xres = pic.length, yres = pic[0].length; // Ensure bounds y0 = (y0 < 0) ? 0 : (y0 >= yres) ? (yres - 1) : y0; y1 = (y1 < 0) ? 0 : (y1 >= yres) ? (yres - 1) : y1; x0 = (x0 < 0) ? 0 : (x0 >= xres) ? (xres - 1) : ...
java
private static void drawLine(int x0, int y0, int x1, int y1, boolean[][] pic) { final int xres = pic.length, yres = pic[0].length; // Ensure bounds y0 = (y0 < 0) ? 0 : (y0 >= yres) ? (yres - 1) : y0; y1 = (y1 < 0) ? 0 : (y1 >= yres) ? (yres - 1) : y1; x0 = (x0 < 0) ? 0 : (x0 >= xres) ? (xres - 1) : ...
[ "private", "static", "void", "drawLine", "(", "int", "x0", ",", "int", "y0", ",", "int", "x1", ",", "int", "y1", ",", "boolean", "[", "]", "[", "]", "pic", ")", "{", "final", "int", "xres", "=", "pic", ".", "length", ",", "yres", "=", "pic", "[...
Draw a line onto the array, using the classic Bresenham algorithm. @param x0 Start X @param y0 Start Y @param x1 End X @param y1 End Y @param pic Picture array
[ "Draw", "a", "line", "onto", "the", "array", "using", "the", "classic", "Bresenham", "algorithm", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/dependence/HSMDependenceMeasure.java#L197-L226
63,360
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/EnumParameter.java
EnumParameter.getPossibleValues
public Collection<String> getPossibleValues() { // Convert to string array final E[] enums = enumClass.getEnumConstants(); ArrayList<String> values = new ArrayList<>(enums.length); for(E t : enums) { values.add(t.name()); } return values; }
java
public Collection<String> getPossibleValues() { // Convert to string array final E[] enums = enumClass.getEnumConstants(); ArrayList<String> values = new ArrayList<>(enums.length); for(E t : enums) { values.add(t.name()); } return values; }
[ "public", "Collection", "<", "String", ">", "getPossibleValues", "(", ")", "{", "// Convert to string array", "final", "E", "[", "]", "enums", "=", "enumClass", ".", "getEnumConstants", "(", ")", ";", "ArrayList", "<", "String", ">", "values", "=", "new", "A...
Get a list of possible values for this enum parameter. @return list of strings representing possible enum values.
[ "Get", "a", "list", "of", "possible", "values", "for", "this", "enum", "parameter", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/EnumParameter.java#L149-L157
63,361
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/EnumParameter.java
EnumParameter.joinEnumNames
private String joinEnumNames(String separator) { E[] enumTypes = enumClass.getEnumConstants(); StringBuilder sb = new StringBuilder(); for(int i = 0; i < enumTypes.length; ++i) { if(i > 0) { sb.append(separator); } sb.append(enumTypes[i].name()); } return sb.toString(); }
java
private String joinEnumNames(String separator) { E[] enumTypes = enumClass.getEnumConstants(); StringBuilder sb = new StringBuilder(); for(int i = 0; i < enumTypes.length; ++i) { if(i > 0) { sb.append(separator); } sb.append(enumTypes[i].name()); } return sb.toString(); }
[ "private", "String", "joinEnumNames", "(", "String", "separator", ")", "{", "E", "[", "]", "enumTypes", "=", "enumClass", ".", "getEnumConstants", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "...
Utility method for merging possible values into a string for informational messages. @param separator char sequence to use as a separator for enum values. @return <code>{VAL1}{separator}{VAL2}{separator}...</code>
[ "Utility", "method", "for", "merging", "possible", "values", "into", "a", "string", "for", "informational", "messages", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/EnumParameter.java#L166-L176
63,362
elki-project/elki
elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTree.java
MkMaxTree.preInsert
@Override protected void preInsert(MkMaxEntry entry) { KNNHeap knns_o = DBIDUtil.newHeap(getKmax()); preInsert(entry, getRootEntry(), knns_o); }
java
@Override protected void preInsert(MkMaxEntry entry) { KNNHeap knns_o = DBIDUtil.newHeap(getKmax()); preInsert(entry, getRootEntry(), knns_o); }
[ "@", "Override", "protected", "void", "preInsert", "(", "MkMaxEntry", "entry", ")", "{", "KNNHeap", "knns_o", "=", "DBIDUtil", ".", "newHeap", "(", "getKmax", "(", ")", ")", ";", "preInsert", "(", "entry", ",", "getRootEntry", "(", ")", ",", "knns_o", ")...
Adapts the knn distances before insertion of the specified entry.
[ "Adapts", "the", "knn", "distances", "before", "insertion", "of", "the", "specified", "entry", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkmax/MkMaxTree.java#L128-L132
63,363
elki-project/elki
addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/util/SplitHistory.java
SplitHistory.getCommonDimensions
public static IntIterator getCommonDimensions(Collection<SplitHistory> splitHistories) { Iterator<SplitHistory> it = splitHistories.iterator(); long[] checkSet = BitsUtil.copy(it.next().dimBits); while(it.hasNext()) { SplitHistory sh = it.next(); BitsUtil.andI(checkSet, sh.dimBits); } re...
java
public static IntIterator getCommonDimensions(Collection<SplitHistory> splitHistories) { Iterator<SplitHistory> it = splitHistories.iterator(); long[] checkSet = BitsUtil.copy(it.next().dimBits); while(it.hasNext()) { SplitHistory sh = it.next(); BitsUtil.andI(checkSet, sh.dimBits); } re...
[ "public", "static", "IntIterator", "getCommonDimensions", "(", "Collection", "<", "SplitHistory", ">", "splitHistories", ")", "{", "Iterator", "<", "SplitHistory", ">", "it", "=", "splitHistories", ".", "iterator", "(", ")", ";", "long", "[", "]", "checkSet", ...
Get the common split dimensions from a list of split histories. @param splitHistories @return list of split dimensions
[ "Get", "the", "common", "split", "dimensions", "from", "a", "list", "of", "split", "histories", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/xtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/xtree/util/SplitHistory.java#L85-L93
63,364
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/ThumbnailRegistryEntry.java
ThumbnailRegistryEntry.handleURL
public static Filter handleURL(ParsedURL url) { if(LOG.isDebuggingFiner()) { LOG.debugFiner("handleURL " + url.toString()); } if(!isCompatibleURLStatic(url)) { return null; } int id; try { id = ParseUtil.parseIntBase10(url.getPath()); } catch(NumberFormatException e) { ...
java
public static Filter handleURL(ParsedURL url) { if(LOG.isDebuggingFiner()) { LOG.debugFiner("handleURL " + url.toString()); } if(!isCompatibleURLStatic(url)) { return null; } int id; try { id = ParseUtil.parseIntBase10(url.getPath()); } catch(NumberFormatException e) { ...
[ "public", "static", "Filter", "handleURL", "(", "ParsedURL", "url", ")", "{", "if", "(", "LOG", ".", "isDebuggingFiner", "(", ")", ")", "{", "LOG", ".", "debugFiner", "(", "\"handleURL \"", "+", "url", ".", "toString", "(", ")", ")", ";", "}", "if", ...
Statically handle the URL access. @param url URL to access @return Image, or null
[ "Statically", "handle", "the", "URL", "access", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/batikutil/ThumbnailRegistryEntry.java#L161-L187
63,365
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateVarianceRatioCriteria.java
EvaluateVarianceRatioCriteria.globalCentroid
public static int globalCentroid(Centroid overallCentroid, Relation<? extends NumberVector> rel, List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption) { int clustercount = 0; Iterator<? extends Cluster<?>> ci = clusters.iterator(); for(int i = 0; ci.hasNext(); i++) { ...
java
public static int globalCentroid(Centroid overallCentroid, Relation<? extends NumberVector> rel, List<? extends Cluster<?>> clusters, NumberVector[] centroids, NoiseHandling noiseOption) { int clustercount = 0; Iterator<? extends Cluster<?>> ci = clusters.iterator(); for(int i = 0; ci.hasNext(); i++) { ...
[ "public", "static", "int", "globalCentroid", "(", "Centroid", "overallCentroid", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "rel", ",", "List", "<", "?", "extends", "Cluster", "<", "?", ">", ">", "clusters", ",", "NumberVector", "[", "]", "...
Update the global centroid. @param overallCentroid Centroid to udpate @param rel Data relation @param clusters Clusters @param centroids Cluster centroids @return Number of clusters
[ "Update", "the", "global", "centroid", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/internal/EvaluateVarianceRatioCriteria.java#L190-L216
63,366
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerPrototypeHierarchyRepresentationResult.java
PointerPrototypeHierarchyRepresentationResult.findPrototype
public DBID findPrototype(DBIDs members) { // Find the last merge within the cluster. // The object with maximum priority will merge outside of the cluster, // So we need the second largest priority. DBIDIter it = members.iter(); DBIDVar proto = DBIDUtil.newVar(it), last = DBIDUtil.newVar(it); i...
java
public DBID findPrototype(DBIDs members) { // Find the last merge within the cluster. // The object with maximum priority will merge outside of the cluster, // So we need the second largest priority. DBIDIter it = members.iter(); DBIDVar proto = DBIDUtil.newVar(it), last = DBIDUtil.newVar(it); i...
[ "public", "DBID", "findPrototype", "(", "DBIDs", "members", ")", "{", "// Find the last merge within the cluster.", "// The object with maximum priority will merge outside of the cluster,", "// So we need the second largest priority.", "DBIDIter", "it", "=", "members", ".", "iter", ...
Extract the prototype of a given cluster. When the argument is not a valid cluster of this Pointer Hierarchy, the return value is unspecified. @param members Cluster members @return The prototype of the cluster
[ "Extract", "the", "prototype", "of", "a", "given", "cluster", ".", "When", "the", "argument", "is", "not", "a", "valid", "cluster", "of", "this", "Pointer", "Hierarchy", "the", "return", "value", "is", "unspecified", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/PointerPrototypeHierarchyRepresentationResult.java#L86-L107
63,367
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/SimplifiedCoverTree.java
SimplifiedCoverTree.bulkLoad
public void bulkLoad(DBIDs ids) { if(ids.size() == 0) { return; } assert (root == null) : "Tree already initialized."; DBIDIter it = ids.iter(); DBID first = DBIDUtil.deref(it); // Compute distances to all neighbors: ModifiableDoubleDBIDList candidates = DBIDUtil.newDistanceDBIDList(id...
java
public void bulkLoad(DBIDs ids) { if(ids.size() == 0) { return; } assert (root == null) : "Tree already initialized."; DBIDIter it = ids.iter(); DBID first = DBIDUtil.deref(it); // Compute distances to all neighbors: ModifiableDoubleDBIDList candidates = DBIDUtil.newDistanceDBIDList(id...
[ "public", "void", "bulkLoad", "(", "DBIDs", "ids", ")", "{", "if", "(", "ids", ".", "size", "(", ")", "==", "0", ")", "{", "return", ";", "}", "assert", "(", "root", "==", "null", ")", ":", "\"Tree already initialized.\"", ";", "DBIDIter", "it", "=",...
Bulk-load the index. @param ids IDs to load
[ "Bulk", "-", "load", "the", "index", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/SimplifiedCoverTree.java#L179-L192
63,368
elki-project/elki
elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/SimplifiedCoverTree.java
SimplifiedCoverTree.checkCoverTree
private void checkCoverTree(Node cur, int[] counts, int depth) { counts[0] += 1; // Node count counts[1] += depth; // Sum of depth counts[2] = depth > counts[2] ? depth : counts[2]; // Max depth counts[3] += cur.singletons.size() - 1; counts[4] += cur.singletons.size() - (cur.children == null ? 0 : ...
java
private void checkCoverTree(Node cur, int[] counts, int depth) { counts[0] += 1; // Node count counts[1] += depth; // Sum of depth counts[2] = depth > counts[2] ? depth : counts[2]; // Max depth counts[3] += cur.singletons.size() - 1; counts[4] += cur.singletons.size() - (cur.children == null ? 0 : ...
[ "private", "void", "checkCoverTree", "(", "Node", "cur", ",", "int", "[", "]", "counts", ",", "int", "depth", ")", "{", "counts", "[", "0", "]", "+=", "1", ";", "// Node count", "counts", "[", "1", "]", "+=", "depth", ";", "// Sum of depth", "counts", ...
Collect some statistics on the tree. @param cur Current node @param counts Counter set @param depth Current depth
[ "Collect", "some", "statistics", "on", "the", "tree", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/SimplifiedCoverTree.java#L269-L282
63,369
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java
ClusteringFeature.addToStatistics
protected void addToStatistics(NumberVector nv) { final int d = nv.getDimensionality(); assert (d == ls.length); this.n++; for(int i = 0; i < d; i++) { double v = nv.doubleValue(i); ls[i] += v; ss += v * v; } }
java
protected void addToStatistics(NumberVector nv) { final int d = nv.getDimensionality(); assert (d == ls.length); this.n++; for(int i = 0; i < d; i++) { double v = nv.doubleValue(i); ls[i] += v; ss += v * v; } }
[ "protected", "void", "addToStatistics", "(", "NumberVector", "nv", ")", "{", "final", "int", "d", "=", "nv", ".", "getDimensionality", "(", ")", ";", "assert", "(", "d", "==", "ls", ".", "length", ")", ";", "this", ".", "n", "++", ";", "for", "(", ...
Add a number vector to the current node. @param nv Vector to add
[ "Add", "a", "number", "vector", "to", "the", "current", "node", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java#L65-L74
63,370
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java
ClusteringFeature.addToStatistics
protected void addToStatistics(ClusteringFeature other) { n += other.n; VMath.plusEquals(ls, other.ls); ss += other.ss; }
java
protected void addToStatistics(ClusteringFeature other) { n += other.n; VMath.plusEquals(ls, other.ls); ss += other.ss; }
[ "protected", "void", "addToStatistics", "(", "ClusteringFeature", "other", ")", "{", "n", "+=", "other", ".", "n", ";", "VMath", ".", "plusEquals", "(", "ls", ",", "other", ".", "ls", ")", ";", "ss", "+=", "other", ".", "ss", ";", "}" ]
Merge an other clustering features. @param other Other CF
[ "Merge", "an", "other", "clustering", "features", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java#L81-L85
63,371
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java
ClusteringFeature.sumOfSquaresOfSums
public double sumOfSquaresOfSums() { double sum = 0.; for(int i = 0; i < ls.length; i++) { double v = ls[i]; sum += v * v; } return sum; }
java
public double sumOfSquaresOfSums() { double sum = 0.; for(int i = 0; i < ls.length; i++) { double v = ls[i]; sum += v * v; } return sum; }
[ "public", "double", "sumOfSquaresOfSums", "(", ")", "{", "double", "sum", "=", "0.", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "ls", ".", "length", ";", "i", "++", ")", "{", "double", "v", "=", "ls", "[", "i", "]", ";", "sum", "+=...
Sum over all dimensions of squares of linear sums. @return Sum of LS
[ "Sum", "over", "all", "dimensions", "of", "squares", "of", "linear", "sums", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java#L120-L127
63,372
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java
ClusteringFeature.sumOfSquares
public static double sumOfSquares(NumberVector v) { final int dim = v.getDimensionality(); double sum = 0; for(int d = 0; d < dim; d++) { double x = v.doubleValue(d); sum += x * x; } return sum; }
java
public static double sumOfSquares(NumberVector v) { final int dim = v.getDimensionality(); double sum = 0; for(int d = 0; d < dim; d++) { double x = v.doubleValue(d); sum += x * x; } return sum; }
[ "public", "static", "double", "sumOfSquares", "(", "NumberVector", "v", ")", "{", "final", "int", "dim", "=", "v", ".", "getDimensionality", "(", ")", ";", "double", "sum", "=", "0", ";", "for", "(", "int", "d", "=", "0", ";", "d", "<", "dim", ";",...
Compute the sum of squares of a vector. @param v Vector @return Sum of squares
[ "Compute", "the", "sum", "of", "squares", "of", "a", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/birch/ClusteringFeature.java#L144-L152
63,373
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/IntegerArrayQuickSort.java
IntegerArrayQuickSort.insertionSort
private static void insertionSort(int[] data, final int start, final int end, IntComparator comp) { // Classic insertion sort. for(int i = start + 1; i < end; i++) { final int cur = data[i]; int j = i - 1; while(j >= start) { final int pre = data[j]; if(comp.compare(cur, pre) >...
java
private static void insertionSort(int[] data, final int start, final int end, IntComparator comp) { // Classic insertion sort. for(int i = start + 1; i < end; i++) { final int cur = data[i]; int j = i - 1; while(j >= start) { final int pre = data[j]; if(comp.compare(cur, pre) >...
[ "private", "static", "void", "insertionSort", "(", "int", "[", "]", "data", ",", "final", "int", "start", ",", "final", "int", "end", ",", "IntComparator", "comp", ")", "{", "// Classic insertion sort.", "for", "(", "int", "i", "=", "start", "+", "1", ";...
Insertion sort, for short arrays. @param data Data to sort @param start First index @param end Last index (exclusive!) @param comp Comparator
[ "Insertion", "sort", "for", "short", "arrays", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/arrays/IntegerArrayQuickSort.java#L193-L208
63,374
elki-project/elki
elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/WeightedCovarianceMatrixBuilder.java
WeightedCovarianceMatrixBuilder.processIds
@Override public double[][] processIds(DBIDs ids, Relation<? extends NumberVector> relation) { final int dim = RelationUtil.dimensionality(relation); final CovarianceMatrix cmat = new CovarianceMatrix(dim); final Centroid centroid = Centroid.make(relation, ids); // find maximum distance double ma...
java
@Override public double[][] processIds(DBIDs ids, Relation<? extends NumberVector> relation) { final int dim = RelationUtil.dimensionality(relation); final CovarianceMatrix cmat = new CovarianceMatrix(dim); final Centroid centroid = Centroid.make(relation, ids); // find maximum distance double ma...
[ "@", "Override", "public", "double", "[", "]", "[", "]", "processIds", "(", "DBIDs", "ids", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ")", "{", "final", "int", "dim", "=", "RelationUtil", ".", "dimensionality", "(", "relation",...
Weighted Covariance Matrix for a set of IDs. Since we are not supplied any distance information, we'll need to compute it ourselves. Covariance is tied to Euclidean distance, so it probably does not make much sense to add support for other distance functions? @param ids Database ids to process @param relation Relation...
[ "Weighted", "Covariance", "Matrix", "for", "a", "set", "of", "IDs", ".", "Since", "we", "are", "not", "supplied", "any", "distance", "information", "we", "ll", "need", "to", "compute", "it", "ourselves", ".", "Covariance", "is", "tied", "to", "Euclidean", ...
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/WeightedCovarianceMatrixBuilder.java#L105-L135
63,375
elki-project/elki
elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/WeightedCovarianceMatrixBuilder.java
WeightedCovarianceMatrixBuilder.processQueryResults
@Override public double[][] processQueryResults(DoubleDBIDList results, Relation<? extends NumberVector> database, int k) { final int dim = RelationUtil.dimensionality(database); final CovarianceMatrix cmat = new CovarianceMatrix(dim); // avoid bad parameters k = k <= results.size() ? k : results.siz...
java
@Override public double[][] processQueryResults(DoubleDBIDList results, Relation<? extends NumberVector> database, int k) { final int dim = RelationUtil.dimensionality(database); final CovarianceMatrix cmat = new CovarianceMatrix(dim); // avoid bad parameters k = k <= results.size() ? k : results.siz...
[ "@", "Override", "public", "double", "[", "]", "[", "]", "processQueryResults", "(", "DoubleDBIDList", "results", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "database", ",", "int", "k", ")", "{", "final", "int", "dim", "=", "RelationUtil", ...
Compute Covariance Matrix for a QueryResult Collection. By default it will just collect the ids and run processIds @param results a collection of QueryResults @param database the database used @param k number of elements to process @return Covariance Matrix
[ "Compute", "Covariance", "Matrix", "for", "a", "QueryResult", "Collection", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/WeightedCovarianceMatrixBuilder.java#L147-L181
63,376
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/ERiCNeighborPredicate.java
ERiCNeighborPredicate.instantiate
public Instance instantiate(Database database, Relation<V> relation) { DistanceQuery<V> dq = database.getDistanceQuery(relation, EuclideanDistanceFunction.STATIC); KNNQuery<V> knnq = database.getKNNQuery(dq, settings.k); WritableDataStore<PCAFilteredResult> storage = DataStoreUtil.makeStorage(relation.getD...
java
public Instance instantiate(Database database, Relation<V> relation) { DistanceQuery<V> dq = database.getDistanceQuery(relation, EuclideanDistanceFunction.STATIC); KNNQuery<V> knnq = database.getKNNQuery(dq, settings.k); WritableDataStore<PCAFilteredResult> storage = DataStoreUtil.makeStorage(relation.getD...
[ "public", "Instance", "instantiate", "(", "Database", "database", ",", "Relation", "<", "V", ">", "relation", ")", "{", "DistanceQuery", "<", "V", ">", "dq", "=", "database", ".", "getDistanceQuery", "(", "relation", ",", "EuclideanDistanceFunction", ".", "STA...
Full instantiation interface. @param database Database @param relation Relation @return Instance
[ "Full", "instantiation", "interface", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/gdbscan/ERiCNeighborPredicate.java#L115-L134
63,377
elki-project/elki
elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/HTMLUtil.java
HTMLUtil.writeXHTML
public static void writeXHTML(Document htmldoc, OutputStream out) throws IOException { javax.xml.transform.Result result = new StreamResult(out); // Use a transformer for pretty printing Transformer xformer; try { xformer = TransformerFactory.newInstance().newTransformer(); xformer.setOutput...
java
public static void writeXHTML(Document htmldoc, OutputStream out) throws IOException { javax.xml.transform.Result result = new StreamResult(out); // Use a transformer for pretty printing Transformer xformer; try { xformer = TransformerFactory.newInstance().newTransformer(); xformer.setOutput...
[ "public", "static", "void", "writeXHTML", "(", "Document", "htmldoc", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "javax", ".", "xml", ".", "transform", ".", "Result", "result", "=", "new", "StreamResult", "(", "out", ")", ";", "// Use a t...
Write an HTML document to an output stream. @param htmldoc Document to output @param out Stream to write to @throws IOException thrown on IO errors
[ "Write", "an", "HTML", "document", "to", "an", "output", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/HTMLUtil.java#L267-L284
63,378
elki-project/elki
elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/HTMLUtil.java
HTMLUtil.appendMultilineText
public static Element appendMultilineText(Document htmldoc, Element parent, String text) { String[] parts = text != null ? text.split("\n") : null; if(parts == null || parts.length == 0) { return parent; } parent.appendChild(htmldoc.createTextNode(parts[0])); for(int i = 1; i < parts.length; i...
java
public static Element appendMultilineText(Document htmldoc, Element parent, String text) { String[] parts = text != null ? text.split("\n") : null; if(parts == null || parts.length == 0) { return parent; } parent.appendChild(htmldoc.createTextNode(parts[0])); for(int i = 1; i < parts.length; i...
[ "public", "static", "Element", "appendMultilineText", "(", "Document", "htmldoc", ",", "Element", "parent", ",", "String", "text", ")", "{", "String", "[", "]", "parts", "=", "text", "!=", "null", "?", "text", ".", "split", "(", "\"\\n\"", ")", ":", "nul...
Append a multiline text to a node, transforming linewraps into BR tags. @param htmldoc Document @param parent Parent node @param text Text to add. @return parent node
[ "Append", "a", "multiline", "text", "to", "a", "node", "transforming", "linewraps", "into", "BR", "tags", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/utilities/xml/HTMLUtil.java#L294-L305
63,379
elki-project/elki
elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTreePath.java
IndexTreePath.getPathCount
public int getPathCount() { int result = 0; for(IndexTreePath<E> path = this; path != null; path = path.parentPath) { result++; } return result; }
java
public int getPathCount() { int result = 0; for(IndexTreePath<E> path = this; path != null; path = path.parentPath) { result++; } return result; }
[ "public", "int", "getPathCount", "(", ")", "{", "int", "result", "=", "0", ";", "for", "(", "IndexTreePath", "<", "E", ">", "path", "=", "this", ";", "path", "!=", "null", ";", "path", "=", "path", ".", "parentPath", ")", "{", "result", "++", ";", ...
Returns the number of elements in the path. @return an int giving a count of items the path
[ "Returns", "the", "number", "of", "elements", "in", "the", "path", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/IndexTreePath.java#L91-L97
63,380
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java
CBLOF.run
public OutlierResult run(Database database, Relation<O> relation) { StepProgress stepprog = LOG.isVerbose() ? new StepProgress("CBLOF", 3) : null; DBIDs ids = relation.getDBIDs(); LOG.beginStep(stepprog, 1, "Computing clustering."); Clustering<MeanModel> clustering = clusteringAlgorithm.run(database); ...
java
public OutlierResult run(Database database, Relation<O> relation) { StepProgress stepprog = LOG.isVerbose() ? new StepProgress("CBLOF", 3) : null; DBIDs ids = relation.getDBIDs(); LOG.beginStep(stepprog, 1, "Computing clustering."); Clustering<MeanModel> clustering = clusteringAlgorithm.run(database); ...
[ "public", "OutlierResult", "run", "(", "Database", "database", ",", "Relation", "<", "O", ">", "relation", ")", "{", "StepProgress", "stepprog", "=", "LOG", ".", "isVerbose", "(", ")", "?", "new", "StepProgress", "(", "\"CBLOF\"", ",", "3", ")", ":", "nu...
Runs the CBLOF algorithm on the given database. @param database Database to query @param relation Data to process @return CBLOF outlier result
[ "Runs", "the", "CBLOF", "algorithm", "on", "the", "given", "database", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java#L150-L181
63,381
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java
CBLOF.getClusterBoundary
private int getClusterBoundary(Relation<O> relation, List<? extends Cluster<MeanModel>> clusters) { int totalSize = relation.size(); int clusterBoundary = clusters.size() - 1; int cumulativeSize = 0; for(int i = 0; i < clusters.size() - 1; i++) { cumulativeSize += clusters.get(i).size(); //...
java
private int getClusterBoundary(Relation<O> relation, List<? extends Cluster<MeanModel>> clusters) { int totalSize = relation.size(); int clusterBoundary = clusters.size() - 1; int cumulativeSize = 0; for(int i = 0; i < clusters.size() - 1; i++) { cumulativeSize += clusters.get(i).size(); //...
[ "private", "int", "getClusterBoundary", "(", "Relation", "<", "O", ">", "relation", ",", "List", "<", "?", "extends", "Cluster", "<", "MeanModel", ">", ">", "clusters", ")", "{", "int", "totalSize", "=", "relation", ".", "size", "(", ")", ";", "int", "...
Compute the boundary index separating the large cluster from the small cluster. @param relation Data to process @param clusters All clusters that were found @return Index of boundary between large and small cluster.
[ "Compute", "the", "boundary", "index", "separating", "the", "large", "cluster", "from", "the", "small", "cluster", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java#L191-L211
63,382
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java
CBLOF.computeCBLOFs
private void computeCBLOFs(Relation<O> relation, NumberVectorDistanceFunction<? super O> distance, WritableDoubleDataStore cblofs, DoubleMinMax cblofMinMax, List<? extends Cluster<MeanModel>> largeClusters, List<? extends Cluster<MeanModel>> smallClusters) { List<NumberVector> largeClusterMeans = new ArrayList<>(la...
java
private void computeCBLOFs(Relation<O> relation, NumberVectorDistanceFunction<? super O> distance, WritableDoubleDataStore cblofs, DoubleMinMax cblofMinMax, List<? extends Cluster<MeanModel>> largeClusters, List<? extends Cluster<MeanModel>> smallClusters) { List<NumberVector> largeClusterMeans = new ArrayList<>(la...
[ "private", "void", "computeCBLOFs", "(", "Relation", "<", "O", ">", "relation", ",", "NumberVectorDistanceFunction", "<", "?", "super", "O", ">", "distance", ",", "WritableDoubleDataStore", "cblofs", ",", "DoubleMinMax", "cblofMinMax", ",", "List", "<", "?", "ex...
Compute the CBLOF scores for all the data. @param relation Data to process @param distance The distance function @param cblofs CBLOF scores @param cblofMinMax Minimum/maximum score tracker @param largeClusters Large clusters output @param smallClusters Small clusters output
[ "Compute", "the", "CBLOF", "scores", "for", "all", "the", "data", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/CBLOF.java#L223-L242
63,383
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.loadXMLSpecification
private GeneratorMain loadXMLSpecification() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); URL url = ClassLoader.getSystemResource(GENERATOR_SCHEMA_FILE); if(url != null) { ...
java
private GeneratorMain loadXMLSpecification() { try { DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); dbf.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false); URL url = ClassLoader.getSystemResource(GENERATOR_SCHEMA_FILE); if(url != null) { ...
[ "private", "GeneratorMain", "loadXMLSpecification", "(", ")", "{", "try", "{", "DocumentBuilderFactory", "dbf", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ";", "dbf", ".", "setFeature", "(", "\"http://apache.org/xml/features/nonvalidating/load-external-dtd...
Load the XML configuration file. @return Generator
[ "Load", "the", "XML", "configuration", "file", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L245-L286
63,384
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementDataset
private void processElementDataset(GeneratorMain gen, Node cur) { // *** get parameters String seedstr = ((Element) cur).getAttribute(ATTR_SEED); if(clusterRandom != RandomFactory.DEFAULT && seedstr != null && seedstr.length() > 0) { clusterRandom = new RandomFactory((long) (ParseUtil.parseIntBase10(s...
java
private void processElementDataset(GeneratorMain gen, Node cur) { // *** get parameters String seedstr = ((Element) cur).getAttribute(ATTR_SEED); if(clusterRandom != RandomFactory.DEFAULT && seedstr != null && seedstr.length() > 0) { clusterRandom = new RandomFactory((long) (ParseUtil.parseIntBase10(s...
[ "private", "void", "processElementDataset", "(", "GeneratorMain", "gen", ",", "Node", "cur", ")", "{", "// *** get parameters", "String", "seedstr", "=", "(", "(", "Element", ")", "cur", ")", ".", "getAttribute", "(", "ATTR_SEED", ")", ";", "if", "(", "clust...
Process a 'dataset' Element in the XML stream. @param gen Generator @param cur Current document nod
[ "Process", "a", "dataset", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L294-L318
63,385
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementCluster
private void processElementCluster(GeneratorMain gen, Node cur) { int size = -1; double overweight = 1.0; String sizestr = ((Element) cur).getAttribute(ATTR_SIZE); if(sizestr != null && sizestr.length() > 0) { size = (int) (ParseUtil.parseIntBase10(sizestr) * sizescale); } String name = ...
java
private void processElementCluster(GeneratorMain gen, Node cur) { int size = -1; double overweight = 1.0; String sizestr = ((Element) cur).getAttribute(ATTR_SIZE); if(sizestr != null && sizestr.length() > 0) { size = (int) (ParseUtil.parseIntBase10(sizestr) * sizescale); } String name = ...
[ "private", "void", "processElementCluster", "(", "GeneratorMain", "gen", ",", "Node", "cur", ")", "{", "int", "size", "=", "-", "1", ";", "double", "overweight", "=", "1.0", ";", "String", "sizestr", "=", "(", "(", "Element", ")", "cur", ")", ".", "get...
Process a 'cluster' Element in the XML stream. @param gen Generator @param cur Current document nod
[ "Process", "a", "cluster", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L326-L384
63,386
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementUniform
private void processElementUniform(GeneratorSingleCluster cluster, Node cur) { double min = 0.0; double max = 1.0; String minstr = ((Element) cur).getAttribute(ATTR_MIN); if(minstr != null && minstr.length() > 0) { min = ParseUtil.parseDouble(minstr); } String maxstr = ((Element) cur).get...
java
private void processElementUniform(GeneratorSingleCluster cluster, Node cur) { double min = 0.0; double max = 1.0; String minstr = ((Element) cur).getAttribute(ATTR_MIN); if(minstr != null && minstr.length() > 0) { min = ParseUtil.parseDouble(minstr); } String maxstr = ((Element) cur).get...
[ "private", "void", "processElementUniform", "(", "GeneratorSingleCluster", "cluster", ",", "Node", "cur", ")", "{", "double", "min", "=", "0.0", ";", "double", "max", "=", "1.0", ";", "String", "minstr", "=", "(", "(", "Element", ")", "cur", ")", ".", "g...
Process a 'uniform' Element in the XML stream. @param cluster @param cur Current document nod
[ "Process", "a", "uniform", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L392-L418
63,387
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementNormal
private void processElementNormal(GeneratorSingleCluster cluster, Node cur) { double mean = 0.0; double stddev = 1.0; String meanstr = ((Element) cur).getAttribute(ATTR_MEAN); if(meanstr != null && meanstr.length() > 0) { mean = ParseUtil.parseDouble(meanstr); } String stddevstr = ((Elemen...
java
private void processElementNormal(GeneratorSingleCluster cluster, Node cur) { double mean = 0.0; double stddev = 1.0; String meanstr = ((Element) cur).getAttribute(ATTR_MEAN); if(meanstr != null && meanstr.length() > 0) { mean = ParseUtil.parseDouble(meanstr); } String stddevstr = ((Elemen...
[ "private", "void", "processElementNormal", "(", "GeneratorSingleCluster", "cluster", ",", "Node", "cur", ")", "{", "double", "mean", "=", "0.0", ";", "double", "stddev", "=", "1.0", ";", "String", "meanstr", "=", "(", "(", "Element", ")", "cur", ")", ".", ...
Process a 'normal' Element in the XML stream. @param cluster @param cur Current document nod
[ "Process", "a", "normal", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L426-L451
63,388
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementGamma
private void processElementGamma(GeneratorSingleCluster cluster, Node cur) { double k = 1.0; double theta = 1.0; String kstr = ((Element) cur).getAttribute(ATTR_K); if(kstr != null && kstr.length() > 0) { k = ParseUtil.parseDouble(kstr); } String thetastr = ((Element) cur).getAttribute(ATT...
java
private void processElementGamma(GeneratorSingleCluster cluster, Node cur) { double k = 1.0; double theta = 1.0; String kstr = ((Element) cur).getAttribute(ATTR_K); if(kstr != null && kstr.length() > 0) { k = ParseUtil.parseDouble(kstr); } String thetastr = ((Element) cur).getAttribute(ATT...
[ "private", "void", "processElementGamma", "(", "GeneratorSingleCluster", "cluster", ",", "Node", "cur", ")", "{", "double", "k", "=", "1.0", ";", "double", "theta", "=", "1.0", ";", "String", "kstr", "=", "(", "(", "Element", ")", "cur", ")", ".", "getAt...
Process a 'gamma' Element in the XML stream. @param cluster @param cur Current document nod
[ "Process", "a", "gamma", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L459-L484
63,389
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementRotate
private void processElementRotate(GeneratorSingleCluster cluster, Node cur) { int axis1 = 0; int axis2 = 0; double angle = 0.0; String a1str = ((Element) cur).getAttribute(ATTR_AXIS1); if(a1str != null && a1str.length() > 0) { axis1 = ParseUtil.parseIntBase10(a1str); } String a2str = ...
java
private void processElementRotate(GeneratorSingleCluster cluster, Node cur) { int axis1 = 0; int axis2 = 0; double angle = 0.0; String a1str = ((Element) cur).getAttribute(ATTR_AXIS1); if(a1str != null && a1str.length() > 0) { axis1 = ParseUtil.parseIntBase10(a1str); } String a2str = ...
[ "private", "void", "processElementRotate", "(", "GeneratorSingleCluster", "cluster", ",", "Node", "cur", ")", "{", "int", "axis1", "=", "0", ";", "int", "axis2", "=", "0", ";", "double", "angle", "=", "0.0", ";", "String", "a1str", "=", "(", "(", "Elemen...
Process a 'rotate' Element in the XML stream. @param cluster @param cur Current document nod
[ "Process", "a", "rotate", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L526-L564
63,390
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementTranslate
private void processElementTranslate(GeneratorSingleCluster cluster, Node cur) { double[] offset = null; String vstr = ((Element) cur).getAttribute(ATTR_VECTOR); if(vstr != null && vstr.length() > 0) { offset = parseVector(vstr); } if(offset == null) { throw new AbortException("No transl...
java
private void processElementTranslate(GeneratorSingleCluster cluster, Node cur) { double[] offset = null; String vstr = ((Element) cur).getAttribute(ATTR_VECTOR); if(vstr != null && vstr.length() > 0) { offset = parseVector(vstr); } if(offset == null) { throw new AbortException("No transl...
[ "private", "void", "processElementTranslate", "(", "GeneratorSingleCluster", "cluster", ",", "Node", "cur", ")", "{", "double", "[", "]", "offset", "=", "null", ";", "String", "vstr", "=", "(", "(", "Element", ")", "cur", ")", ".", "getAttribute", "(", "AT...
Process a 'translate' Element in the XML stream. @param cluster @param cur Current document nod
[ "Process", "a", "translate", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L572-L593
63,391
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementClipping
private void processElementClipping(GeneratorSingleCluster cluster, Node cur) { double[] cmin = null, cmax = null; String minstr = ((Element) cur).getAttribute(ATTR_MIN); if(minstr != null && minstr.length() > 0) { cmin = parseVector(minstr); } String maxstr = ((Element) cur).getAttribute(ATT...
java
private void processElementClipping(GeneratorSingleCluster cluster, Node cur) { double[] cmin = null, cmax = null; String minstr = ((Element) cur).getAttribute(ATTR_MIN); if(minstr != null && minstr.length() > 0) { cmin = parseVector(minstr); } String maxstr = ((Element) cur).getAttribute(ATT...
[ "private", "void", "processElementClipping", "(", "GeneratorSingleCluster", "cluster", ",", "Node", "cur", ")", "{", "double", "[", "]", "cmin", "=", "null", ",", "cmax", "=", "null", ";", "String", "minstr", "=", "(", "(", "Element", ")", "cur", ")", "....
Process a 'clipping' Element in the XML stream. @param cluster @param cur Current document nod
[ "Process", "a", "clipping", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L601-L627
63,392
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.processElementStatic
private void processElementStatic(GeneratorMain gen, Node cur) { String name = ((Element) cur).getAttribute(ATTR_NAME); if(name == null) { throw new AbortException("No cluster name given in specification file."); } ArrayList<double[]> points = new ArrayList<>(); // TODO: check for unknown att...
java
private void processElementStatic(GeneratorMain gen, Node cur) { String name = ((Element) cur).getAttribute(ATTR_NAME); if(name == null) { throw new AbortException("No cluster name given in specification file."); } ArrayList<double[]> points = new ArrayList<>(); // TODO: check for unknown att...
[ "private", "void", "processElementStatic", "(", "GeneratorMain", "gen", ",", "Node", "cur", ")", "{", "String", "name", "=", "(", "(", "Element", ")", "cur", ")", ".", "getAttribute", "(", "ATTR_NAME", ")", ";", "if", "(", "name", "==", "null", ")", "{...
Process a 'static' cluster Element in the XML stream. @param gen Generator @param cur Current document nod
[ "Process", "a", "static", "cluster", "Element", "in", "the", "XML", "stream", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L635-L660
63,393
elki-project/elki
elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java
GeneratorXMLDatabaseConnection.parseVector
private double[] parseVector(String s) { String[] entries = WHITESPACE_PATTERN.split(s); double[] d = new double[entries.length]; for(int i = 0; i < entries.length; i++) { try { d[i] = ParseUtil.parseDouble(entries[i]); } catch(NumberFormatException e) { throw new AbortExce...
java
private double[] parseVector(String s) { String[] entries = WHITESPACE_PATTERN.split(s); double[] d = new double[entries.length]; for(int i = 0; i < entries.length; i++) { try { d[i] = ParseUtil.parseDouble(entries[i]); } catch(NumberFormatException e) { throw new AbortExce...
[ "private", "double", "[", "]", "parseVector", "(", "String", "s", ")", "{", "String", "[", "]", "entries", "=", "WHITESPACE_PATTERN", ".", "split", "(", "s", ")", ";", "double", "[", "]", "d", "=", "new", "double", "[", "entries", ".", "length", "]",...
Parse a string into a vector. TODO: move this into utility package? @param s String to parse @return Vector
[ "Parse", "a", "string", "into", "a", "vector", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L699-L711
63,394
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/model/ModelUtil.java
ModelUtil.getPrototype
public static NumberVector getPrototype(Model model, Relation<? extends NumberVector> relation) { // Mean model contains a numeric Vector if(model instanceof MeanModel) { return DoubleVector.wrap(((MeanModel) model).getMean()); } // Handle medoid models if(model instanceof MedoidModel) { ...
java
public static NumberVector getPrototype(Model model, Relation<? extends NumberVector> relation) { // Mean model contains a numeric Vector if(model instanceof MeanModel) { return DoubleVector.wrap(((MeanModel) model).getMean()); } // Handle medoid models if(model instanceof MedoidModel) { ...
[ "public", "static", "NumberVector", "getPrototype", "(", "Model", "model", ",", "Relation", "<", "?", "extends", "NumberVector", ">", "relation", ")", "{", "// Mean model contains a numeric Vector", "if", "(", "model", "instanceof", "MeanModel", ")", "{", "return", ...
Get the representative vector for a cluster model. <b>Only representative-based models are supported!</b> {@code null} is returned when the model is not supported! @param model Model @param relation Data relation (for representatives specified per DBID) @return Some {@link NumberVector}, {@code null} if not supporte...
[ "Get", "the", "representative", "vector", "for", "a", "cluster", "model", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/model/ModelUtil.java#L99-L116
63,395
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java
DiSHPreferenceVectorIndex.determinePreferenceVectorByApriori
private long[] determinePreferenceVectorByApriori(Relation<V> relation, ModifiableDBIDs[] neighborIDs, StringBuilder msg) { int dimensionality = neighborIDs.length; // database for apriori UpdatableDatabase apriori_db = new HashmapDatabase(); SimpleTypeInformation<?> bitmeta = VectorFieldTypeInformatio...
java
private long[] determinePreferenceVectorByApriori(Relation<V> relation, ModifiableDBIDs[] neighborIDs, StringBuilder msg) { int dimensionality = neighborIDs.length; // database for apriori UpdatableDatabase apriori_db = new HashmapDatabase(); SimpleTypeInformation<?> bitmeta = VectorFieldTypeInformatio...
[ "private", "long", "[", "]", "determinePreferenceVectorByApriori", "(", "Relation", "<", "V", ">", "relation", ",", "ModifiableDBIDs", "[", "]", "neighborIDs", ",", "StringBuilder", "msg", ")", "{", "int", "dimensionality", "=", "neighborIDs", ".", "length", ";"...
Determines the preference vector with the apriori strategy. @param relation the database storing the objects @param neighborIDs the list of ids of the neighbors in each dimension @param msg a string buffer for debug messages @return the preference vector
[ "Determines", "the", "preference", "vector", "with", "the", "apriori", "strategy", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java#L215-L262
63,396
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java
DiSHPreferenceVectorIndex.determinePreferenceVectorByMaxIntersection
private long[] determinePreferenceVectorByMaxIntersection(ModifiableDBIDs[] neighborIDs, StringBuilder msg) { int dimensionality = neighborIDs.length; long[] preferenceVector = BitsUtil.zero(dimensionality); Map<Integer, ModifiableDBIDs> candidates = new HashMap<>(dimensionality); for(int i = 0; i < di...
java
private long[] determinePreferenceVectorByMaxIntersection(ModifiableDBIDs[] neighborIDs, StringBuilder msg) { int dimensionality = neighborIDs.length; long[] preferenceVector = BitsUtil.zero(dimensionality); Map<Integer, ModifiableDBIDs> candidates = new HashMap<>(dimensionality); for(int i = 0; i < di...
[ "private", "long", "[", "]", "determinePreferenceVectorByMaxIntersection", "(", "ModifiableDBIDs", "[", "]", "neighborIDs", ",", "StringBuilder", "msg", ")", "{", "int", "dimensionality", "=", "neighborIDs", ".", "length", ";", "long", "[", "]", "preferenceVector", ...
Determines the preference vector with the max intersection strategy. @param neighborIDs the list of ids of the neighbors in each dimension @param msg a string buffer for debug messages @return the preference vector
[ "Determines", "the", "preference", "vector", "with", "the", "max", "intersection", "strategy", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java#L271-L306
63,397
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java
DiSHPreferenceVectorIndex.max
private int max(Map<Integer, ModifiableDBIDs> candidates) { int maxDim = -1, size = -1; for(Integer nextDim : candidates.keySet()) { int nextSet = candidates.get(nextDim).size(); if(size < nextSet) { size = nextSet; maxDim = nextDim; } } return maxDim; }
java
private int max(Map<Integer, ModifiableDBIDs> candidates) { int maxDim = -1, size = -1; for(Integer nextDim : candidates.keySet()) { int nextSet = candidates.get(nextDim).size(); if(size < nextSet) { size = nextSet; maxDim = nextDim; } } return maxDim; }
[ "private", "int", "max", "(", "Map", "<", "Integer", ",", "ModifiableDBIDs", ">", "candidates", ")", "{", "int", "maxDim", "=", "-", "1", ",", "size", "=", "-", "1", ";", "for", "(", "Integer", "nextDim", ":", "candidates", ".", "keySet", "(", ")", ...
Returns the set with the maximum size contained in the specified map. @param candidates the map containing the sets @return the set with the maximum size
[ "Returns", "the", "set", "with", "the", "maximum", "size", "contained", "in", "the", "specified", "map", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java#L314-L324
63,398
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java
DiSHPreferenceVectorIndex.maxIntersection
private int maxIntersection(Map<Integer, ModifiableDBIDs> candidates, ModifiableDBIDs set) { int maxDim = -1; ModifiableDBIDs maxIntersection = null; for(Integer nextDim : candidates.keySet()) { DBIDs nextSet = candidates.get(nextDim); ModifiableDBIDs nextIntersection = DBIDUtil.intersection(set...
java
private int maxIntersection(Map<Integer, ModifiableDBIDs> candidates, ModifiableDBIDs set) { int maxDim = -1; ModifiableDBIDs maxIntersection = null; for(Integer nextDim : candidates.keySet()) { DBIDs nextSet = candidates.get(nextDim); ModifiableDBIDs nextIntersection = DBIDUtil.intersection(set...
[ "private", "int", "maxIntersection", "(", "Map", "<", "Integer", ",", "ModifiableDBIDs", ">", "candidates", ",", "ModifiableDBIDs", "set", ")", "{", "int", "maxDim", "=", "-", "1", ";", "ModifiableDBIDs", "maxIntersection", "=", "null", ";", "for", "(", "Int...
Returns the index of the set having the maximum intersection set with the specified set contained in the specified map. @param candidates the map containing the sets @param set the set to intersect with and output the result to @return the set with the maximum size
[ "Returns", "the", "index", "of", "the", "set", "having", "the", "maximum", "intersection", "set", "with", "the", "specified", "set", "contained", "in", "the", "specified", "map", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java#L334-L350
63,399
elki-project/elki
elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java
DiSHPreferenceVectorIndex.initRangeQueries
private RangeQuery<V>[] initRangeQueries(Relation<V> relation, int dimensionality) { @SuppressWarnings("unchecked") RangeQuery<V>[] rangeQueries = (RangeQuery<V>[]) new RangeQuery[dimensionality]; for(int d = 0; d < dimensionality; d++) { rangeQueries[d] = relation.getRangeQuery(new PrimitiveDistanceQ...
java
private RangeQuery<V>[] initRangeQueries(Relation<V> relation, int dimensionality) { @SuppressWarnings("unchecked") RangeQuery<V>[] rangeQueries = (RangeQuery<V>[]) new RangeQuery[dimensionality]; for(int d = 0; d < dimensionality; d++) { rangeQueries[d] = relation.getRangeQuery(new PrimitiveDistanceQ...
[ "private", "RangeQuery", "<", "V", ">", "[", "]", "initRangeQueries", "(", "Relation", "<", "V", ">", "relation", ",", "int", "dimensionality", ")", "{", "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "RangeQuery", "<", "V", ">", "[", "]", "rangeQueri...
Initializes the dimension selecting distancefunctions to determine the preference vectors. @param relation the database storing the objects @param dimensionality the dimensionality of the objects @return the dimension selecting distancefunctions to determine the preference vectors
[ "Initializes", "the", "dimension", "selecting", "distancefunctions", "to", "determine", "the", "preference", "vectors", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/preference/DiSHPreferenceVectorIndex.java#L361-L368