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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
64,200 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/AbstractTooltipVisualization.java | AbstractTooltipVisualization.handleHoverEvent | protected void handleHoverEvent(Event evt) {
if(evt.getTarget() instanceof Element) {
Element e = (Element) evt.getTarget();
Node next = e.getNextSibling();
if(next instanceof Element) {
toggleTooltip((Element) next, evt.getType());
}
else {
LoggingUtil.warning("Tooltip... | java | protected void handleHoverEvent(Event evt) {
if(evt.getTarget() instanceof Element) {
Element e = (Element) evt.getTarget();
Node next = e.getNextSibling();
if(next instanceof Element) {
toggleTooltip((Element) next, evt.getType());
}
else {
LoggingUtil.warning("Tooltip... | [
"protected",
"void",
"handleHoverEvent",
"(",
"Event",
"evt",
")",
"{",
"if",
"(",
"evt",
".",
"getTarget",
"(",
")",
"instanceof",
"Element",
")",
"{",
"Element",
"e",
"=",
"(",
"Element",
")",
"evt",
".",
"getTarget",
"(",
")",
";",
"Node",
"next",
... | Handle the hover events.
@param evt Event. | [
"Handle",
"the",
"hover",
"events",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/AbstractTooltipVisualization.java#L140-L154 |
64,201 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/AbstractTooltipVisualization.java | AbstractTooltipVisualization.toggleTooltip | protected void toggleTooltip(Element elem, String type) {
String csscls = elem.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);
if(SVGConstants.SVG_MOUSEOVER_EVENT_TYPE.equals(type)) {
if(TOOLTIP_HIDDEN.equals(csscls)) {
SVGUtil.setAtt(elem, SVGConstants.SVG_CLASS_ATTRIBUTE, TOOLTIP_VISIBLE);
... | java | protected void toggleTooltip(Element elem, String type) {
String csscls = elem.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);
if(SVGConstants.SVG_MOUSEOVER_EVENT_TYPE.equals(type)) {
if(TOOLTIP_HIDDEN.equals(csscls)) {
SVGUtil.setAtt(elem, SVGConstants.SVG_CLASS_ATTRIBUTE, TOOLTIP_VISIBLE);
... | [
"protected",
"void",
"toggleTooltip",
"(",
"Element",
"elem",
",",
"String",
"type",
")",
"{",
"String",
"csscls",
"=",
"elem",
".",
"getAttribute",
"(",
"SVGConstants",
".",
"SVG_CLASS_ATTRIBUTE",
")",
";",
"if",
"(",
"SVGConstants",
".",
"SVG_MOUSEOVER_EVENT_T... | Toggle the Tooltip of an element.
@param elem Element
@param type Event type | [
"Toggle",
"the",
"Tooltip",
"of",
"an",
"element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/AbstractTooltipVisualization.java#L162-L182 |
64,202 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppTree.java | MkAppTree.reverseKNNQuery | @Override
public DoubleDBIDList reverseKNNQuery(DBIDRef id, int k) {
ModifiableDoubleDBIDList result = DBIDUtil.newDistanceDBIDList();
final Heap<MTreeSearchCandidate> pq = new UpdatableHeap<>();
// push root
pq.add(new MTreeSearchCandidate(0., getRootID(), null, Double.NaN));
// search in tree
... | java | @Override
public DoubleDBIDList reverseKNNQuery(DBIDRef id, int k) {
ModifiableDoubleDBIDList result = DBIDUtil.newDistanceDBIDList();
final Heap<MTreeSearchCandidate> pq = new UpdatableHeap<>();
// push root
pq.add(new MTreeSearchCandidate(0., getRootID(), null, Double.NaN));
// search in tree
... | [
"@",
"Override",
"public",
"DoubleDBIDList",
"reverseKNNQuery",
"(",
"DBIDRef",
"id",
",",
"int",
"k",
")",
"{",
"ModifiableDoubleDBIDList",
"result",
"=",
"DBIDUtil",
".",
"newDistanceDBIDList",
"(",
")",
";",
"final",
"Heap",
"<",
"MTreeSearchCandidate",
">",
... | Performs a reverse k-nearest neighbor query for the given object ID. The
query result is in ascending order to the distance to the query object.
@param id the query object id
@param k the number of nearest neighbors to be returned
@return a List of the query results | [
"Performs",
"a",
"reverse",
"k",
"-",
"nearest",
"neighbor",
"query",
"for",
"the",
"given",
"object",
"ID",
".",
"The",
"query",
"result",
"is",
"in",
"ascending",
"order",
"to",
"the",
"distance",
"to",
"the",
"query",
"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/mktrees/mkapp/MkAppTree.java#L142-L191 |
64,203 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppTree.java | MkAppTree.leafEntryIDs | private void leafEntryIDs(MkAppTreeNode<O> node, ModifiableDBIDs result) {
if(node.isLeaf()) {
for(int i = 0; i < node.getNumEntries(); i++) {
MkAppEntry entry = node.getEntry(i);
result.add(((LeafEntry) entry).getDBID());
}
}
else {
for(int i = 0; i < node.getNumEntries();... | java | private void leafEntryIDs(MkAppTreeNode<O> node, ModifiableDBIDs result) {
if(node.isLeaf()) {
for(int i = 0; i < node.getNumEntries(); i++) {
MkAppEntry entry = node.getEntry(i);
result.add(((LeafEntry) entry).getDBID());
}
}
else {
for(int i = 0; i < node.getNumEntries();... | [
"private",
"void",
"leafEntryIDs",
"(",
"MkAppTreeNode",
"<",
"O",
">",
"node",
",",
"ModifiableDBIDs",
"result",
")",
"{",
"if",
"(",
"node",
".",
"isLeaf",
"(",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"node",
".",
"getNumE... | Determines the ids of the leaf entries stored in the specified subtree.
@param node the root of the subtree
@param result the result list containing the ids of the leaf entries stored
in the specified subtree | [
"Determines",
"the",
"ids",
"of",
"the",
"leaf",
"entries",
"stored",
"in",
"the",
"specified",
"subtree",
"."
] | 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/mkapp/MkAppTree.java#L304-L317 |
64,204 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkapp/MkAppTree.java | MkAppTree.approximateKnnDistances | private PolynomialApproximation approximateKnnDistances(double[] knnDistances) {
StringBuilder msg = new StringBuilder();
// count the zero distances (necessary of log-log space is used)
int k_0 = 0;
if(settings.log) {
for(int i = 0; i < settings.kmax; i++) {
double dist = knnDistances[i]... | java | private PolynomialApproximation approximateKnnDistances(double[] knnDistances) {
StringBuilder msg = new StringBuilder();
// count the zero distances (necessary of log-log space is used)
int k_0 = 0;
if(settings.log) {
for(int i = 0; i < settings.kmax; i++) {
double dist = knnDistances[i]... | [
"private",
"PolynomialApproximation",
"approximateKnnDistances",
"(",
"double",
"[",
"]",
"knnDistances",
")",
"{",
"StringBuilder",
"msg",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// count the zero distances (necessary of log-log space is used)",
"int",
"k_0",
"=",
"... | Computes the polynomial approximation of the specified knn-distances.
@param knnDistances the knn-distances of the leaf entry
@return the polynomial approximation of the specified knn-distances. | [
"Computes",
"the",
"polynomial",
"approximation",
"of",
"the",
"specified",
"knn",
"-",
"distances",
"."
] | 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/mkapp/MkAppTree.java#L325-L365 |
64,205 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.isLeft | protected final int isLeft(double[] a, double[] b, double[] o) {
final double cross = getRX(a, o) * getRY(b, o) - getRY(a, o) * getRX(b, o);
if(cross == 0) {
// Compare manhattan distances - same angle!
final double dista = Math.abs(getRX(a, o)) + Math.abs(getRY(a, o));
final double distb = Ma... | java | protected final int isLeft(double[] a, double[] b, double[] o) {
final double cross = getRX(a, o) * getRY(b, o) - getRY(a, o) * getRX(b, o);
if(cross == 0) {
// Compare manhattan distances - same angle!
final double dista = Math.abs(getRX(a, o)) + Math.abs(getRY(a, o));
final double distb = Ma... | [
"protected",
"final",
"int",
"isLeft",
"(",
"double",
"[",
"]",
"a",
",",
"double",
"[",
"]",
"b",
",",
"double",
"[",
"]",
"o",
")",
"{",
"final",
"double",
"cross",
"=",
"getRX",
"(",
"a",
",",
"o",
")",
"*",
"getRY",
"(",
"b",
",",
"o",
")... | Test whether a point is left of the other wrt. the origin.
@param a double[] A
@param b double[] B
@param o Origin double[]
@return +1 when left, 0 when same, -1 when right | [
"Test",
"whether",
"a",
"point",
"is",
"left",
"of",
"the",
"other",
"wrt",
".",
"the",
"origin",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L193-L202 |
64,206 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.mdist | private double mdist(double[] a, double[] b) {
return Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);
} | java | private double mdist(double[] a, double[] b) {
return Math.abs(a[0] - b[0]) + Math.abs(a[1] - b[1]);
} | [
"private",
"double",
"mdist",
"(",
"double",
"[",
"]",
"a",
",",
"double",
"[",
"]",
"b",
")",
"{",
"return",
"Math",
".",
"abs",
"(",
"a",
"[",
"0",
"]",
"-",
"b",
"[",
"0",
"]",
")",
"+",
"Math",
".",
"abs",
"(",
"a",
"[",
"1",
"]",
"-"... | Manhattan distance.
@param a double[] A
@param b double[] B
@return Manhattan distance | [
"Manhattan",
"distance",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L211-L213 |
64,207 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.isConvex | private boolean isConvex(double[] a, double[] b, double[] c) {
// We're using factor to improve numerical contrast for small polygons.
double area = (b[0] - a[0]) * factor * (c[1] - a[1]) - (c[0] - a[0]) * factor * (b[1] - a[1]);
return (-1e-13 < area && area < 1e-13) ? (mdist(b, c) > mdist(a, b) + mdist(a,... | java | private boolean isConvex(double[] a, double[] b, double[] c) {
// We're using factor to improve numerical contrast for small polygons.
double area = (b[0] - a[0]) * factor * (c[1] - a[1]) - (c[0] - a[0]) * factor * (b[1] - a[1]);
return (-1e-13 < area && area < 1e-13) ? (mdist(b, c) > mdist(a, b) + mdist(a,... | [
"private",
"boolean",
"isConvex",
"(",
"double",
"[",
"]",
"a",
",",
"double",
"[",
"]",
"b",
",",
"double",
"[",
"]",
"c",
")",
"{",
"// We're using factor to improve numerical contrast for small polygons.",
"double",
"area",
"=",
"(",
"b",
"[",
"0",
"]",
"... | Simple convexity test.
@param a double[] A
@param b double[] B
@param c double[] C
@return convexity | [
"Simple",
"convexity",
"test",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L223-L227 |
64,208 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.grahamScan | private void grahamScan() {
if(points.size() < 3) {
return;
}
Iterator<double[]> iter = points.iterator();
Stack<double[]> stack = new Stack<>();
// Start with the first two points on the stack
final double[] first = iter.next();
stack.add(first);
while(iter.hasNext()) {
doub... | java | private void grahamScan() {
if(points.size() < 3) {
return;
}
Iterator<double[]> iter = points.iterator();
Stack<double[]> stack = new Stack<>();
// Start with the first two points on the stack
final double[] first = iter.next();
stack.add(first);
while(iter.hasNext()) {
doub... | [
"private",
"void",
"grahamScan",
"(",
")",
"{",
"if",
"(",
"points",
".",
"size",
"(",
")",
"<",
"3",
")",
"{",
"return",
";",
"}",
"Iterator",
"<",
"double",
"[",
"]",
">",
"iter",
"=",
"points",
".",
"iterator",
"(",
")",
";",
"Stack",
"<",
"... | The actual graham scan main loop. | [
"The",
"actual",
"graham",
"scan",
"main",
"loop",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L232-L260 |
64,209 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java | GrahamScanConvexHull2D.getHull | public Polygon getHull() {
if(!ok) {
computeConvexHull();
}
return new Polygon(points, minmaxX.getMin(), minmaxX.getMax(), minmaxY.getMin(), minmaxY.getMax());
} | java | public Polygon getHull() {
if(!ok) {
computeConvexHull();
}
return new Polygon(points, minmaxX.getMin(), minmaxX.getMax(), minmaxY.getMin(), minmaxY.getMax());
} | [
"public",
"Polygon",
"getHull",
"(",
")",
"{",
"if",
"(",
"!",
"ok",
")",
"{",
"computeConvexHull",
"(",
")",
";",
"}",
"return",
"new",
"Polygon",
"(",
"points",
",",
"minmaxX",
".",
"getMin",
"(",
")",
",",
"minmaxX",
".",
"getMax",
"(",
")",
","... | Compute the convex hull, and return the resulting polygon.
@return Polygon of the hull | [
"Compute",
"the",
"convex",
"hull",
"and",
"return",
"the",
"resulting",
"polygon",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/GrahamScanConvexHull2D.java#L267-L272 |
64,210 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java | MSTSplit.coverRadius | private static double coverRadius(double[][] matrix, int[] idx, int i) {
final int idx_i = idx[i];
final double[] row_i = matrix[i];
double m = 0;
for(int j = 0; j < row_i.length; j++) {
if(i != j && idx_i == idx[j]) {
final double d = row_i[j];
m = d > m ? d : m;
}
}
... | java | private static double coverRadius(double[][] matrix, int[] idx, int i) {
final int idx_i = idx[i];
final double[] row_i = matrix[i];
double m = 0;
for(int j = 0; j < row_i.length; j++) {
if(i != j && idx_i == idx[j]) {
final double d = row_i[j];
m = d > m ? d : m;
}
}
... | [
"private",
"static",
"double",
"coverRadius",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"[",
"]",
"idx",
",",
"int",
"i",
")",
"{",
"final",
"int",
"idx_i",
"=",
"idx",
"[",
"i",
"]",
";",
"final",
"double",
"[",
"]",
"row_i",
"=",... | Find the cover radius of a partition.
@param matrix Distance matrix
@param idx Partition keys
@param i Candidate index
@return max(d(i,j)) for all j with the same index | [
"Find",
"the",
"cover",
"radius",
"of",
"a",
"partition",
"."
] | 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/MSTSplit.java#L108-L119 |
64,211 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java | MSTSplit.mstPartition | private static int[] mstPartition(double[][] matrix) {
final int n = matrix.length;
int[] edges = PrimsMinimumSpanningTree.processDense(matrix);
// Note: Prims does *not* yield edges sorted by edge length!
double meanlength = thresholdLength(matrix, edges);
int[] idx = new int[n], best = new int[n],... | java | private static int[] mstPartition(double[][] matrix) {
final int n = matrix.length;
int[] edges = PrimsMinimumSpanningTree.processDense(matrix);
// Note: Prims does *not* yield edges sorted by edge length!
double meanlength = thresholdLength(matrix, edges);
int[] idx = new int[n], best = new int[n],... | [
"private",
"static",
"int",
"[",
"]",
"mstPartition",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
")",
"{",
"final",
"int",
"n",
"=",
"matrix",
".",
"length",
";",
"int",
"[",
"]",
"edges",
"=",
"PrimsMinimumSpanningTree",
".",
"processDense",
"(",
"m... | Partition the data using the minimu spanning tree.
@param matrix
@return partition assignments | [
"Partition",
"the",
"data",
"using",
"the",
"minimu",
"spanning",
"tree",
"."
] | 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/MSTSplit.java#L127-L156 |
64,212 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java | MSTSplit.thresholdLength | private static double thresholdLength(double[][] matrix, int[] edges) {
double[] lengths = new double[edges.length >> 1];
for(int i = 0, e = edges.length - 1; i < e; i += 2) {
lengths[i >> 1] = matrix[edges[i]][edges[i + 1]];
}
Arrays.sort(lengths);
final int pos = (lengths.length >> 1); // 50... | java | private static double thresholdLength(double[][] matrix, int[] edges) {
double[] lengths = new double[edges.length >> 1];
for(int i = 0, e = edges.length - 1; i < e; i += 2) {
lengths[i >> 1] = matrix[edges[i]][edges[i + 1]];
}
Arrays.sort(lengths);
final int pos = (lengths.length >> 1); // 50... | [
"private",
"static",
"double",
"thresholdLength",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"[",
"]",
"edges",
")",
"{",
"double",
"[",
"]",
"lengths",
"=",
"new",
"double",
"[",
"edges",
".",
"length",
">>",
"1",
"]",
";",
"for",
"(... | Choose the threshold length of edges to consider omittig.
@param matrix Distance matrix
@param edges Edges
@return Distance threshold | [
"Choose",
"the",
"threshold",
"length",
"of",
"edges",
"to",
"consider",
"omittig",
"."
] | 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/MSTSplit.java#L165-L173 |
64,213 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java | MSTSplit.edgelength | private static double edgelength(double[][] matrix, int[] edges, int i) {
i <<= 1;
return matrix[edges[i]][edges[i + 1]];
} | java | private static double edgelength(double[][] matrix, int[] edges, int i) {
i <<= 1;
return matrix[edges[i]][edges[i + 1]];
} | [
"private",
"static",
"double",
"edgelength",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"[",
"]",
"edges",
",",
"int",
"i",
")",
"{",
"i",
"<<=",
"1",
";",
"return",
"matrix",
"[",
"edges",
"[",
"i",
"]",
"]",
"[",
"edges",
"[",
"... | Length of edge i.
@param matrix Distance matrix
@param edges Edge list
@param i Edge number
@return Edge length | [
"Length",
"of",
"edge",
"i",
"."
] | 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/MSTSplit.java#L183-L186 |
64,214 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java | MSTSplit.omitEdge | private static void omitEdge(int[] edges, int[] idx, int[] sizes, int omit) {
for(int i = 0; i < idx.length; i++) {
idx[i] = i;
}
Arrays.fill(sizes, 1);
for(int i = 0, j = 0, e = edges.length - 1; j < e; i++, j += 2) {
if(i == omit) {
continue;
}
int ea = edges[j + 1], eb... | java | private static void omitEdge(int[] edges, int[] idx, int[] sizes, int omit) {
for(int i = 0; i < idx.length; i++) {
idx[i] = i;
}
Arrays.fill(sizes, 1);
for(int i = 0, j = 0, e = edges.length - 1; j < e; i++, j += 2) {
if(i == omit) {
continue;
}
int ea = edges[j + 1], eb... | [
"private",
"static",
"void",
"omitEdge",
"(",
"int",
"[",
"]",
"edges",
",",
"int",
"[",
"]",
"idx",
",",
"int",
"[",
"]",
"sizes",
",",
"int",
"omit",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"idx",
".",
"length",
";",
"i",... | Partition the data by omitting one edge.
@param edges Edges list
@param idx Partition index storage
@param sizes Partition sizes
@param omit Edge number to omit | [
"Partition",
"the",
"data",
"by",
"omitting",
"one",
"edge",
"."
] | 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/MSTSplit.java#L196-L216 |
64,215 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/MSTSplit.java | MSTSplit.follow | private static int follow(int i, int[] partitions) {
int next = partitions[i], tmp;
while(i != next) {
tmp = next;
next = partitions[i] = partitions[next];
i = tmp;
}
return i;
} | java | private static int follow(int i, int[] partitions) {
int next = partitions[i], tmp;
while(i != next) {
tmp = next;
next = partitions[i] = partitions[next];
i = tmp;
}
return i;
} | [
"private",
"static",
"int",
"follow",
"(",
"int",
"i",
",",
"int",
"[",
"]",
"partitions",
")",
"{",
"int",
"next",
"=",
"partitions",
"[",
"i",
"]",
",",
"tmp",
";",
"while",
"(",
"i",
"!=",
"next",
")",
"{",
"tmp",
"=",
"next",
";",
"next",
"... | Union-find with simple path compression.
@param i Start
@param partitions Partitions array
@return Partition | [
"Union",
"-",
"find",
"with",
"simple",
"path",
"compression",
"."
] | 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/MSTSplit.java#L225-L233 |
64,216 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/COP.java | COP.computeCentroid | private static void computeCentroid(double[] centroid, Relation<? extends NumberVector> relation, DBIDs ids) {
Arrays.fill(centroid, 0);
int dim = centroid.length;
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
NumberVector v = relation.get(it);
for(int i = 0; i < dim; i++) {
... | java | private static void computeCentroid(double[] centroid, Relation<? extends NumberVector> relation, DBIDs ids) {
Arrays.fill(centroid, 0);
int dim = centroid.length;
for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
NumberVector v = relation.get(it);
for(int i = 0; i < dim; i++) {
... | [
"private",
"static",
"void",
"computeCentroid",
"(",
"double",
"[",
"]",
"centroid",
",",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
",",
"DBIDs",
"ids",
")",
"{",
"Arrays",
".",
"fill",
"(",
"centroid",
",",
"0",
")",
";",
"int",
... | Recompute the centroid of a set.
@param centroid Scratch buffer
@param relation Input data
@param ids IDs to include | [
"Recompute",
"the",
"centroid",
"of",
"a",
"set",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/COP.java#L285-L295 |
64,217 | elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java | QueryUtil.getDistanceQuery | public static <O> DistanceQuery<O> getDistanceQuery(Database database, DistanceFunction<? super O> distanceFunction, Object... hints) {
final Relation<O> objectQuery = database.getRelation(distanceFunction.getInputTypeRestriction(), hints);
return database.getDistanceQuery(objectQuery, distanceFunction, hints);... | java | public static <O> DistanceQuery<O> getDistanceQuery(Database database, DistanceFunction<? super O> distanceFunction, Object... hints) {
final Relation<O> objectQuery = database.getRelation(distanceFunction.getInputTypeRestriction(), hints);
return database.getDistanceQuery(objectQuery, distanceFunction, hints);... | [
"public",
"static",
"<",
"O",
">",
"DistanceQuery",
"<",
"O",
">",
"getDistanceQuery",
"(",
"Database",
"database",
",",
"DistanceFunction",
"<",
"?",
"super",
"O",
">",
"distanceFunction",
",",
"Object",
"...",
"hints",
")",
"{",
"final",
"Relation",
"<",
... | Get a distance query for a given distance function, automatically choosing
a relation.
@param <O> Object type
@param database Database
@param distanceFunction Distance function
@param hints Optimizer hints
@return Distance query | [
"Get",
"a",
"distance",
"query",
"for",
"a",
"given",
"distance",
"function",
"automatically",
"choosing",
"a",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java#L78-L81 |
64,218 | elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java | QueryUtil.getSimilarityQuery | public static <O> SimilarityQuery<O> getSimilarityQuery(Database database, SimilarityFunction<? super O> similarityFunction, Object... hints) {
final Relation<O> objectQuery = database.getRelation(similarityFunction.getInputTypeRestriction(), hints);
return database.getSimilarityQuery(objectQuery, similarityFun... | java | public static <O> SimilarityQuery<O> getSimilarityQuery(Database database, SimilarityFunction<? super O> similarityFunction, Object... hints) {
final Relation<O> objectQuery = database.getRelation(similarityFunction.getInputTypeRestriction(), hints);
return database.getSimilarityQuery(objectQuery, similarityFun... | [
"public",
"static",
"<",
"O",
">",
"SimilarityQuery",
"<",
"O",
">",
"getSimilarityQuery",
"(",
"Database",
"database",
",",
"SimilarityFunction",
"<",
"?",
"super",
"O",
">",
"similarityFunction",
",",
"Object",
"...",
"hints",
")",
"{",
"final",
"Relation",
... | Get a similarity query, automatically choosing a relation.
@param <O> Object type
@param database Database
@param similarityFunction Similarity function
@param hints Optimizer hints
@return Similarity Query | [
"Get",
"a",
"similarity",
"query",
"automatically",
"choosing",
"a",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java#L92-L95 |
64,219 | elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java | QueryUtil.getRKNNQuery | public static <O> RKNNQuery<O> getRKNNQuery(Relation<O> relation, DistanceFunction<? super O> distanceFunction, Object... hints) {
final DistanceQuery<O> distanceQuery = relation.getDistanceQuery(distanceFunction, hints);
return relation.getRKNNQuery(distanceQuery, hints);
} | java | public static <O> RKNNQuery<O> getRKNNQuery(Relation<O> relation, DistanceFunction<? super O> distanceFunction, Object... hints) {
final DistanceQuery<O> distanceQuery = relation.getDistanceQuery(distanceFunction, hints);
return relation.getRKNNQuery(distanceQuery, hints);
} | [
"public",
"static",
"<",
"O",
">",
"RKNNQuery",
"<",
"O",
">",
"getRKNNQuery",
"(",
"Relation",
"<",
"O",
">",
"relation",
",",
"DistanceFunction",
"<",
"?",
"super",
"O",
">",
"distanceFunction",
",",
"Object",
"...",
"hints",
")",
"{",
"final",
"Distan... | Get a rKNN query object for the given distance function.
When possible, this will use an index, but it may default to an expensive
linear scan.
Hints include:
<ul>
<li>Integer: maximum value for k needed</li>
<li>{@link de.lmu.ifi.dbs.elki.database.query.DatabaseQuery#HINT_BULK} bulk
query needed</li>
</ul>
@param r... | [
"Get",
"a",
"rKNN",
"query",
"object",
"for",
"the",
"given",
"distance",
"function",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java#L217-L220 |
64,220 | elki-project/elki | elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java | QueryUtil.getLinearScanSimilarityRangeQuery | public static <O> RangeQuery<O> getLinearScanSimilarityRangeQuery(SimilarityQuery<O> simQuery) {
// Slight optimizations of linear scans
if(simQuery instanceof PrimitiveSimilarityQuery) {
final PrimitiveSimilarityQuery<O> pdq = (PrimitiveSimilarityQuery<O>) simQuery;
return new LinearScanPrimitiveSi... | java | public static <O> RangeQuery<O> getLinearScanSimilarityRangeQuery(SimilarityQuery<O> simQuery) {
// Slight optimizations of linear scans
if(simQuery instanceof PrimitiveSimilarityQuery) {
final PrimitiveSimilarityQuery<O> pdq = (PrimitiveSimilarityQuery<O>) simQuery;
return new LinearScanPrimitiveSi... | [
"public",
"static",
"<",
"O",
">",
"RangeQuery",
"<",
"O",
">",
"getLinearScanSimilarityRangeQuery",
"(",
"SimilarityQuery",
"<",
"O",
">",
"simQuery",
")",
"{",
"// Slight optimizations of linear scans",
"if",
"(",
"simQuery",
"instanceof",
"PrimitiveSimilarityQuery",
... | Get a linear scan query for the given similarity query.
@param <O> Object type
@param simQuery similarity query
@return Range query | [
"Get",
"a",
"linear",
"scan",
"query",
"for",
"the",
"given",
"similarity",
"query",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-database/src/main/java/de/lmu/ifi/dbs/elki/database/QueryUtil.java#L271-L278 |
64,221 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.register | protected static void register(Class<?> parent, String cname) {
Entry e = data.get(parent);
if(e == null) {
data.put(parent, e = new Entry());
}
e.addName(cname);
} | java | protected static void register(Class<?> parent, String cname) {
Entry e = data.get(parent);
if(e == null) {
data.put(parent, e = new Entry());
}
e.addName(cname);
} | [
"protected",
"static",
"void",
"register",
"(",
"Class",
"<",
"?",
">",
"parent",
",",
"String",
"cname",
")",
"{",
"Entry",
"e",
"=",
"data",
".",
"get",
"(",
"parent",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"data",
".",
"put",
"(",
... | Register a class with the registry.
@param parent Parent class
@param cname Class name | [
"Register",
"a",
"class",
"with",
"the",
"registry",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L160-L166 |
64,222 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.register | protected static void register(Class<?> parent, Class<?> clazz) {
Entry e = data.get(parent);
if(e == null) {
data.put(parent, e = new Entry());
}
final String cname = clazz.getCanonicalName();
e.addHit(cname, clazz);
if(clazz.isAnnotationPresent(Alias.class)) {
Alias aliases = clazz... | java | protected static void register(Class<?> parent, Class<?> clazz) {
Entry e = data.get(parent);
if(e == null) {
data.put(parent, e = new Entry());
}
final String cname = clazz.getCanonicalName();
e.addHit(cname, clazz);
if(clazz.isAnnotationPresent(Alias.class)) {
Alias aliases = clazz... | [
"protected",
"static",
"void",
"register",
"(",
"Class",
"<",
"?",
">",
"parent",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Entry",
"e",
"=",
"data",
".",
"get",
"(",
"parent",
")",
";",
"if",
"(",
"e",
"==",
"null",
")",
"{",
"data",
".... | Register a class in the registry.
Careful: do not use this from your code before first making sure this has
been fully initialized. Otherwise, other implementations will not be found.
Therefore, avoid calling this from your own Java code!
@param parent Class
@param clazz Implementation | [
"Register",
"a",
"class",
"in",
"the",
"registry",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L178-L191 |
64,223 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.registerAlias | protected static void registerAlias(Class<?> parent, String alias, String cname) {
Entry e = data.get(parent);
assert (e != null);
e.addAlias(alias, cname);
} | java | protected static void registerAlias(Class<?> parent, String alias, String cname) {
Entry e = data.get(parent);
assert (e != null);
e.addAlias(alias, cname);
} | [
"protected",
"static",
"void",
"registerAlias",
"(",
"Class",
"<",
"?",
">",
"parent",
",",
"String",
"alias",
",",
"String",
"cname",
")",
"{",
"Entry",
"e",
"=",
"data",
".",
"get",
"(",
"parent",
")",
";",
"assert",
"(",
"e",
"!=",
"null",
")",
... | Register a class alias with the registry.
@param parent Parent class
@param alias Alias name
@param cname Class name | [
"Register",
"a",
"class",
"alias",
"with",
"the",
"registry",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L200-L204 |
64,224 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.tryLoadClass | private static Class<?> tryLoadClass(String value) {
try {
return CLASSLOADER.loadClass(value);
}
catch(ClassNotFoundException e) {
return null;
}
} | java | private static Class<?> tryLoadClass(String value) {
try {
return CLASSLOADER.loadClass(value);
}
catch(ClassNotFoundException e) {
return null;
}
} | [
"private",
"static",
"Class",
"<",
"?",
">",
"tryLoadClass",
"(",
"String",
"value",
")",
"{",
"try",
"{",
"return",
"CLASSLOADER",
".",
"loadClass",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"ClassNotFoundException",
"e",
")",
"{",
"return",
"null",
";... | Attempt to load a class
@param value Class name to try.
@return Class, or {@code null}. | [
"Attempt",
"to",
"load",
"a",
"class"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L212-L219 |
64,225 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.findAllImplementations | public static List<Class<?>> findAllImplementations(Class<?> restrictionClass) {
if(restrictionClass == null) {
return Collections.emptyList();
}
if(!contains(restrictionClass)) {
ELKIServiceLoader.load(restrictionClass);
ELKIServiceScanner.load(restrictionClass);
}
Entry e = data.... | java | public static List<Class<?>> findAllImplementations(Class<?> restrictionClass) {
if(restrictionClass == null) {
return Collections.emptyList();
}
if(!contains(restrictionClass)) {
ELKIServiceLoader.load(restrictionClass);
ELKIServiceScanner.load(restrictionClass);
}
Entry e = data.... | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"findAllImplementations",
"(",
"Class",
"<",
"?",
">",
"restrictionClass",
")",
"{",
"if",
"(",
"restrictionClass",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
... | Find all implementations of a particular interface.
@param restrictionClass Class to scan for
@return Found implementations | [
"Find",
"all",
"implementations",
"of",
"a",
"particular",
"interface",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L237-L270 |
64,226 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.findAllImplementations | public static List<Class<?>> findAllImplementations(Class<?> c, boolean everything, boolean parameterizable) {
if(c == null) {
return Collections.emptyList();
}
// Default is served from the registry
if(!everything && parameterizable) {
return findAllImplementations(c);
}
// This cod... | java | public static List<Class<?>> findAllImplementations(Class<?> c, boolean everything, boolean parameterizable) {
if(c == null) {
return Collections.emptyList();
}
// Default is served from the registry
if(!everything && parameterizable) {
return findAllImplementations(c);
}
// This cod... | [
"public",
"static",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"findAllImplementations",
"(",
"Class",
"<",
"?",
">",
"c",
",",
"boolean",
"everything",
",",
"boolean",
"parameterizable",
")",
"{",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"return",
"Coll... | Find all implementations of a given class in the classpath.
Note: returned classes may be abstract.
@param c Class restriction
@param everything include interfaces, abstract and private classes
@param parameterizable only return classes instantiable by the
parameterizable API
@return List of found classes. | [
"Find",
"all",
"implementations",
"of",
"a",
"given",
"class",
"in",
"the",
"classpath",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L283-L330 |
64,227 | elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java | ELKIServiceRegistry.tryAlternateNames | private static <C> Class<?> tryAlternateNames(Class<? super C> restrictionClass, String value, Entry e) {
StringBuilder buf = new StringBuilder(value.length() + 100);
// Try with FACTORY_POSTFIX first:
Class<?> clazz = tryLoadClass(buf.append(value).append(FACTORY_POSTFIX).toString());
if(clazz != null)... | java | private static <C> Class<?> tryAlternateNames(Class<? super C> restrictionClass, String value, Entry e) {
StringBuilder buf = new StringBuilder(value.length() + 100);
// Try with FACTORY_POSTFIX first:
Class<?> clazz = tryLoadClass(buf.append(value).append(FACTORY_POSTFIX).toString());
if(clazz != null)... | [
"private",
"static",
"<",
"C",
">",
"Class",
"<",
"?",
">",
"tryAlternateNames",
"(",
"Class",
"<",
"?",
"super",
"C",
">",
"restrictionClass",
",",
"String",
"value",
",",
"Entry",
"e",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",... | Try loading alternative names.
@param restrictionClass Context class, for prepending a package name.
@param value Class name requested
@param e Cache entry, may be null
@param <C> Generic type
@return Class, or null | [
"Try",
"loading",
"alternative",
"names",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/ELKIServiceRegistry.java#L404-L438 |
64,228 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/AbstractScatterplotVisualization.java | AbstractScatterplotVisualization.setupCanvas | protected Element setupCanvas() {
final double margin = context.getStyleLibrary().getSize(StyleLibrary.MARGIN);
this.layer = setupCanvas(svgp, this.proj, margin, getWidth(), getHeight());
return layer;
} | java | protected Element setupCanvas() {
final double margin = context.getStyleLibrary().getSize(StyleLibrary.MARGIN);
this.layer = setupCanvas(svgp, this.proj, margin, getWidth(), getHeight());
return layer;
} | [
"protected",
"Element",
"setupCanvas",
"(",
")",
"{",
"final",
"double",
"margin",
"=",
"context",
".",
"getStyleLibrary",
"(",
")",
".",
"getSize",
"(",
"StyleLibrary",
".",
"MARGIN",
")",
";",
"this",
".",
"layer",
"=",
"setupCanvas",
"(",
"svgp",
",",
... | Setup our canvas.
@return Canvas | [
"Setup",
"our",
"canvas",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/visualizers/scatterplot/AbstractScatterplotVisualization.java#L89-L93 |
64,229 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/AbstractSupervisedProjectionVectorFilter.java | AbstractSupervisedProjectionVectorFilter.convertedType | protected SimpleTypeInformation<?> convertedType(SimpleTypeInformation<?> in, NumberVector.Factory<V> factory) {
return new VectorFieldTypeInformation<>(factory, tdim);
} | java | protected SimpleTypeInformation<?> convertedType(SimpleTypeInformation<?> in, NumberVector.Factory<V> factory) {
return new VectorFieldTypeInformation<>(factory, tdim);
} | [
"protected",
"SimpleTypeInformation",
"<",
"?",
">",
"convertedType",
"(",
"SimpleTypeInformation",
"<",
"?",
">",
"in",
",",
"NumberVector",
".",
"Factory",
"<",
"V",
">",
"factory",
")",
"{",
"return",
"new",
"VectorFieldTypeInformation",
"<>",
"(",
"factory",... | Get the output type from the input type after conversion.
@param in input type restriction
@param factory Vector factory
@return output type restriction | [
"Get",
"the",
"output",
"type",
"from",
"the",
"input",
"type",
"after",
"conversion",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/AbstractSupervisedProjectionVectorFilter.java#L153-L155 |
64,230 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/AbstractSupervisedProjectionVectorFilter.java | AbstractSupervisedProjectionVectorFilter.partition | protected <O> Map<O, IntList> partition(List<? extends O> classcolumn) {
Map<O, IntList> classes = new HashMap<>();
Iterator<? extends O> iter = classcolumn.iterator();
for(int i = 0; iter.hasNext(); i++) {
O lbl = iter.next();
IntList ids = classes.get(lbl);
if(ids == null) {
ids ... | java | protected <O> Map<O, IntList> partition(List<? extends O> classcolumn) {
Map<O, IntList> classes = new HashMap<>();
Iterator<? extends O> iter = classcolumn.iterator();
for(int i = 0; iter.hasNext(); i++) {
O lbl = iter.next();
IntList ids = classes.get(lbl);
if(ids == null) {
ids ... | [
"protected",
"<",
"O",
">",
"Map",
"<",
"O",
",",
"IntList",
">",
"partition",
"(",
"List",
"<",
"?",
"extends",
"O",
">",
"classcolumn",
")",
"{",
"Map",
"<",
"O",
",",
"IntList",
">",
"classes",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"Iter... | Partition the bundle based on the class label.
@param classcolumn
@return Partitioned data set. | [
"Partition",
"the",
"bundle",
"based",
"on",
"the",
"class",
"label",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/AbstractSupervisedProjectionVectorFilter.java#L180-L193 |
64,231 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYPlot.java | XYPlot.makeCurve | public Curve makeCurve() {
Curve c = new Curve(curves.size());
curves.add(c);
return c;
} | java | public Curve makeCurve() {
Curve c = new Curve(curves.size());
curves.add(c);
return c;
} | [
"public",
"Curve",
"makeCurve",
"(",
")",
"{",
"Curve",
"c",
"=",
"new",
"Curve",
"(",
"curves",
".",
"size",
"(",
")",
")",
";",
"curves",
".",
"add",
"(",
"c",
")",
";",
"return",
"c",
";",
"}"
] | Make a new curve.
@return Curve | [
"Make",
"a",
"new",
"curve",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/geometry/XYPlot.java#L282-L286 |
64,232 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPane.java | LogPane.publish | public void publish(String message, Level level) {
try {
publish(new LogRecord(level, message));
}
catch(BadLocationException e) {
throw new RuntimeException("Error writing a log-like message.", e);
}
} | java | public void publish(String message, Level level) {
try {
publish(new LogRecord(level, message));
}
catch(BadLocationException e) {
throw new RuntimeException("Error writing a log-like message.", e);
}
} | [
"public",
"void",
"publish",
"(",
"String",
"message",
",",
"Level",
"level",
")",
"{",
"try",
"{",
"publish",
"(",
"new",
"LogRecord",
"(",
"level",
",",
"message",
")",
")",
";",
"}",
"catch",
"(",
"BadLocationException",
"e",
")",
"{",
"throw",
"new... | Print a message as if it were logged, without going through the full
logger.
@param message
Message text
@param level
Message level | [
"Print",
"a",
"message",
"as",
"if",
"it",
"were",
"logged",
"without",
"going",
"through",
"the",
"full",
"logger",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPane.java#L125-L132 |
64,233 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPane.java | LogPane.publish | protected synchronized void publish(LogRecord record) throws BadLocationException {
// choose an appropriate formatter
final Formatter fmt;
final Style style;
// always format progress messages using the progress formatter.
if(record.getLevel().intValue() >= Level.WARNING.intValue()) {
// form... | java | protected synchronized void publish(LogRecord record) throws BadLocationException {
// choose an appropriate formatter
final Formatter fmt;
final Style style;
// always format progress messages using the progress formatter.
if(record.getLevel().intValue() >= Level.WARNING.intValue()) {
// form... | [
"protected",
"synchronized",
"void",
"publish",
"(",
"LogRecord",
"record",
")",
"throws",
"BadLocationException",
"{",
"// choose an appropriate formatter",
"final",
"Formatter",
"fmt",
";",
"final",
"Style",
"style",
";",
"// always format progress messages using the progre... | Publish a log record to the logging pane.
@param record
Log record
@throws Exception | [
"Publish",
"a",
"log",
"record",
"to",
"the",
"logging",
"pane",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/LogPane.java#L141-L188 |
64,234 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java | SNE.optimizeSNE | protected void optimizeSNE(AffinityMatrix pij, double[][] sol) {
final int size = pij.size();
if(size * 3L * dim > 0x7FFF_FFFAL) {
throw new AbortException("Memory exceeds Java array size limit.");
}
// Meta information on each point; joined for memory locality.
// Gradient, Momentum, and lear... | java | protected void optimizeSNE(AffinityMatrix pij, double[][] sol) {
final int size = pij.size();
if(size * 3L * dim > 0x7FFF_FFFAL) {
throw new AbortException("Memory exceeds Java array size limit.");
}
// Meta information on each point; joined for memory locality.
// Gradient, Momentum, and lear... | [
"protected",
"void",
"optimizeSNE",
"(",
"AffinityMatrix",
"pij",
",",
"double",
"[",
"]",
"[",
"]",
"sol",
")",
"{",
"final",
"int",
"size",
"=",
"pij",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"*",
"3L",
"*",
"dim",
">",
"0x7FFF_FFFA",
"L",... | Perform the actual tSNE optimization.
@param pij Initial affinity matrix
@param sol Solution output array (preinitialized) | [
"Perform",
"the",
"actual",
"tSNE",
"optimization",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java#L219-L248 |
64,235 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java | SNE.computeQij | protected double computeQij(double[][] qij, double[][] solution) {
double qij_sum = 0;
for(int i = 1; i < qij.length; i++) {
final double[] qij_i = qij[i], vi = solution[i];
for(int j = 0; j < i; j++) {
qij_sum += qij_i[j] = qij[j][i] = MathUtil.exp(-sqDist(vi, solution[j]));
}
}
... | java | protected double computeQij(double[][] qij, double[][] solution) {
double qij_sum = 0;
for(int i = 1; i < qij.length; i++) {
final double[] qij_i = qij[i], vi = solution[i];
for(int j = 0; j < i; j++) {
qij_sum += qij_i[j] = qij[j][i] = MathUtil.exp(-sqDist(vi, solution[j]));
}
}
... | [
"protected",
"double",
"computeQij",
"(",
"double",
"[",
"]",
"[",
"]",
"qij",
",",
"double",
"[",
"]",
"[",
"]",
"solution",
")",
"{",
"double",
"qij_sum",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
"qij",
".",
"length",
"... | Compute the qij of the solution, and the sum.
@param qij Qij matrix (output)
@param solution Solution matrix (input)
@return qij sum | [
"Compute",
"the",
"qij",
"of",
"the",
"solution",
"and",
"the",
"sum",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java#L257-L266 |
64,236 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java | SNE.computeGradient | protected void computeGradient(AffinityMatrix pij, double[][] qij, double qij_isum, double[][] sol, double[] meta) {
final int dim3 = dim * 3;
int size = pij.size();
for(int i = 0, off = 0; i < size; i++, off += dim3) {
final double[] sol_i = sol[i], qij_i = qij[i];
Arrays.fill(meta, off, off + ... | java | protected void computeGradient(AffinityMatrix pij, double[][] qij, double qij_isum, double[][] sol, double[] meta) {
final int dim3 = dim * 3;
int size = pij.size();
for(int i = 0, off = 0; i < size; i++, off += dim3) {
final double[] sol_i = sol[i], qij_i = qij[i];
Arrays.fill(meta, off, off + ... | [
"protected",
"void",
"computeGradient",
"(",
"AffinityMatrix",
"pij",
",",
"double",
"[",
"]",
"[",
"]",
"qij",
",",
"double",
"qij_isum",
",",
"double",
"[",
"]",
"[",
"]",
"sol",
",",
"double",
"[",
"]",
"meta",
")",
"{",
"final",
"int",
"dim3",
"=... | Compute the gradients.
@param pij Desired affinity matrix
@param qij Projected affinity matrix
@param qij_isum Normalization factor
@param sol Current solution coordinates
@param meta Point metadata | [
"Compute",
"the",
"gradients",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/SNE.java#L295-L315 |
64,237 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/KMeansOutlierDetection.java | KMeansOutlierDetection.run | public OutlierResult run(Database database, Relation<O> relation) {
DistanceFunction<? super O> df = clusterer.getDistanceFunction();
DistanceQuery<O> dq = database.getDistanceQuery(relation, df);
// TODO: improve ELKI api to ensure we're using the same DBIDs!
Clustering<?> c = clusterer.run(database, ... | java | public OutlierResult run(Database database, Relation<O> relation) {
DistanceFunction<? super O> df = clusterer.getDistanceFunction();
DistanceQuery<O> dq = database.getDistanceQuery(relation, df);
// TODO: improve ELKI api to ensure we're using the same DBIDs!
Clustering<?> c = clusterer.run(database, ... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"DistanceFunction",
"<",
"?",
"super",
"O",
">",
"df",
"=",
"clusterer",
".",
"getDistanceFunction",
"(",
")",
";",
"DistanceQuery",
"<",
"... | Run the outlier detection algorithm.
@param database Database
@param relation Relation
@return Outlier detection result | [
"Run",
"the",
"outlier",
"detection",
"algorithm",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/clustering/KMeansOutlierDetection.java#L102-L129 |
64,238 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/fitting/GaussianFittingFunction.java | GaussianFittingFunction.eval | @Override
public FittingFunctionResult eval(double x, double[] params) {
final int len = params.length;
// We always need triples: (mean, stddev, scaling)
assert (len % 3) == 0;
double y = 0.0;
double[] gradients = new double[len];
// Loosely based on the book:
// Numerical Recipes in C:... | java | @Override
public FittingFunctionResult eval(double x, double[] params) {
final int len = params.length;
// We always need triples: (mean, stddev, scaling)
assert (len % 3) == 0;
double y = 0.0;
double[] gradients = new double[len];
// Loosely based on the book:
// Numerical Recipes in C:... | [
"@",
"Override",
"public",
"FittingFunctionResult",
"eval",
"(",
"double",
"x",
",",
"double",
"[",
"]",
"params",
")",
"{",
"final",
"int",
"len",
"=",
"params",
".",
"length",
";",
"// We always need triples: (mean, stddev, scaling)",
"assert",
"(",
"len",
"%"... | Compute the mixture of Gaussians at the given position | [
"Compute",
"the",
"mixture",
"of",
"Gaussians",
"at",
"the",
"given",
"position"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/fitting/GaussianFittingFunction.java#L61-L90 |
64,239 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/VisualizePairwiseGainMatrix.java | VisualizePairwiseGainMatrix.showVisualization | private void showVisualization(VisualizerContext context, SimilarityMatrixVisualizer factory, VisualizationTask task) {
VisualizationPlot plot = new VisualizationPlot();
Visualization vis = factory.makeVisualization(context, task, plot, 1.0, 1.0, null);
plot.getRoot().appendChild(vis.getLayer());
plot.g... | java | private void showVisualization(VisualizerContext context, SimilarityMatrixVisualizer factory, VisualizationTask task) {
VisualizationPlot plot = new VisualizationPlot();
Visualization vis = factory.makeVisualization(context, task, plot, 1.0, 1.0, null);
plot.getRoot().appendChild(vis.getLayer());
plot.g... | [
"private",
"void",
"showVisualization",
"(",
"VisualizerContext",
"context",
",",
"SimilarityMatrixVisualizer",
"factory",
",",
"VisualizationTask",
"task",
")",
"{",
"VisualizationPlot",
"plot",
"=",
"new",
"VisualizationPlot",
"(",
")",
";",
"Visualization",
"vis",
... | Show a single visualization.
@param context Visualizer context
@param factory Visualizer factory
@param task Visualization task | [
"Show",
"a",
"single",
"visualization",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/VisualizePairwiseGainMatrix.java#L265-L275 |
64,240 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/IntegerMinMax.java | IntegerMinMax.put | public void put(int[] data) {
final int l = data.length;
for(int i = 0; i < l; i++) {
put(data[i]);
}
} | java | public void put(int[] data) {
final int l = data.length;
for(int i = 0; i < l; i++) {
put(data[i]);
}
} | [
"public",
"void",
"put",
"(",
"int",
"[",
"]",
"data",
")",
"{",
"final",
"int",
"l",
"=",
"data",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"l",
";",
"i",
"++",
")",
"{",
"put",
"(",
"data",
"[",
"i",
"]",
")",... | Process a whole array of int values.
If any of the values is smaller than the current minimum, it will become
the new minimum.
If any of the values is larger than the current maximum, it will become the
new maximum.
@param data Data to process | [
"Process",
"a",
"whole",
"array",
"of",
"int",
"values",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/IntegerMinMax.java#L90-L95 |
64,241 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java | KDEOS.run | public OutlierResult run(Database database, Relation<O> rel) {
final DBIDs ids = rel.getDBIDs();
LOG.verbose("Running kNN preprocessor.");
KNNQuery<O> knnq = DatabaseUtil.precomputedKNNQuery(database, rel, getDistanceFunction(), kmax + 1);
// Initialize store for densities
WritableDataStore<double... | java | public OutlierResult run(Database database, Relation<O> rel) {
final DBIDs ids = rel.getDBIDs();
LOG.verbose("Running kNN preprocessor.");
KNNQuery<O> knnq = DatabaseUtil.precomputedKNNQuery(database, rel, getDistanceFunction(), kmax + 1);
// Initialize store for densities
WritableDataStore<double... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"rel",
")",
"{",
"final",
"DBIDs",
"ids",
"=",
"rel",
".",
"getDBIDs",
"(",
")",
";",
"LOG",
".",
"verbose",
"(",
"\"Running kNN preprocessor.\"",
")",
";",
"K... | Run the KDEOS outlier detection algorithm.
@param database Database to query
@param rel Relation to process
@return Outlier detection result | [
"Run",
"the",
"KDEOS",
"outlier",
"detection",
"algorithm",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java#L169-L187 |
64,242 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java | KDEOS.estimateDensities | protected void estimateDensities(Relation<O> rel, KNNQuery<O> knnq, final DBIDs ids, WritableDataStore<double[]> densities) {
final int dim = dimensionality(rel);
final int knum = kmax + 1 - kmin;
// Initialize storage:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
densities.put(... | java | protected void estimateDensities(Relation<O> rel, KNNQuery<O> knnq, final DBIDs ids, WritableDataStore<double[]> densities) {
final int dim = dimensionality(rel);
final int knum = kmax + 1 - kmin;
// Initialize storage:
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
densities.put(... | [
"protected",
"void",
"estimateDensities",
"(",
"Relation",
"<",
"O",
">",
"rel",
",",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"final",
"DBIDs",
"ids",
",",
"WritableDataStore",
"<",
"double",
"[",
"]",
">",
"densities",
")",
"{",
"final",
"int",
"dim",
... | Perform the kernel density estimation step.
@param rel Relation to query
@param knnq kNN query
@param ids IDs to process
@param densities Density storage | [
"Perform",
"the",
"kernel",
"density",
"estimation",
"step",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java#L197-L236 |
64,243 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java | KDEOS.dimensionality | private int dimensionality(Relation<O> rel) {
// Explicit:
if(idim >= 0) {
return idim;
}
// Cast to vector field relation.
@SuppressWarnings("unchecked")
final Relation<NumberVector> frel = (Relation<NumberVector>) rel;
int dim = RelationUtil.dimensionality(frel);
if(dim < 1) {
... | java | private int dimensionality(Relation<O> rel) {
// Explicit:
if(idim >= 0) {
return idim;
}
// Cast to vector field relation.
@SuppressWarnings("unchecked")
final Relation<NumberVector> frel = (Relation<NumberVector>) rel;
int dim = RelationUtil.dimensionality(frel);
if(dim < 1) {
... | [
"private",
"int",
"dimensionality",
"(",
"Relation",
"<",
"O",
">",
"rel",
")",
"{",
"// Explicit:",
"if",
"(",
"idim",
">=",
"0",
")",
"{",
"return",
"idim",
";",
"}",
"// Cast to vector field relation.",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
... | Ugly hack to allow using this implementation without having a well-defined
dimensionality.
@param rel Data relation
@return Dimensionality | [
"Ugly",
"hack",
"to",
"allow",
"using",
"this",
"implementation",
"without",
"having",
"a",
"well",
"-",
"defined",
"dimensionality",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java#L245-L258 |
64,244 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java | KDEOS.computeOutlierScores | protected void computeOutlierScores(KNNQuery<O> knnq, final DBIDs ids, WritableDataStore<double[]> densities, WritableDoubleDataStore kdeos, DoubleMinMax minmax) {
final int knum = kmax + 1 - kmin;
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Computing KDEOS scores", ids.size(), LOG) : null;
... | java | protected void computeOutlierScores(KNNQuery<O> knnq, final DBIDs ids, WritableDataStore<double[]> densities, WritableDoubleDataStore kdeos, DoubleMinMax minmax) {
final int knum = kmax + 1 - kmin;
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Computing KDEOS scores", ids.size(), LOG) : null;
... | [
"protected",
"void",
"computeOutlierScores",
"(",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"final",
"DBIDs",
"ids",
",",
"WritableDataStore",
"<",
"double",
"[",
"]",
">",
"densities",
",",
"WritableDoubleDataStore",
"kdeos",
",",
"DoubleMinMax",
"minmax",
")",
... | Compute the final KDEOS scores.
@param knnq kNN query
@param ids IDs to process
@param densities Density estimates
@param kdeos Score outputs
@param minmax Minimum and maximum scores | [
"Compute",
"the",
"final",
"KDEOS",
"scores",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/KDEOS.java#L269-L312 |
64,245 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.run | public Clustering<Model> run(Relation<V> rel) {
fulldatabase = preprocess(rel);
processedIDs = DBIDUtil.newHashSet(fulldatabase.size());
noiseDim = dimensionality(fulldatabase);
FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("CASH Clustering", fulldatabase.size(), LOG) : null;
Clust... | java | public Clustering<Model> run(Relation<V> rel) {
fulldatabase = preprocess(rel);
processedIDs = DBIDUtil.newHashSet(fulldatabase.size());
noiseDim = dimensionality(fulldatabase);
FiniteProgress progress = LOG.isVerbose() ? new FiniteProgress("CASH Clustering", fulldatabase.size(), LOG) : null;
Clust... | [
"public",
"Clustering",
"<",
"Model",
">",
"run",
"(",
"Relation",
"<",
"V",
">",
"rel",
")",
"{",
"fulldatabase",
"=",
"preprocess",
"(",
"rel",
")",
";",
"processedIDs",
"=",
"DBIDUtil",
".",
"newHashSet",
"(",
"fulldatabase",
".",
"size",
"(",
")",
... | Run CASH on the relation.
@param rel Relation
@return Clustering result | [
"Run",
"CASH",
"on",
"the",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L188-L211 |
64,246 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.preprocess | private Relation<ParameterizationFunction> preprocess(Relation<V> vrel) {
DBIDs ids = vrel.getDBIDs();
SimpleTypeInformation<ParameterizationFunction> type = new SimpleTypeInformation<>(ParameterizationFunction.class);
WritableDataStore<ParameterizationFunction> prep = DataStoreUtil.makeStorage(ids, DataSto... | java | private Relation<ParameterizationFunction> preprocess(Relation<V> vrel) {
DBIDs ids = vrel.getDBIDs();
SimpleTypeInformation<ParameterizationFunction> type = new SimpleTypeInformation<>(ParameterizationFunction.class);
WritableDataStore<ParameterizationFunction> prep = DataStoreUtil.makeStorage(ids, DataSto... | [
"private",
"Relation",
"<",
"ParameterizationFunction",
">",
"preprocess",
"(",
"Relation",
"<",
"V",
">",
"vrel",
")",
"{",
"DBIDs",
"ids",
"=",
"vrel",
".",
"getDBIDs",
"(",
")",
";",
"SimpleTypeInformation",
"<",
"ParameterizationFunction",
">",
"type",
"="... | Preprocess the dataset, precomputing the parameterization functions.
@param vrel Vector relation
@return Preprocessed relation | [
"Preprocess",
"the",
"dataset",
"precomputing",
"the",
"parameterization",
"functions",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L219-L229 |
64,247 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.initHeap | private void initHeap(ObjectHeap<CASHInterval> heap, Relation<ParameterizationFunction> relation, int dim, DBIDs ids) {
CASHIntervalSplit split = new CASHIntervalSplit(relation, minPts);
// determine minimum and maximum function value of all functions
double[] minMax = determineMinMaxDistance(relation, dim... | java | private void initHeap(ObjectHeap<CASHInterval> heap, Relation<ParameterizationFunction> relation, int dim, DBIDs ids) {
CASHIntervalSplit split = new CASHIntervalSplit(relation, minPts);
// determine minimum and maximum function value of all functions
double[] minMax = determineMinMaxDistance(relation, dim... | [
"private",
"void",
"initHeap",
"(",
"ObjectHeap",
"<",
"CASHInterval",
">",
"heap",
",",
"Relation",
"<",
"ParameterizationFunction",
">",
"relation",
",",
"int",
"dim",
",",
"DBIDs",
"ids",
")",
"{",
"CASHIntervalSplit",
"split",
"=",
"new",
"CASHIntervalSplit"... | Initializes the heap with the root intervals.
@param heap the heap to be initialized
@param relation the database storing the parameterization functions
@param dim the dimensionality of the database
@param ids the ids of the database | [
"Initializes",
"the",
"heap",
"with",
"the",
"root",
"intervals",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L376-L414 |
64,248 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.buildDB | private MaterializedRelation<ParameterizationFunction> buildDB(int dim, double[][] basis, DBIDs ids, Relation<ParameterizationFunction> relation) {
ProxyDatabase proxy = new ProxyDatabase(ids);
SimpleTypeInformation<ParameterizationFunction> type = new SimpleTypeInformation<>(ParameterizationFunction.class);
... | java | private MaterializedRelation<ParameterizationFunction> buildDB(int dim, double[][] basis, DBIDs ids, Relation<ParameterizationFunction> relation) {
ProxyDatabase proxy = new ProxyDatabase(ids);
SimpleTypeInformation<ParameterizationFunction> type = new SimpleTypeInformation<>(ParameterizationFunction.class);
... | [
"private",
"MaterializedRelation",
"<",
"ParameterizationFunction",
">",
"buildDB",
"(",
"int",
"dim",
",",
"double",
"[",
"]",
"[",
"]",
"basis",
",",
"DBIDs",
"ids",
",",
"Relation",
"<",
"ParameterizationFunction",
">",
"relation",
")",
"{",
"ProxyDatabase",
... | Builds a dim-1 dimensional database where the objects are projected into
the specified subspace.
@param dim the dimensionality of the database
@param basis the basis defining the subspace
@param ids the ids for the new database
@param relation the database storing the parameterization functions
@return a dim-1 dimensi... | [
"Builds",
"a",
"dim",
"-",
"1",
"dimensional",
"database",
"where",
"the",
"objects",
"are",
"projected",
"into",
"the",
"specified",
"subspace",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L427-L443 |
64,249 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.project | private ParameterizationFunction project(double[][] basis, ParameterizationFunction f) {
// Matrix m = new Matrix(new
// double[][]{f.getPointCoordinates()}).times(basis);
double[] m = transposeTimes(basis, f.getColumnVector());
return new ParameterizationFunction(DoubleVector.wrap(m));
} | java | private ParameterizationFunction project(double[][] basis, ParameterizationFunction f) {
// Matrix m = new Matrix(new
// double[][]{f.getPointCoordinates()}).times(basis);
double[] m = transposeTimes(basis, f.getColumnVector());
return new ParameterizationFunction(DoubleVector.wrap(m));
} | [
"private",
"ParameterizationFunction",
"project",
"(",
"double",
"[",
"]",
"[",
"]",
"basis",
",",
"ParameterizationFunction",
"f",
")",
"{",
"// Matrix m = new Matrix(new",
"// double[][]{f.getPointCoordinates()}).times(basis);",
"double",
"[",
"]",
"m",
"=",
"transposeT... | Projects the specified parameterization function into the subspace
described by the given basis.
@param basis the basis defining he subspace
@param f the parameterization function to be projected
@return the projected parameterization function | [
"Projects",
"the",
"specified",
"parameterization",
"function",
"into",
"the",
"subspace",
"described",
"by",
"the",
"given",
"basis",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L453-L458 |
64,250 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.determineBasis | private double[][] determineBasis(double[] alpha) {
final int dim = alpha.length;
// Primary vector:
double[] nn = new double[dim + 1];
for(int i = 0; i < nn.length; i++) {
double alpha_i = i == alpha.length ? 0 : alpha[i];
nn[i] = ParameterizationFunction.sinusProduct(0, i, alpha) * FastMat... | java | private double[][] determineBasis(double[] alpha) {
final int dim = alpha.length;
// Primary vector:
double[] nn = new double[dim + 1];
for(int i = 0; i < nn.length; i++) {
double alpha_i = i == alpha.length ? 0 : alpha[i];
nn[i] = ParameterizationFunction.sinusProduct(0, i, alpha) * FastMat... | [
"private",
"double",
"[",
"]",
"[",
"]",
"determineBasis",
"(",
"double",
"[",
"]",
"alpha",
")",
"{",
"final",
"int",
"dim",
"=",
"alpha",
".",
"length",
";",
"// Primary vector:",
"double",
"[",
"]",
"nn",
"=",
"new",
"double",
"[",
"dim",
"+",
"1"... | Determines a basis defining a subspace described by the specified alpha
values.
@param alpha the alpha values
@return a basis defining a subspace described by the specified alpha values | [
"Determines",
"a",
"basis",
"defining",
"a",
"subspace",
"described",
"by",
"the",
"specified",
"alpha",
"values",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L467-L506 |
64,251 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.determineNextIntervalAtMaxLevel | private CASHInterval determineNextIntervalAtMaxLevel(ObjectHeap<CASHInterval> heap) {
CASHInterval next = doDetermineNextIntervalAtMaxLevel(heap);
// noise path was chosen
while(next == null) {
if(heap.isEmpty()) {
return null;
}
next = doDetermineNextIntervalAtMaxLevel(heap);
... | java | private CASHInterval determineNextIntervalAtMaxLevel(ObjectHeap<CASHInterval> heap) {
CASHInterval next = doDetermineNextIntervalAtMaxLevel(heap);
// noise path was chosen
while(next == null) {
if(heap.isEmpty()) {
return null;
}
next = doDetermineNextIntervalAtMaxLevel(heap);
... | [
"private",
"CASHInterval",
"determineNextIntervalAtMaxLevel",
"(",
"ObjectHeap",
"<",
"CASHInterval",
">",
"heap",
")",
"{",
"CASHInterval",
"next",
"=",
"doDetermineNextIntervalAtMaxLevel",
"(",
"heap",
")",
";",
"// noise path was chosen",
"while",
"(",
"next",
"==",
... | Determines the next ''best'' interval at maximum level, i.e. the next
interval containing the most unprocessed objects.
@param heap the heap storing the intervals
@return the next ''best'' interval at maximum level | [
"Determines",
"the",
"next",
"best",
"interval",
"at",
"maximum",
"level",
"i",
".",
"e",
".",
"the",
"next",
"interval",
"containing",
"the",
"most",
"unprocessed",
"objects",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L515-L525 |
64,252 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.doDetermineNextIntervalAtMaxLevel | private CASHInterval doDetermineNextIntervalAtMaxLevel(ObjectHeap<CASHInterval> heap) {
CASHInterval interval = heap.poll();
int dim = interval.getDimensionality();
while(true) {
// max level is reached
if(interval.getLevel() >= maxLevel && interval.getMaxSplitDimension() == (dim - 1)) {
... | java | private CASHInterval doDetermineNextIntervalAtMaxLevel(ObjectHeap<CASHInterval> heap) {
CASHInterval interval = heap.poll();
int dim = interval.getDimensionality();
while(true) {
// max level is reached
if(interval.getLevel() >= maxLevel && interval.getMaxSplitDimension() == (dim - 1)) {
... | [
"private",
"CASHInterval",
"doDetermineNextIntervalAtMaxLevel",
"(",
"ObjectHeap",
"<",
"CASHInterval",
">",
"heap",
")",
"{",
"CASHInterval",
"interval",
"=",
"heap",
".",
"poll",
"(",
")",
";",
"int",
"dim",
"=",
"interval",
".",
"getDimensionality",
"(",
")",... | Recursive helper method to determine the next ''best'' interval at maximum
level, i.e. the next interval containing the most unprocessed objects
@param heap the heap storing the intervals
@return the next ''best'' interval at maximum level | [
"Recursive",
"helper",
"method",
"to",
"determine",
"the",
"next",
"best",
"interval",
"at",
"maximum",
"level",
"i",
".",
"e",
".",
"the",
"next",
"interval",
"containing",
"the",
"most",
"unprocessed",
"objects"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L534-L584 |
64,253 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java | CASH.determineMinMaxDistance | private double[] determineMinMaxDistance(Relation<ParameterizationFunction> relation, int dimensionality) {
double[] min = new double[dimensionality - 1];
double[] max = new double[dimensionality - 1];
Arrays.fill(max, Math.PI);
HyperBoundingBox box = new HyperBoundingBox(min, max);
double d_min = ... | java | private double[] determineMinMaxDistance(Relation<ParameterizationFunction> relation, int dimensionality) {
double[] min = new double[dimensionality - 1];
double[] max = new double[dimensionality - 1];
Arrays.fill(max, Math.PI);
HyperBoundingBox box = new HyperBoundingBox(min, max);
double d_min = ... | [
"private",
"double",
"[",
"]",
"determineMinMaxDistance",
"(",
"Relation",
"<",
"ParameterizationFunction",
">",
"relation",
",",
"int",
"dimensionality",
")",
"{",
"double",
"[",
"]",
"min",
"=",
"new",
"double",
"[",
"dimensionality",
"-",
"1",
"]",
";",
"... | Determines the minimum and maximum function value of all parameterization
functions stored in the specified database.
@param relation the database containing the parameterization functions.
@param dimensionality the dimensionality of the database
@return an array containing the minimum and maximum function value of al... | [
"Determines",
"the",
"minimum",
"and",
"maximum",
"function",
"value",
"of",
"all",
"parameterization",
"functions",
"stored",
"in",
"the",
"specified",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/CASH.java#L595-L612 |
64,254 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/RankingQualityHistogram.java | RankingQualityHistogram.run | public HistogramResult run(Database database, Relation<O> relation) {
final DistanceQuery<O> distanceQuery = database.getDistanceQuery(relation, getDistanceFunction());
final KNNQuery<O> knnQuery = database.getKNNQuery(distanceQuery, relation.size());
if(LOG.isVerbose()) {
LOG.verbose("Preprocessing ... | java | public HistogramResult run(Database database, Relation<O> relation) {
final DistanceQuery<O> distanceQuery = database.getDistanceQuery(relation, getDistanceFunction());
final KNNQuery<O> knnQuery = database.getKNNQuery(distanceQuery, relation.size());
if(LOG.isVerbose()) {
LOG.verbose("Preprocessing ... | [
"public",
"HistogramResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"final",
"DistanceQuery",
"<",
"O",
">",
"distanceQuery",
"=",
"database",
".",
"getDistanceQuery",
"(",
"relation",
",",
"getDistanceFunction"... | Process a database
@param database Database to process
@param relation Relation to process
@return Histogram of ranking qualities | [
"Process",
"a",
"database"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/RankingQualityHistogram.java#L99-L140 |
64,255 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java | EM.run | public Clustering<M> run(Database database, Relation<V> relation) {
if(relation.size() == 0) {
throw new IllegalArgumentException("database empty: must contain elements");
}
// initial models
List<? extends EMClusterModel<M>> models = mfactory.buildInitialModels(database, relation, k, SquaredEucli... | java | public Clustering<M> run(Database database, Relation<V> relation) {
if(relation.size() == 0) {
throw new IllegalArgumentException("database empty: must contain elements");
}
// initial models
List<? extends EMClusterModel<M>> models = mfactory.buildInitialModels(database, relation, k, SquaredEucli... | [
"public",
"Clustering",
"<",
"M",
">",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"if",
"(",
"relation",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"data... | Performs the EM clustering algorithm on the given database.
Finally a hard clustering is provided where each clusters gets assigned the
points exhibiting the highest probability to belong to this cluster. But
still, the database objects hold associated the complete probability-vector
for all models.
@param database D... | [
"Performs",
"the",
"EM",
"clustering",
"algorithm",
"on",
"the",
"given",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java#L213-L272 |
64,256 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java | EM.recomputeCovarianceMatrices | public static void recomputeCovarianceMatrices(Relation<? extends NumberVector> relation, WritableDataStore<double[]> probClusterIGivenX, List<? extends EMClusterModel<?>> models, double prior) {
final int k = models.size();
boolean needsTwoPass = false;
for(EMClusterModel<?> m : models) {
m.beginESte... | java | public static void recomputeCovarianceMatrices(Relation<? extends NumberVector> relation, WritableDataStore<double[]> probClusterIGivenX, List<? extends EMClusterModel<?>> models, double prior) {
final int k = models.size();
boolean needsTwoPass = false;
for(EMClusterModel<?> m : models) {
m.beginESte... | [
"public",
"static",
"void",
"recomputeCovarianceMatrices",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
",",
"WritableDataStore",
"<",
"double",
"[",
"]",
">",
"probClusterIGivenX",
",",
"List",
"<",
"?",
"extends",
"EMClusterModel",
"<",... | Recompute the covariance matrixes.
@param relation Vector data
@param probClusterIGivenX Object probabilities
@param models Cluster models to update
@param prior MAP prior (use 0 for MLE) | [
"Recompute",
"the",
"covariance",
"matrixes",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java#L282-L322 |
64,257 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java | EM.assignProbabilitiesToInstances | public static double assignProbabilitiesToInstances(Relation<? extends NumberVector> relation, List<? extends EMClusterModel<?>> models, WritableDataStore<double[]> probClusterIGivenX) {
final int k = models.size();
double emSum = 0.;
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advan... | java | public static double assignProbabilitiesToInstances(Relation<? extends NumberVector> relation, List<? extends EMClusterModel<?>> models, WritableDataStore<double[]> probClusterIGivenX) {
final int k = models.size();
double emSum = 0.;
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid(); iditer.advan... | [
"public",
"static",
"double",
"assignProbabilitiesToInstances",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
",",
"List",
"<",
"?",
"extends",
"EMClusterModel",
"<",
"?",
">",
">",
"models",
",",
"WritableDataStore",
"<",
"double",
"[",... | Assigns the current probability values to the instances in the database and
compute the expectation value of the current mixture of distributions.
Computed as the sum of the logarithms of the prior probability of each
instance.
@param relation the database used for assignment to instances
@param models Cluster models... | [
"Assigns",
"the",
"current",
"probability",
"values",
"to",
"the",
"instances",
"in",
"the",
"database",
"and",
"compute",
"the",
"expectation",
"value",
"of",
"the",
"current",
"mixture",
"of",
"distributions",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/em/EM.java#L336-L355 |
64,258 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/ResultWindow.java | DynamicMenu.updateVisualizerMenus | protected synchronized void updateVisualizerMenus() {
Projection proj = null;
if(svgCanvas.getPlot() instanceof DetailView) {
PlotItem item = ((DetailView) svgCanvas.getPlot()).getPlotItem();
proj = item.proj;
}
menubar.removeAll();
menubar.add(filemenu);
ResultHierar... | java | protected synchronized void updateVisualizerMenus() {
Projection proj = null;
if(svgCanvas.getPlot() instanceof DetailView) {
PlotItem item = ((DetailView) svgCanvas.getPlot()).getPlotItem();
proj = item.proj;
}
menubar.removeAll();
menubar.add(filemenu);
ResultHierar... | [
"protected",
"synchronized",
"void",
"updateVisualizerMenus",
"(",
")",
"{",
"Projection",
"proj",
"=",
"null",
";",
"if",
"(",
"svgCanvas",
".",
"getPlot",
"(",
")",
"instanceof",
"DetailView",
")",
"{",
"PlotItem",
"item",
"=",
"(",
"(",
"DetailView",
")",... | Update the visualizer menus. | [
"Update",
"the",
"visualizer",
"menus",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/gui/ResultWindow.java#L204-L234 |
64,259 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/HiCS.java | HiCS.run | public OutlierResult run(Relation<V> relation) {
final DBIDs ids = relation.getDBIDs();
ArrayList<ArrayDBIDs> subspaceIndex = buildOneDimIndexes(relation);
Set<HiCSSubspace> subspaces = calculateSubspaces(relation, subspaceIndex, rnd.getSingleThreadedRandom());
if(LOG.isVerbose()) {
LOG.verbose(... | java | public OutlierResult run(Relation<V> relation) {
final DBIDs ids = relation.getDBIDs();
ArrayList<ArrayDBIDs> subspaceIndex = buildOneDimIndexes(relation);
Set<HiCSSubspace> subspaces = calculateSubspaces(relation, subspaceIndex, rnd.getSingleThreadedRandom());
if(LOG.isVerbose()) {
LOG.verbose(... | [
"public",
"OutlierResult",
"run",
"(",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"final",
"DBIDs",
"ids",
"=",
"relation",
".",
"getDBIDs",
"(",
")",
";",
"ArrayList",
"<",
"ArrayDBIDs",
">",
"subspaceIndex",
"=",
"buildOneDimIndexes",
"(",
"relation"... | Perform HiCS on a given database.
@param relation the database
@return The aggregated resulting scores that were assigned by the given
outlier detection algorithm | [
"Perform",
"HiCS",
"on",
"a",
"given",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/HiCS.java#L176-L224 |
64,260 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/HiCS.java | HiCS.buildOneDimIndexes | private ArrayList<ArrayDBIDs> buildOneDimIndexes(Relation<? extends NumberVector> relation) {
final int dim = RelationUtil.dimensionality(relation);
ArrayList<ArrayDBIDs> subspaceIndex = new ArrayList<>(dim + 1);
SortDBIDsBySingleDimension comp = new VectorUtil.SortDBIDsBySingleDimension(relation);
for... | java | private ArrayList<ArrayDBIDs> buildOneDimIndexes(Relation<? extends NumberVector> relation) {
final int dim = RelationUtil.dimensionality(relation);
ArrayList<ArrayDBIDs> subspaceIndex = new ArrayList<>(dim + 1);
SortDBIDsBySingleDimension comp = new VectorUtil.SortDBIDsBySingleDimension(relation);
for... | [
"private",
"ArrayList",
"<",
"ArrayDBIDs",
">",
"buildOneDimIndexes",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
")",
"{",
"final",
"int",
"dim",
"=",
"RelationUtil",
".",
"dimensionality",
"(",
"relation",
")",
";",
"ArrayList",
"<... | Calculates "index structures" for every attribute, i.e. sorts a
ModifiableArray of every DBID in the database for every dimension and
stores them in a list
@param relation Relation to index
@return List of sorted objects | [
"Calculates",
"index",
"structures",
"for",
"every",
"attribute",
"i",
".",
"e",
".",
"sorts",
"a",
"ModifiableArray",
"of",
"every",
"DBID",
"in",
"the",
"database",
"for",
"every",
"dimension",
"and",
"stores",
"them",
"in",
"a",
"list"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/meta/HiCS.java#L234-L247 |
64,261 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mktab/MkTabTree.java | MkTabTree.max | private double[] max(double[] distances1, double[] distances2) {
if(distances1.length != distances2.length) {
throw new RuntimeException("different lengths!");
}
double[] result = new double[distances1.length];
for(int i = 0; i < distances1.length; i++) {
result[i] = Math.max(distances1[i],... | java | private double[] max(double[] distances1, double[] distances2) {
if(distances1.length != distances2.length) {
throw new RuntimeException("different lengths!");
}
double[] result = new double[distances1.length];
for(int i = 0; i < distances1.length; i++) {
result[i] = Math.max(distances1[i],... | [
"private",
"double",
"[",
"]",
"max",
"(",
"double",
"[",
"]",
"distances1",
",",
"double",
"[",
"]",
"distances2",
")",
"{",
"if",
"(",
"distances1",
".",
"length",
"!=",
"distances2",
".",
"length",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
... | Returns an array that holds the maximum values of the both specified arrays
in each index.
@param distances1 the first array
@param distances2 the second array
@return an array that holds the maximum values of the both specified arrays
in each index | [
"Returns",
"an",
"array",
"that",
"holds",
"the",
"maximum",
"values",
"of",
"the",
"both",
"specified",
"arrays",
"in",
"each",
"index",
"."
] | 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/mktab/MkTabTree.java#L252-L262 |
64,262 | elki-project/elki | addons/joglvis/src/main/java/de/lmu/ifi/dbs/elki/joglvis/ShaderUtil.java | ShaderUtil.compileShader | public static int compileShader(Class<?> context, GL2 gl, int type, String name) throws ShaderCompilationException {
int prog = -1;
try (InputStream in = context.getResourceAsStream(name)) {
int[] error = new int[1];
String shaderdata = FileUtil.slurp(in);
prog = gl.glCreateShader(type);
... | java | public static int compileShader(Class<?> context, GL2 gl, int type, String name) throws ShaderCompilationException {
int prog = -1;
try (InputStream in = context.getResourceAsStream(name)) {
int[] error = new int[1];
String shaderdata = FileUtil.slurp(in);
prog = gl.glCreateShader(type);
... | [
"public",
"static",
"int",
"compileShader",
"(",
"Class",
"<",
"?",
">",
"context",
",",
"GL2",
"gl",
",",
"int",
"type",
",",
"String",
"name",
")",
"throws",
"ShaderCompilationException",
"{",
"int",
"prog",
"=",
"-",
"1",
";",
"try",
"(",
"InputStream... | Compile a shader from a file.
@param context Class context for loading the resource file.
@param gl GL context
@param type
@param name
@return Shader program number.
@throws ShaderCompilationException When compilation failed. | [
"Compile",
"a",
"shader",
"from",
"a",
"file",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/joglvis/src/main/java/de/lmu/ifi/dbs/elki/joglvis/ShaderUtil.java#L54-L81 |
64,263 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/AbstractEditDistanceFunction.java | AbstractEditDistanceFunction.effectiveBandSize | protected int effectiveBandSize(final int dim1, final int dim2) {
if(bandSize == Double.POSITIVE_INFINITY) {
return (dim1 > dim2) ? dim1 : dim2;
}
if(bandSize >= 1.) {
return (int) bandSize;
}
// Max * bandSize:
return (int) Math.ceil((dim1 >= dim2 ? dim1 : dim2) * bandSize);
} | java | protected int effectiveBandSize(final int dim1, final int dim2) {
if(bandSize == Double.POSITIVE_INFINITY) {
return (dim1 > dim2) ? dim1 : dim2;
}
if(bandSize >= 1.) {
return (int) bandSize;
}
// Max * bandSize:
return (int) Math.ceil((dim1 >= dim2 ? dim1 : dim2) * bandSize);
} | [
"protected",
"int",
"effectiveBandSize",
"(",
"final",
"int",
"dim1",
",",
"final",
"int",
"dim2",
")",
"{",
"if",
"(",
"bandSize",
"==",
"Double",
".",
"POSITIVE_INFINITY",
")",
"{",
"return",
"(",
"dim1",
">",
"dim2",
")",
"?",
"dim1",
":",
"dim2",
"... | Compute the effective band size.
@param dim1 First dimensionality
@param dim2 Second dimensionality
@return Effective bandsize | [
"Compute",
"the",
"effective",
"band",
"size",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/AbstractEditDistanceFunction.java#L61-L70 |
64,264 | elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java | AbstractNode.addLeafEntry | @Override
public final int addLeafEntry(E entry) {
// entry is not a leaf entry
if(!(entry instanceof LeafEntry)) {
throw new UnsupportedOperationException("Entry is not a leaf entry!");
}
// this is a not a leaf node
if(!isLeaf()) {
throw new UnsupportedOperationException("Node is not... | java | @Override
public final int addLeafEntry(E entry) {
// entry is not a leaf entry
if(!(entry instanceof LeafEntry)) {
throw new UnsupportedOperationException("Entry is not a leaf entry!");
}
// this is a not a leaf node
if(!isLeaf()) {
throw new UnsupportedOperationException("Node is not... | [
"@",
"Override",
"public",
"final",
"int",
"addLeafEntry",
"(",
"E",
"entry",
")",
"{",
"// entry is not a leaf entry",
"if",
"(",
"!",
"(",
"entry",
"instanceof",
"LeafEntry",
")",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Entry is not a ... | Adds a new leaf entry to this node's children and returns the index of the
entry in this node's children array. An UnsupportedOperationException will
be thrown if the entry is not a leaf entry or this node is not a leaf node.
@param entry the leaf entry to be added
@return the index of the entry in this node's childre... | [
"Adds",
"a",
"new",
"leaf",
"entry",
"to",
"this",
"node",
"s",
"children",
"and",
"returns",
"the",
"index",
"of",
"the",
"entry",
"in",
"this",
"node",
"s",
"children",
"array",
".",
"An",
"UnsupportedOperationException",
"will",
"be",
"thrown",
"if",
"t... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L165-L178 |
64,265 | elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java | AbstractNode.addDirectoryEntry | @Override
public final int addDirectoryEntry(E entry) {
// entry is not a directory entry
if(entry instanceof LeafEntry) {
throw new UnsupportedOperationException("Entry is not a directory entry!");
}
// this is a not a directory node
if(isLeaf()) {
throw new UnsupportedOperationExcept... | java | @Override
public final int addDirectoryEntry(E entry) {
// entry is not a directory entry
if(entry instanceof LeafEntry) {
throw new UnsupportedOperationException("Entry is not a directory entry!");
}
// this is a not a directory node
if(isLeaf()) {
throw new UnsupportedOperationExcept... | [
"@",
"Override",
"public",
"final",
"int",
"addDirectoryEntry",
"(",
"E",
"entry",
")",
"{",
"// entry is not a directory entry",
"if",
"(",
"entry",
"instanceof",
"LeafEntry",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Entry is not a directory e... | Adds a new directory entry to this node's children and returns the index of
the entry in this node's children array. An UnsupportedOperationException
will be thrown if the entry is not a directory entry or this node is not a
directory node.
@param entry the directory entry to be added
@return the index of the entry in... | [
"Adds",
"a",
"new",
"directory",
"entry",
"to",
"this",
"node",
"s",
"children",
"and",
"returns",
"the",
"index",
"of",
"the",
"entry",
"in",
"this",
"node",
"s",
"children",
"array",
".",
"An",
"UnsupportedOperationException",
"will",
"be",
"thrown",
"if",... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L191-L203 |
64,266 | elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java | AbstractNode.deleteEntry | public boolean deleteEntry(int index) {
System.arraycopy(entries, index + 1, entries, index, numEntries - index - 1);
entries[--numEntries] = null;
return true;
} | java | public boolean deleteEntry(int index) {
System.arraycopy(entries, index + 1, entries, index, numEntries - index - 1);
entries[--numEntries] = null;
return true;
} | [
"public",
"boolean",
"deleteEntry",
"(",
"int",
"index",
")",
"{",
"System",
".",
"arraycopy",
"(",
"entries",
",",
"index",
"+",
"1",
",",
"entries",
",",
"index",
",",
"numEntries",
"-",
"index",
"-",
"1",
")",
";",
"entries",
"[",
"--",
"numEntries"... | Deletes the entry at the specified index and shifts all entries after the
index to left.
@param index the index at which the entry is to be deleted
@return true id deletion was successful | [
"Deletes",
"the",
"entry",
"at",
"the",
"specified",
"index",
"and",
"shifts",
"all",
"entries",
"after",
"the",
"index",
"to",
"left",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L212-L216 |
64,267 | elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java | AbstractNode.getEntries | @SuppressWarnings("unchecked")
@Deprecated
public final List<E> getEntries() {
List<E> result = new ArrayList<>(numEntries);
for(Entry entry : entries) {
if(entry != null) {
result.add((E) entry);
}
}
return result;
} | java | @SuppressWarnings("unchecked")
@Deprecated
public final List<E> getEntries() {
List<E> result = new ArrayList<>(numEntries);
for(Entry entry : entries) {
if(entry != null) {
result.add((E) entry);
}
}
return result;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Deprecated",
"public",
"final",
"List",
"<",
"E",
">",
"getEntries",
"(",
")",
"{",
"List",
"<",
"E",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"numEntries",
")",
";",
"for",
"(",
"Entr... | Returns a list of the entries.
@return a list of the entries
@deprecated Using this method means an extra copy - usually at the cost of
performance. | [
"Returns",
"a",
"list",
"of",
"the",
"entries",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L245-L255 |
64,268 | elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java | AbstractNode.removeMask | public void removeMask(long[] mask) {
int dest = BitsUtil.nextSetBit(mask, 0);
if(dest < 0) {
return;
}
int src = BitsUtil.nextSetBit(mask, dest);
while(src < numEntries) {
if(!BitsUtil.get(mask, src)) {
entries[dest] = entries[src];
dest++;
}
src++;
}
... | java | public void removeMask(long[] mask) {
int dest = BitsUtil.nextSetBit(mask, 0);
if(dest < 0) {
return;
}
int src = BitsUtil.nextSetBit(mask, dest);
while(src < numEntries) {
if(!BitsUtil.get(mask, src)) {
entries[dest] = entries[src];
dest++;
}
src++;
}
... | [
"public",
"void",
"removeMask",
"(",
"long",
"[",
"]",
"mask",
")",
"{",
"int",
"dest",
"=",
"BitsUtil",
".",
"nextSetBit",
"(",
"mask",
",",
"0",
")",
";",
"if",
"(",
"dest",
"<",
"0",
")",
"{",
"return",
";",
"}",
"int",
"src",
"=",
"BitsUtil",... | Remove entries according to the given mask.
@param mask Mask to remove | [
"Remove",
"entries",
"according",
"to",
"the",
"given",
"mask",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L274-L293 |
64,269 | elki-project/elki | elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java | AbstractNode.splitTo | public final void splitTo(AbstractNode<E> newNode, List<E> sorting, int splitPoint) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder(1000) : null;
for(int i = 0; i < splitPoint; i++) {
addEntry(sorting.get(i));
i... | java | public final void splitTo(AbstractNode<E> newNode, List<E> sorting, int splitPoint) {
assert (isLeaf() == newNode.isLeaf());
deleteAllEntries();
StringBuilder msg = LoggingConfiguration.DEBUG ? new StringBuilder(1000) : null;
for(int i = 0; i < splitPoint; i++) {
addEntry(sorting.get(i));
i... | [
"public",
"final",
"void",
"splitTo",
"(",
"AbstractNode",
"<",
"E",
">",
"newNode",
",",
"List",
"<",
"E",
">",
"sorting",
",",
"int",
"splitPoint",
")",
"{",
"assert",
"(",
"isLeaf",
"(",
")",
"==",
"newNode",
".",
"isLeaf",
"(",
")",
")",
";",
"... | Redistribute entries according to the given sorting.
@param newNode Node to split to
@param sorting Sorting to use
@param splitPoint Split point | [
"Redistribute",
"entries",
"according",
"to",
"the",
"given",
"sorting",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index/src/main/java/de/lmu/ifi/dbs/elki/index/tree/AbstractNode.java#L302-L323 |
64,270 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/evaluation/AutomaticEvaluation.java | AutomaticEvaluation.ensureClusteringResult | public static void ensureClusteringResult(final Database db, final Result result) {
Collection<Clustering<?>> clusterings = ResultUtil.filterResults(db.getHierarchy(), result, Clustering.class);
if(clusterings.isEmpty()) {
ResultUtil.addChildResult(db, new ByLabelOrAllInOneClustering().run(db));
}
} | java | public static void ensureClusteringResult(final Database db, final Result result) {
Collection<Clustering<?>> clusterings = ResultUtil.filterResults(db.getHierarchy(), result, Clustering.class);
if(clusterings.isEmpty()) {
ResultUtil.addChildResult(db, new ByLabelOrAllInOneClustering().run(db));
}
} | [
"public",
"static",
"void",
"ensureClusteringResult",
"(",
"final",
"Database",
"db",
",",
"final",
"Result",
"result",
")",
"{",
"Collection",
"<",
"Clustering",
"<",
"?",
">",
">",
"clusterings",
"=",
"ResultUtil",
".",
"filterResults",
"(",
"db",
".",
"ge... | Ensure that the result contains at least one Clustering.
@param db Database to process
@param result result | [
"Ensure",
"that",
"the",
"result",
"contains",
"at",
"least",
"one",
"Clustering",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/evaluation/AutomaticEvaluation.java#L160-L165 |
64,271 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/estimator/meta/TrimmedEstimator.java | TrimmedEstimator.toPrimitiveDoubleArray | public static <A> double[] toPrimitiveDoubleArray(A data, NumberArrayAdapter<?, A> adapter) {
if(adapter == DoubleArrayAdapter.STATIC) {
return ((double[]) data).clone();
}
final int len = adapter.size(data);
double[] x = new double[len];
for(int i = 0; i < len; i++) {
x[i] = adapter.get... | java | public static <A> double[] toPrimitiveDoubleArray(A data, NumberArrayAdapter<?, A> adapter) {
if(adapter == DoubleArrayAdapter.STATIC) {
return ((double[]) data).clone();
}
final int len = adapter.size(data);
double[] x = new double[len];
for(int i = 0; i < len; i++) {
x[i] = adapter.get... | [
"public",
"static",
"<",
"A",
">",
"double",
"[",
"]",
"toPrimitiveDoubleArray",
"(",
"A",
"data",
",",
"NumberArrayAdapter",
"<",
"?",
",",
"A",
">",
"adapter",
")",
"{",
"if",
"(",
"adapter",
"==",
"DoubleArrayAdapter",
".",
"STATIC",
")",
"{",
"return... | Local copy, see ArrayLikeUtil.toPrimitiveDoubleArray.
@param data Data
@param adapter Adapter
@return Copy of the data, as {@code double[]} | [
"Local",
"copy",
"see",
"ArrayLikeUtil",
".",
"toPrimitiveDoubleArray",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/estimator/meta/TrimmedEstimator.java#L101-L111 |
64,272 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/CLISmartHandler.java | CLISmartHandler.flush | @Override
public void flush() {
try {
out.flush();
}
catch(Exception ex) {
reportError(null, ex, ErrorManager.FLUSH_FAILURE);
}
try {
err.flush();
}
catch(Exception ex) {
reportError(null, ex, ErrorManager.FLUSH_FAILURE);
}
} | java | @Override
public void flush() {
try {
out.flush();
}
catch(Exception ex) {
reportError(null, ex, ErrorManager.FLUSH_FAILURE);
}
try {
err.flush();
}
catch(Exception ex) {
reportError(null, ex, ErrorManager.FLUSH_FAILURE);
}
} | [
"@",
"Override",
"public",
"void",
"flush",
"(",
")",
"{",
"try",
"{",
"out",
".",
"flush",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"ex",
")",
"{",
"reportError",
"(",
"null",
",",
"ex",
",",
"ErrorManager",
".",
"FLUSH_FAILURE",
")",
";",
"... | Flush output streams | [
"Flush",
"output",
"streams"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/CLISmartHandler.java#L110-L124 |
64,273 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/CLISmartHandler.java | CLISmartHandler.publish | @Override
public void publish(final LogRecord record) {
// determine destination
final Writer destination;
if(record.getLevel().intValue() >= Level.WARNING.intValue()) {
destination = this.err;
}
else {
destination = this.out;
}
// format
final String m;
// Progress r... | java | @Override
public void publish(final LogRecord record) {
// determine destination
final Writer destination;
if(record.getLevel().intValue() >= Level.WARNING.intValue()) {
destination = this.err;
}
else {
destination = this.out;
}
// format
final String m;
// Progress r... | [
"@",
"Override",
"public",
"void",
"publish",
"(",
"final",
"LogRecord",
"record",
")",
"{",
"// determine destination",
"final",
"Writer",
"destination",
";",
"if",
"(",
"record",
".",
"getLevel",
"(",
")",
".",
"intValue",
"(",
")",
">=",
"Level",
".",
"... | Publish a log record. | [
"Publish",
"a",
"log",
"record",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/CLISmartHandler.java#L129-L210 |
64,274 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/EvaluatePrecomputedOutlierScores.java | EvaluatePrecomputedOutlierScores.checkForNaNs | private boolean checkForNaNs(NumberVector vec) {
for(int i = 0, d = vec.getDimensionality(); i < d; i++) {
double v = vec.doubleValue(i);
if(v != v) { // NaN!
return true;
}
}
return false;
} | java | private boolean checkForNaNs(NumberVector vec) {
for(int i = 0, d = vec.getDimensionality(); i < d; i++) {
double v = vec.doubleValue(i);
if(v != v) { // NaN!
return true;
}
}
return false;
} | [
"private",
"boolean",
"checkForNaNs",
"(",
"NumberVector",
"vec",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"d",
"=",
"vec",
".",
"getDimensionality",
"(",
")",
";",
"i",
"<",
"d",
";",
"i",
"++",
")",
"{",
"double",
"v",
"=",
"vec",
".",
... | Check for NaN values.
@param vec Vector
@return {@code true} if NaN values are present. | [
"Check",
"for",
"NaN",
"values",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/application/greedyensemble/EvaluatePrecomputedOutlierScores.java#L273-L281 |
64,275 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseUtil.java | DatabaseUtil.guessLabelRepresentation | public static Relation<String> guessLabelRepresentation(Database database) throws NoSupportedDataTypeException {
try {
Relation<? extends ClassLabel> classrep = database.getRelation(TypeUtil.CLASSLABEL);
if(classrep != null) {
return new ConvertToStringView(classrep);
}
}
catch(NoS... | java | public static Relation<String> guessLabelRepresentation(Database database) throws NoSupportedDataTypeException {
try {
Relation<? extends ClassLabel> classrep = database.getRelation(TypeUtil.CLASSLABEL);
if(classrep != null) {
return new ConvertToStringView(classrep);
}
}
catch(NoS... | [
"public",
"static",
"Relation",
"<",
"String",
">",
"guessLabelRepresentation",
"(",
"Database",
"database",
")",
"throws",
"NoSupportedDataTypeException",
"{",
"try",
"{",
"Relation",
"<",
"?",
"extends",
"ClassLabel",
">",
"classrep",
"=",
"database",
".",
"getR... | Guess a potentially label-like representation, preferring class labels.
@param database
@return string representation | [
"Guess",
"a",
"potentially",
"label",
"-",
"like",
"representation",
"preferring",
"class",
"labels",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseUtil.java#L64-L93 |
64,276 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseUtil.java | DatabaseUtil.getObjectsByLabelMatch | public static ArrayModifiableDBIDs getObjectsByLabelMatch(Database database, Pattern name_pattern) {
Relation<String> relation = guessLabelRepresentation(database);
if(name_pattern == null) {
return DBIDUtil.newArray();
}
ArrayModifiableDBIDs ret = DBIDUtil.newArray();
for(DBIDIter iditer = re... | java | public static ArrayModifiableDBIDs getObjectsByLabelMatch(Database database, Pattern name_pattern) {
Relation<String> relation = guessLabelRepresentation(database);
if(name_pattern == null) {
return DBIDUtil.newArray();
}
ArrayModifiableDBIDs ret = DBIDUtil.newArray();
for(DBIDIter iditer = re... | [
"public",
"static",
"ArrayModifiableDBIDs",
"getObjectsByLabelMatch",
"(",
"Database",
"database",
",",
"Pattern",
"name_pattern",
")",
"{",
"Relation",
"<",
"String",
">",
"relation",
"=",
"guessLabelRepresentation",
"(",
"database",
")",
";",
"if",
"(",
"name_patt... | Find object by matching their labels.
@param database Database to search in
@param name_pattern Name to match against class or object label
@return found cluster or it throws an exception. | [
"Find",
"object",
"by",
"matching",
"their",
"labels",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/database/DatabaseUtil.java#L166-L178 |
64,277 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPDirectoryEntry.java | MkCoPDirectoryEntry.writeExternal | @Override
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal(out);
out.writeObject(conservativeApproximation);
} | java | @Override
public void writeExternal(ObjectOutput out) throws IOException {
super.writeExternal(out);
out.writeObject(conservativeApproximation);
} | [
"@",
"Override",
"public",
"void",
"writeExternal",
"(",
"ObjectOutput",
"out",
")",
"throws",
"IOException",
"{",
"super",
".",
"writeExternal",
"(",
"out",
")",
";",
"out",
".",
"writeObject",
"(",
"conservativeApproximation",
")",
";",
"}"
] | Calls the super method and writes the conservative approximation of the knn
distances of this entry to the specified stream.
@param out the stream to write the object to
@throws java.io.IOException Includes any I/O exceptions that may occur | [
"Calls",
"the",
"super",
"method",
"and",
"writes",
"the",
"conservative",
"approximation",
"of",
"the",
"knn",
"distances",
"of",
"this",
"entry",
"to",
"the",
"specified",
"stream",
"."
] | 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/mkcop/MkCoPDirectoryEntry.java#L110-L114 |
64,278 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/mktrees/mkcop/MkCoPDirectoryEntry.java | MkCoPDirectoryEntry.readExternal | @Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
conservativeApproximation = (ApproximationLine) in.readObject();
} | java | @Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
super.readExternal(in);
conservativeApproximation = (ApproximationLine) in.readObject();
} | [
"@",
"Override",
"public",
"void",
"readExternal",
"(",
"ObjectInput",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"super",
".",
"readExternal",
"(",
"in",
")",
";",
"conservativeApproximation",
"=",
"(",
"ApproximationLine",
")",
"in",... | Calls the super method and reads the the conservative approximation of the
knn distances of this entry from the specified input stream.
@param in the stream to read data from in order to restore the object
@throws java.io.IOException if I/O errors occur
@throws ClassNotFoundException If the class for an object being r... | [
"Calls",
"the",
"super",
"method",
"and",
"reads",
"the",
"the",
"conservative",
"approximation",
"of",
"the",
"knn",
"distances",
"of",
"this",
"entry",
"from",
"the",
"specified",
"input",
"stream",
"."
] | 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/mkcop/MkCoPDirectoryEntry.java#L125-L129 |
64,279 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/ReferenceBasedOutlierDetection.java | ReferenceBasedOutlierDetection.updateDensities | protected void updateDensities(WritableDoubleDataStore rbod_score, DoubleDBIDList referenceDists) {
DoubleDBIDListIter it = referenceDists.iter();
for(int l = 0; l < referenceDists.size(); l++) {
double density = computeDensity(referenceDists, it, l);
// computeDensity modified the iterator, reset:
... | java | protected void updateDensities(WritableDoubleDataStore rbod_score, DoubleDBIDList referenceDists) {
DoubleDBIDListIter it = referenceDists.iter();
for(int l = 0; l < referenceDists.size(); l++) {
double density = computeDensity(referenceDists, it, l);
// computeDensity modified the iterator, reset:
... | [
"protected",
"void",
"updateDensities",
"(",
"WritableDoubleDataStore",
"rbod_score",
",",
"DoubleDBIDList",
"referenceDists",
")",
"{",
"DoubleDBIDListIter",
"it",
"=",
"referenceDists",
".",
"iter",
"(",
")",
";",
"for",
"(",
"int",
"l",
"=",
"0",
";",
"l",
... | Update the density estimates for each object.
@param rbod_score Density storage
@param referenceDists Distances from current reference point | [
"Update",
"the",
"density",
"estimates",
"for",
"each",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/ReferenceBasedOutlierDetection.java#L197-L208 |
64,280 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/KMeansPlusPlusInitialMeans.java | KMeansPlusPlusInitialMeans.chooseRemaining | static void chooseRemaining(Relation<? extends NumberVector> relation, DBIDs ids, DistanceQuery<NumberVector> distQ, int k, List<NumberVector> means, WritableDoubleDataStore weights, double weightsum, Random random) {
while(true) {
if(weightsum > Double.MAX_VALUE) {
throw new IllegalStateException("Co... | java | static void chooseRemaining(Relation<? extends NumberVector> relation, DBIDs ids, DistanceQuery<NumberVector> distQ, int k, List<NumberVector> means, WritableDoubleDataStore weights, double weightsum, Random random) {
while(true) {
if(weightsum > Double.MAX_VALUE) {
throw new IllegalStateException("Co... | [
"static",
"void",
"chooseRemaining",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
",",
"DBIDs",
"ids",
",",
"DistanceQuery",
"<",
"NumberVector",
">",
"distQ",
",",
"int",
"k",
",",
"List",
"<",
"NumberVector",
">",
"means",
",",
... | Choose remaining means, weighted by distance.
@param relation Data relation
@param ids IDs
@param distQ Distance function
@param k Number of means to choose
@param means Means storage
@param weights Weights (initialized!)
@param weightsum Sum of weights
@param random Random generator | [
"Choose",
"remaining",
"means",
"weighted",
"by",
"distance",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/initialization/KMeansPlusPlusInitialMeans.java#L162-L195 |
64,281 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseMinMaxNormalization.java | AttributeWiseMinMaxNormalization.factor | private double factor(int dimension) {
return maxima[dimension] > minima[dimension] ? maxima[dimension] - minima[dimension] : maxima[dimension] > 0 ? maxima[dimension] : 1;
} | java | private double factor(int dimension) {
return maxima[dimension] > minima[dimension] ? maxima[dimension] - minima[dimension] : maxima[dimension] > 0 ? maxima[dimension] : 1;
} | [
"private",
"double",
"factor",
"(",
"int",
"dimension",
")",
"{",
"return",
"maxima",
"[",
"dimension",
"]",
">",
"minima",
"[",
"dimension",
"]",
"?",
"maxima",
"[",
"dimension",
"]",
"-",
"minima",
"[",
"dimension",
"]",
":",
"maxima",
"[",
"dimension"... | Returns a factor for normalization in a certain dimension.
The provided factor is the maximum-minimum in the specified dimension, if
these two values differ, otherwise it is the maximum if this value differs
from 0, otherwise it is 1.
@param dimension the dimension to get a factor for normalization
@return a factor f... | [
"Returns",
"a",
"factor",
"for",
"normalization",
"in",
"a",
"certain",
"dimension",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseMinMaxNormalization.java#L159-L161 |
64,282 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/DerivativeDTWDistanceFunction.java | DerivativeDTWDistanceFunction.derivative | protected double derivative(int i, NumberVector v) {
final int dim = v.getDimensionality();
if(dim == 1) {
return 0.;
}
// Adjust for boundary conditions, as per the article:
i = (i == 0) ? 1 : (i == dim - 1) ? dim - 2 : i;
return (v.doubleValue(i) - v.doubleValue(i - 1) + (v.doubleValue(i... | java | protected double derivative(int i, NumberVector v) {
final int dim = v.getDimensionality();
if(dim == 1) {
return 0.;
}
// Adjust for boundary conditions, as per the article:
i = (i == 0) ? 1 : (i == dim - 1) ? dim - 2 : i;
return (v.doubleValue(i) - v.doubleValue(i - 1) + (v.doubleValue(i... | [
"protected",
"double",
"derivative",
"(",
"int",
"i",
",",
"NumberVector",
"v",
")",
"{",
"final",
"int",
"dim",
"=",
"v",
".",
"getDimensionality",
"(",
")",
";",
"if",
"(",
"dim",
"==",
"1",
")",
"{",
"return",
"0.",
";",
"}",
"// Adjust for boundary... | Given a NumberVector and the position of an element, approximates the
gradient of given element.
@return Derivative as double | [
"Given",
"a",
"NumberVector",
"and",
"the",
"position",
"of",
"an",
"element",
"approximates",
"the",
"gradient",
"of",
"given",
"element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/timeseries/DerivativeDTWDistanceFunction.java#L143-L151 |
64,283 | elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/strategies/split/RandomSplit.java | RandomSplit.split | @Override
public Assignments<E> split(AbstractMTree<?, N, E, ?> tree, N node) {
final int n = node.getNumEntries();
int pos1 = random.nextInt(n), pos2 = random.nextInt(n - 1);
pos2 = pos2 >= pos1 ? pos2 + 1 : pos2;
// Build distance arrays:
double[] dis1 = new double[n], dis2 = new double[n];
... | java | @Override
public Assignments<E> split(AbstractMTree<?, N, E, ?> tree, N node) {
final int n = node.getNumEntries();
int pos1 = random.nextInt(n), pos2 = random.nextInt(n - 1);
pos2 = pos2 >= pos1 ? pos2 + 1 : pos2;
// Build distance arrays:
double[] dis1 = new double[n], dis2 = new double[n];
... | [
"@",
"Override",
"public",
"Assignments",
"<",
"E",
">",
"split",
"(",
"AbstractMTree",
"<",
"?",
",",
"N",
",",
"E",
",",
"?",
">",
"tree",
",",
"N",
"node",
")",
"{",
"final",
"int",
"n",
"=",
"node",
".",
"getNumEntries",
"(",
")",
";",
"int",... | Selects two objects of the specified node to be promoted and stored into
the parent node. The m-RAD strategy considers all possible pairs of objects
and, after partitioning the set of entries, promotes the pair of objects
for which the sum of covering radiuses is minimum.
@param tree Tree to use
@param node the node t... | [
"Selects",
"two",
"objects",
"of",
"the",
"specified",
"node",
"to",
"be",
"promoted",
"and",
"stored",
"into",
"the",
"parent",
"node",
".",
"The",
"m",
"-",
"RAD",
"strategy",
"considers",
"all",
"possible",
"pairs",
"of",
"objects",
"and",
"after",
"par... | 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/RandomSplit.java#L86-L104 |
64,284 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java | CSSClass.checkCSSStatements | public static boolean checkCSSStatements(Collection<Pair<String,String>> statements) {
for (Pair<String, String> pair : statements) {
if (!checkCSSStatement(pair.getFirst(), pair.getSecond())) {
return false;
}
}
return true;
} | java | public static boolean checkCSSStatements(Collection<Pair<String,String>> statements) {
for (Pair<String, String> pair : statements) {
if (!checkCSSStatement(pair.getFirst(), pair.getSecond())) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"checkCSSStatements",
"(",
"Collection",
"<",
"Pair",
"<",
"String",
",",
"String",
">",
">",
"statements",
")",
"{",
"for",
"(",
"Pair",
"<",
"String",
",",
"String",
">",
"pair",
":",
"statements",
")",
"{",
"if",
"(",
... | Validate a set of CSS statements.
TODO: checks are currently not very extensive.
@param statements Statements to check
@return true if valid | [
"Validate",
"a",
"set",
"of",
"CSS",
"statements",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java#L147-L154 |
64,285 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java | CSSClass.getStatement | public String getStatement(String key) {
for (Pair<String, String> pair : statements) {
if (pair.getFirst().equals(key)) {
return pair.getSecond();
}
}
return null;
} | java | public String getStatement(String key) {
for (Pair<String, String> pair : statements) {
if (pair.getFirst().equals(key)) {
return pair.getSecond();
}
}
return null;
} | [
"public",
"String",
"getStatement",
"(",
"String",
"key",
")",
"{",
"for",
"(",
"Pair",
"<",
"String",
",",
"String",
">",
"pair",
":",
"statements",
")",
"{",
"if",
"(",
"pair",
".",
"getFirst",
"(",
")",
".",
"equals",
"(",
"key",
")",
")",
"{",
... | Get the current value of a particular CSS statement.
@param key statement key.
@return current value or null. | [
"Get",
"the",
"current",
"value",
"of",
"a",
"particular",
"CSS",
"statement",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java#L189-L196 |
64,286 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java | CSSClass.setStatement | public void setStatement(String key, String value) {
if (value != null && !checkCSSStatement(key, value)) {
throw new InvalidCSS("Invalid CSS statement.");
}
for (Pair<String, String> pair : statements) {
if (pair.getFirst().equals(key)) {
if (value != null) {
pair.setSecond(va... | java | public void setStatement(String key, String value) {
if (value != null && !checkCSSStatement(key, value)) {
throw new InvalidCSS("Invalid CSS statement.");
}
for (Pair<String, String> pair : statements) {
if (pair.getFirst().equals(key)) {
if (value != null) {
pair.setSecond(va... | [
"public",
"void",
"setStatement",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
"&&",
"!",
"checkCSSStatement",
"(",
"key",
",",
"value",
")",
")",
"{",
"throw",
"new",
"InvalidCSS",
"(",
"\"Invalid CSS statement... | Set a CSS statement.
@param key Statement key.
@param value Value or null (to unset) | [
"Set",
"a",
"CSS",
"statement",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java#L213-L230 |
64,287 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java | CSSClass.appendCSSDefinition | public void appendCSSDefinition(StringBuilder buf) {
buf.append("\n.");
buf.append(name);
buf.append('{');
for (Pair<String, String> pair : statements) {
buf.append(pair.getFirst());
buf.append(':');
buf.append(pair.getSecond());
buf.append(";\n");
}
buf.append("}\n");
... | java | public void appendCSSDefinition(StringBuilder buf) {
buf.append("\n.");
buf.append(name);
buf.append('{');
for (Pair<String, String> pair : statements) {
buf.append(pair.getFirst());
buf.append(':');
buf.append(pair.getSecond());
buf.append(";\n");
}
buf.append("}\n");
... | [
"public",
"void",
"appendCSSDefinition",
"(",
"StringBuilder",
"buf",
")",
"{",
"buf",
".",
"append",
"(",
"\"\\n.\"",
")",
";",
"buf",
".",
"append",
"(",
"name",
")",
";",
"buf",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"Pair",
"<",
"S... | Append CSS definition to a stream
@param buf String buffer to append to. | [
"Append",
"CSS",
"definition",
"to",
"a",
"stream"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java#L266-L277 |
64,288 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java | CSSClass.inlineCSS | public String inlineCSS() {
StringBuilder buf = new StringBuilder();
for (Pair<String, String> pair : statements) {
buf.append(pair.getFirst());
buf.append(':');
buf.append(pair.getSecond());
buf.append(';');
}
return buf.toString();
} | java | public String inlineCSS() {
StringBuilder buf = new StringBuilder();
for (Pair<String, String> pair : statements) {
buf.append(pair.getFirst());
buf.append(':');
buf.append(pair.getSecond());
buf.append(';');
}
return buf.toString();
} | [
"public",
"String",
"inlineCSS",
"(",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"Pair",
"<",
"String",
",",
"String",
">",
"pair",
":",
"statements",
")",
"{",
"buf",
".",
"append",
"(",
"pair",
".",
"g... | Render CSS class to inline formatting
@return string rendition of CSS for inline use | [
"Render",
"CSS",
"class",
"to",
"inline",
"formatting"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClass.java#L303-L312 |
64,289 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseCDFNormalization.java | AttributeWiseCDFNormalization.findBestFit | protected Distribution findBestFit(final List<V> col, Adapter adapter, int d, double[] test) {
if(estimators.size() == 1) {
return estimators.get(0).estimate(col, adapter);
}
Distribution best = null;
double bestq = Double.POSITIVE_INFINITY;
trials: for(DistributionEstimator<?> est : estimator... | java | protected Distribution findBestFit(final List<V> col, Adapter adapter, int d, double[] test) {
if(estimators.size() == 1) {
return estimators.get(0).estimate(col, adapter);
}
Distribution best = null;
double bestq = Double.POSITIVE_INFINITY;
trials: for(DistributionEstimator<?> est : estimator... | [
"protected",
"Distribution",
"findBestFit",
"(",
"final",
"List",
"<",
"V",
">",
"col",
",",
"Adapter",
"adapter",
",",
"int",
"d",
",",
"double",
"[",
"]",
"test",
")",
"{",
"if",
"(",
"estimators",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"ret... | Find the best fitting distribution.
@param col Column of table
@param adapter Adapter for accessing the data
@param d Dimension
@param test Scatch space for testing goodness of fit
@return Best fit distribution | [
"Find",
"the",
"best",
"fitting",
"distribution",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseCDFNormalization.java#L160-L201 |
64,290 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseCDFNormalization.java | AttributeWiseCDFNormalization.constantZero | protected boolean constantZero(List<V> column, Adapter adapter) {
for(int i = 0, s = adapter.size(column); i < s; i++) {
if(adapter.get(column, i) != 0.) {
return false;
}
}
return true;
} | java | protected boolean constantZero(List<V> column, Adapter adapter) {
for(int i = 0, s = adapter.size(column); i < s; i++) {
if(adapter.get(column, i) != 0.) {
return false;
}
}
return true;
} | [
"protected",
"boolean",
"constantZero",
"(",
"List",
"<",
"V",
">",
"column",
",",
"Adapter",
"adapter",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"s",
"=",
"adapter",
".",
"size",
"(",
"column",
")",
";",
"i",
"<",
"s",
";",
"i",
"++",
... | Test if an attribute is constant zero.
@param column Column
@param adapter Data accessor.
@return {@code true} if all values are zero | [
"Test",
"if",
"an",
"attribute",
"is",
"constant",
"zero",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseCDFNormalization.java#L210-L217 |
64,291 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java | ArffParser.makeArffTokenizer | private StreamTokenizer makeArffTokenizer(BufferedReader br) {
// Setup tokenizer
StreamTokenizer tokenizer = new StreamTokenizer(br);
{
tokenizer.resetSyntax();
tokenizer.whitespaceChars(0, ' ');
tokenizer.ordinaryChars('0', '9'); // Do not parse numbers
tokenizer.ordinaryChar('-');... | java | private StreamTokenizer makeArffTokenizer(BufferedReader br) {
// Setup tokenizer
StreamTokenizer tokenizer = new StreamTokenizer(br);
{
tokenizer.resetSyntax();
tokenizer.whitespaceChars(0, ' ');
tokenizer.ordinaryChars('0', '9'); // Do not parse numbers
tokenizer.ordinaryChar('-');... | [
"private",
"StreamTokenizer",
"makeArffTokenizer",
"(",
"BufferedReader",
"br",
")",
"{",
"// Setup tokenizer",
"StreamTokenizer",
"tokenizer",
"=",
"new",
"StreamTokenizer",
"(",
"br",
")",
";",
"{",
"tokenizer",
".",
"resetSyntax",
"(",
")",
";",
"tokenizer",
".... | Make a StreamTokenizer for the ARFF format.
@param br Buffered reader
@return Tokenizer | [
"Make",
"a",
"StreamTokenizer",
"for",
"the",
"ARFF",
"format",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java#L383-L402 |
64,292 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java | ArffParser.setupBundleHeaders | private void setupBundleHeaders(ArrayList<String> names, int[] targ, TypeInformation[] etyp, int[] dimsize, MultipleObjectsBundle bundle, boolean sparse) {
for(int in = 0, out = 0; in < targ.length; out++) {
int nin = in + 1;
for(; nin < targ.length; nin++) {
if(targ[nin] != targ[in]) {
... | java | private void setupBundleHeaders(ArrayList<String> names, int[] targ, TypeInformation[] etyp, int[] dimsize, MultipleObjectsBundle bundle, boolean sparse) {
for(int in = 0, out = 0; in < targ.length; out++) {
int nin = in + 1;
for(; nin < targ.length; nin++) {
if(targ[nin] != targ[in]) {
... | [
"private",
"void",
"setupBundleHeaders",
"(",
"ArrayList",
"<",
"String",
">",
"names",
",",
"int",
"[",
"]",
"targ",
",",
"TypeInformation",
"[",
"]",
"etyp",
",",
"int",
"[",
"]",
"dimsize",
",",
"MultipleObjectsBundle",
"bundle",
",",
"boolean",
"sparse",... | Setup the headers for the object bundle.
@param names Attribute names
@param targ Target columns
@param etyp ELKI type information
@param dimsize Number of dimensions in the individual types
@param bundle Output bundle
@param sparse Flag to create sparse vectors | [
"Setup",
"the",
"headers",
"for",
"the",
"object",
"bundle",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java#L414-L456 |
64,293 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java | ArffParser.readHeader | private void readHeader(BufferedReader br) throws IOException {
String line;
// Locate header line
while(true) {
line = br.readLine();
if(line == null) {
throw new AbortException(ARFF_HEADER_RELATION + " not found in file.");
}
// Skip comments and empty lines
if(ARFF_C... | java | private void readHeader(BufferedReader br) throws IOException {
String line;
// Locate header line
while(true) {
line = br.readLine();
if(line == null) {
throw new AbortException(ARFF_HEADER_RELATION + " not found in file.");
}
// Skip comments and empty lines
if(ARFF_C... | [
"private",
"void",
"readHeader",
"(",
"BufferedReader",
"br",
")",
"throws",
"IOException",
"{",
"String",
"line",
";",
"// Locate header line",
"while",
"(",
"true",
")",
"{",
"line",
"=",
"br",
".",
"readLine",
"(",
")",
";",
"if",
"(",
"line",
"==",
"... | Read the dataset header part of the ARFF file, to ensure consistency.
@param br Buffered Reader
@throws IOException | [
"Read",
"the",
"dataset",
"header",
"part",
"of",
"the",
"ARFF",
"file",
"to",
"ensure",
"consistency",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java#L464-L482 |
64,294 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java | ArffParser.nextToken | private void nextToken(StreamTokenizer tokenizer) throws IOException {
tokenizer.nextToken();
if((tokenizer.ttype == '\'') || (tokenizer.ttype == '"')) {
tokenizer.ttype = StreamTokenizer.TT_WORD;
}
else if((tokenizer.ttype == StreamTokenizer.TT_WORD) && (tokenizer.sval.equals("?"))) {
token... | java | private void nextToken(StreamTokenizer tokenizer) throws IOException {
tokenizer.nextToken();
if((tokenizer.ttype == '\'') || (tokenizer.ttype == '"')) {
tokenizer.ttype = StreamTokenizer.TT_WORD;
}
else if((tokenizer.ttype == StreamTokenizer.TT_WORD) && (tokenizer.sval.equals("?"))) {
token... | [
"private",
"void",
"nextToken",
"(",
"StreamTokenizer",
"tokenizer",
")",
"throws",
"IOException",
"{",
"tokenizer",
".",
"nextToken",
"(",
")",
";",
"if",
"(",
"(",
"tokenizer",
".",
"ttype",
"==",
"'",
"'",
")",
"||",
"(",
"tokenizer",
".",
"ttype",
"=... | Helper function for token handling.
@param tokenizer Tokenizer
@throws IOException | [
"Helper",
"function",
"for",
"token",
"handling",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/parser/ArffParser.java#L598-L623 |
64,295 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCut.java | OPTICSCut.makeOPTICSCut | public static <E extends ClusterOrder> Clustering<Model> makeOPTICSCut(E co, double epsilon) {
// Clustering model we are building
Clustering<Model> clustering = new Clustering<>("OPTICS Cut Clustering", "optics-cut");
// Collects noise elements
ModifiableDBIDs noise = DBIDUtil.newHashSet();
double... | java | public static <E extends ClusterOrder> Clustering<Model> makeOPTICSCut(E co, double epsilon) {
// Clustering model we are building
Clustering<Model> clustering = new Clustering<>("OPTICS Cut Clustering", "optics-cut");
// Collects noise elements
ModifiableDBIDs noise = DBIDUtil.newHashSet();
double... | [
"public",
"static",
"<",
"E",
"extends",
"ClusterOrder",
">",
"Clustering",
"<",
"Model",
">",
"makeOPTICSCut",
"(",
"E",
"co",
",",
"double",
"epsilon",
")",
"{",
"// Clustering model we are building",
"Clustering",
"<",
"Model",
">",
"clustering",
"=",
"new",
... | Compute an OPTICS cut clustering
@param co Cluster order result
@param epsilon Epsilon value for cut
@return New partitioning clustering | [
"Compute",
"an",
"OPTICS",
"cut",
"clustering"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/opticsplot/OPTICSCut.java#L58-L105 |
64,296 | elki-project/elki | elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/LabelList.java | LabelList.make | public static LabelList make(Collection<String> labels) {
int size = labels.size();
if(size == 0) {
return EMPTY_LABELS;
}
return new LabelList(labels.toArray(new String[size]));
} | java | public static LabelList make(Collection<String> labels) {
int size = labels.size();
if(size == 0) {
return EMPTY_LABELS;
}
return new LabelList(labels.toArray(new String[size]));
} | [
"public",
"static",
"LabelList",
"make",
"(",
"Collection",
"<",
"String",
">",
"labels",
")",
"{",
"int",
"size",
"=",
"labels",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"==",
"0",
")",
"{",
"return",
"EMPTY_LABELS",
";",
"}",
"return",
"new",... | Constructor replacement.
When the label list is empty, it will produce the same instance!
@param labels Existing labels
@return Label list instance. | [
"Constructor",
"replacement",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-data/src/main/java/de/lmu/ifi/dbs/elki/data/LabelList.java#L83-L89 |
64,297 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java | DiSH.run | public Clustering<SubspaceModel> run(Database db, Relation<V> relation) {
if(mu >= relation.size()) {
throw new AbortException("Parameter mu is chosen unreasonably large. This won't yield meaningful results.");
}
DiSHClusterOrder opticsResult = new Instance(db, relation).run();
if(LOG.isVerbose()... | java | public Clustering<SubspaceModel> run(Database db, Relation<V> relation) {
if(mu >= relation.size()) {
throw new AbortException("Parameter mu is chosen unreasonably large. This won't yield meaningful results.");
}
DiSHClusterOrder opticsResult = new Instance(db, relation).run();
if(LOG.isVerbose()... | [
"public",
"Clustering",
"<",
"SubspaceModel",
">",
"run",
"(",
"Database",
"db",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"if",
"(",
"mu",
">=",
"relation",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"AbortException",
"(",
"\"Paramet... | Performs the DiSH algorithm on the given database.
@param relation Relation to process | [
"Performs",
"the",
"DiSH",
"algorithm",
"on",
"the",
"given",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java#L148-L158 |
64,298 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java | DiSH.computeClusters | private Clustering<SubspaceModel> computeClusters(Relation<V> database, DiSHClusterOrder clusterOrder) {
final int dimensionality = RelationUtil.dimensionality(database);
// extract clusters
Object2ObjectOpenCustomHashMap<long[], List<ArrayModifiableDBIDs>> clustersMap = extractClusters(database, clusterOr... | java | private Clustering<SubspaceModel> computeClusters(Relation<V> database, DiSHClusterOrder clusterOrder) {
final int dimensionality = RelationUtil.dimensionality(database);
// extract clusters
Object2ObjectOpenCustomHashMap<long[], List<ArrayModifiableDBIDs>> clustersMap = extractClusters(database, clusterOr... | [
"private",
"Clustering",
"<",
"SubspaceModel",
">",
"computeClusters",
"(",
"Relation",
"<",
"V",
">",
"database",
",",
"DiSHClusterOrder",
"clusterOrder",
")",
"{",
"final",
"int",
"dimensionality",
"=",
"RelationUtil",
".",
"dimensionality",
"(",
"database",
")"... | Computes the hierarchical clusters according to the cluster order.
@param database the database holding the objects
@param clusterOrder the cluster order | [
"Computes",
"the",
"hierarchical",
"clusters",
"according",
"to",
"the",
"cluster",
"order",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java#L166-L211 |
64,299 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java | DiSH.logClusterSizes | private void logClusterSizes(String m, int dimensionality, Object2ObjectOpenCustomHashMap<long[], List<ArrayModifiableDBIDs>> clustersMap) {
if(LOG.isVerbose()) {
final StringBuilder msg = new StringBuilder(1000).append(m).append('\n');
for(ObjectIterator<Object2ObjectMap.Entry<long[], List<ArrayModifia... | java | private void logClusterSizes(String m, int dimensionality, Object2ObjectOpenCustomHashMap<long[], List<ArrayModifiableDBIDs>> clustersMap) {
if(LOG.isVerbose()) {
final StringBuilder msg = new StringBuilder(1000).append(m).append('\n');
for(ObjectIterator<Object2ObjectMap.Entry<long[], List<ArrayModifia... | [
"private",
"void",
"logClusterSizes",
"(",
"String",
"m",
",",
"int",
"dimensionality",
",",
"Object2ObjectOpenCustomHashMap",
"<",
"long",
"[",
"]",
",",
"List",
"<",
"ArrayModifiableDBIDs",
">",
">",
"clustersMap",
")",
"{",
"if",
"(",
"LOG",
".",
"isVerbose... | Log cluster sizes in verbose mode.
@param m Log message
@param dimensionality Dimensionality
@param clustersMap Cluster map | [
"Log",
"cluster",
"sizes",
"in",
"verbose",
"mode",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/subspace/DiSH.java#L220-L233 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.