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,100 | elki-project/elki | addons/tutorial/src/main/java/tutorial/outlier/ODIN.java | ODIN.run | public OutlierResult run(Database database, Relation<O> relation) {
// Get the query functions:
DistanceQuery<O> dq = database.getDistanceQuery(relation, getDistanceFunction());
KNNQuery<O> knnq = database.getKNNQuery(dq, k);
// Get the objects to process, and a data storage for counting and output:
... | java | public OutlierResult run(Database database, Relation<O> relation) {
// Get the query functions:
DistanceQuery<O> dq = database.getDistanceQuery(relation, getDistanceFunction());
KNNQuery<O> knnq = database.getKNNQuery(dq, k);
// Get the objects to process, and a data storage for counting and output:
... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"// Get the query functions:",
"DistanceQuery",
"<",
"O",
">",
"dq",
"=",
"database",
".",
"getDistanceQuery",
"(",
"relation",
",",
"getDistance... | Run the ODIN algorithm
Tutorial note: the <em>signature</em> of this method depends on the types
that we requested in the {@link #getInputTypeRestriction} method. Here we
requested a single relation of type {@code O} , the data type of our
distance function.
@param database Database to run on.
@param relation Relatio... | [
"Run",
"the",
"ODIN",
"algorithm"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/tutorial/src/main/java/tutorial/outlier/ODIN.java#L107-L141 |
64,101 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/icons/StockIcon.java | StockIcon.getStockIcon | public static Icon getStockIcon(String name) {
SoftReference<Icon> ref = iconcache.get(name);
if(ref != null) {
Icon icon = ref.get();
if(icon != null) {
return icon;
}
}
java.net.URL imgURL = StockIcon.class.getResource(name + ".png");
if(imgURL != null) {
Icon icon ... | java | public static Icon getStockIcon(String name) {
SoftReference<Icon> ref = iconcache.get(name);
if(ref != null) {
Icon icon = ref.get();
if(icon != null) {
return icon;
}
}
java.net.URL imgURL = StockIcon.class.getResource(name + ".png");
if(imgURL != null) {
Icon icon ... | [
"public",
"static",
"Icon",
"getStockIcon",
"(",
"String",
"name",
")",
"{",
"SoftReference",
"<",
"Icon",
">",
"ref",
"=",
"iconcache",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"ref",
"!=",
"null",
")",
"{",
"Icon",
"icon",
"=",
"ref",
".",
"... | Get a particular stock icon.
@param name Icon name
@return Icon | [
"Get",
"a",
"particular",
"stock",
"icon",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/icons/StockIcon.java#L109-L125 |
64,102 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/flat/FlatRStarTree.java | FlatRStarTree.initializeFromFile | @Override
public void initializeFromFile(TreeIndexHeader header, PageFile<FlatRStarTreeNode> file) {
super.initializeFromFile(header, file);
// reconstruct root
int nextPageID = file.getNextPageID();
dirCapacity = nextPageID;
root = createNewDirectoryNode();
for(int i = 1; i < nextPageID; i++... | java | @Override
public void initializeFromFile(TreeIndexHeader header, PageFile<FlatRStarTreeNode> file) {
super.initializeFromFile(header, file);
// reconstruct root
int nextPageID = file.getNextPageID();
dirCapacity = nextPageID;
root = createNewDirectoryNode();
for(int i = 1; i < nextPageID; i++... | [
"@",
"Override",
"public",
"void",
"initializeFromFile",
"(",
"TreeIndexHeader",
"header",
",",
"PageFile",
"<",
"FlatRStarTreeNode",
">",
"file",
")",
"{",
"super",
".",
"initializeFromFile",
"(",
"header",
",",
"file",
")",
";",
"// reconstruct root",
"int",
"... | Initializes the flat RTree from an existing persistent file. | [
"Initializes",
"the",
"flat",
"RTree",
"from",
"an",
"existing",
"persistent",
"file",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/flat/FlatRStarTree.java#L68-L84 |
64,103 | elki-project/elki | elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/CoverTree.java | CoverTree.bulkConstruct | protected Node bulkConstruct(DBIDRef cur, int maxScale, double parentDist, ModifiableDoubleDBIDList elems) {
assert (!elems.contains(cur));
final double max = maxDistance(elems);
final int scale = Math.min(distToScale(max) - 1, maxScale);
final int nextScale = scale - 1;
// Leaf node, because points... | java | protected Node bulkConstruct(DBIDRef cur, int maxScale, double parentDist, ModifiableDoubleDBIDList elems) {
assert (!elems.contains(cur));
final double max = maxDistance(elems);
final int scale = Math.min(distToScale(max) - 1, maxScale);
final int nextScale = scale - 1;
// Leaf node, because points... | [
"protected",
"Node",
"bulkConstruct",
"(",
"DBIDRef",
"cur",
",",
"int",
"maxScale",
",",
"double",
"parentDist",
",",
"ModifiableDoubleDBIDList",
"elems",
")",
"{",
"assert",
"(",
"!",
"elems",
".",
"contains",
"(",
"cur",
")",
")",
";",
"final",
"double",
... | Bulk-load the cover tree.
This bulk-load is slightly simpler than the one used in the original
cover-tree source: We do not look back into the "far" set of candidates.
@param cur Current routing object
@param maxScale Maximum scale
@param elems Candidates
@return Root node of subtree | [
"Bulk",
"-",
"load",
"the",
"cover",
"tree",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-various/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/covertree/CoverTree.java#L223-L278 |
64,104 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/QuadraticWeight.java | QuadraticWeight.getWeight | @Override
public double getWeight(double distance, double max, double stddev) {
if(max <= 0) {
return 1.0;
}
double relativedistance = distance / max;
return 1.0 - 0.9 * relativedistance * relativedistance;
} | java | @Override
public double getWeight(double distance, double max, double stddev) {
if(max <= 0) {
return 1.0;
}
double relativedistance = distance / max;
return 1.0 - 0.9 * relativedistance * relativedistance;
} | [
"@",
"Override",
"public",
"double",
"getWeight",
"(",
"double",
"distance",
",",
"double",
"max",
",",
"double",
"stddev",
")",
"{",
"if",
"(",
"max",
"<=",
"0",
")",
"{",
"return",
"1.0",
";",
"}",
"double",
"relativedistance",
"=",
"distance",
"/",
... | Evaluate quadratic weight. stddev is ignored. | [
"Evaluate",
"quadratic",
"weight",
".",
"stddev",
"is",
"ignored",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/pca/weightfunctions/QuadraticWeight.java#L36-L43 |
64,105 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/minkowski/EuclideanDistanceFunction.java | EuclideanDistanceFunction.maxDist | public double maxDist(SpatialComparable mbr1, SpatialComparable mbr2) {
final int dim1 = mbr1.getDimensionality(), dim2 = mbr2.getDimensionality();
final int mindim = dim1 < dim2 ? dim1 : dim2;
double agg = 0.;
for(int d = 0; d < mindim; d++) {
double d1 = mbr1.getMax(d) - mbr2.getMin(d);
d... | java | public double maxDist(SpatialComparable mbr1, SpatialComparable mbr2) {
final int dim1 = mbr1.getDimensionality(), dim2 = mbr2.getDimensionality();
final int mindim = dim1 < dim2 ? dim1 : dim2;
double agg = 0.;
for(int d = 0; d < mindim; d++) {
double d1 = mbr1.getMax(d) - mbr2.getMin(d);
d... | [
"public",
"double",
"maxDist",
"(",
"SpatialComparable",
"mbr1",
",",
"SpatialComparable",
"mbr2",
")",
"{",
"final",
"int",
"dim1",
"=",
"mbr1",
".",
"getDimensionality",
"(",
")",
",",
"dim2",
"=",
"mbr2",
".",
"getDimensionality",
"(",
")",
";",
"final",
... | Maximum distance of two objects.
@param mbr1 First object
@param mbr2 Second object | [
"Maximum",
"distance",
"of",
"two",
"objects",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/minkowski/EuclideanDistanceFunction.java#L160-L182 |
64,106 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/DynamicParameters.java | DynamicParameters.updateFromTrackParameters | public synchronized void updateFromTrackParameters(TrackParameters track) {
parameters.clear();
for(TrackedParameter p : track.getAllParameters()) {
Parameter<?> option = p.getParameter();
String value = null;
if(option.isDefined()) {
if(option.tookDefaultValue()) {
value = D... | java | public synchronized void updateFromTrackParameters(TrackParameters track) {
parameters.clear();
for(TrackedParameter p : track.getAllParameters()) {
Parameter<?> option = p.getParameter();
String value = null;
if(option.isDefined()) {
if(option.tookDefaultValue()) {
value = D... | [
"public",
"synchronized",
"void",
"updateFromTrackParameters",
"(",
"TrackParameters",
"track",
")",
"{",
"parameters",
".",
"clear",
"(",
")",
";",
"for",
"(",
"TrackedParameter",
"p",
":",
"track",
".",
"getAllParameters",
"(",
")",
")",
"{",
"Parameter",
"<... | Update the Parameter list from the collected options of an ELKI context
@param track Tracked Parameters | [
"Update",
"the",
"Parameter",
"list",
"from",
"the",
"collected",
"options",
"of",
"an",
"ELKI",
"context"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/DynamicParameters.java#L137-L188 |
64,107 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/DynamicParameters.java | DynamicParameters.addParameter | public synchronized void addParameter(Parameter<?> option, String value, int bits, int depth) {
parameters.add(new Node(option, value, bits, depth));
} | java | public synchronized void addParameter(Parameter<?> option, String value, int bits, int depth) {
parameters.add(new Node(option, value, bits, depth));
} | [
"public",
"synchronized",
"void",
"addParameter",
"(",
"Parameter",
"<",
"?",
">",
"option",
",",
"String",
"value",
",",
"int",
"bits",
",",
"int",
"depth",
")",
"{",
"parameters",
".",
"add",
"(",
"new",
"Node",
"(",
"option",
",",
"value",
",",
"bit... | Add a single parameter to the list
@param option Option
@param value Value
@param bits Bits
@param depth Depth | [
"Add",
"a",
"single",
"parameter",
"to",
"the",
"list"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/DynamicParameters.java#L198-L200 |
64,108 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Clustering.java | Clustering.getClusteringResults | public static List<Clustering<? extends Model>> getClusteringResults(Result r) {
if(r instanceof Clustering<?>) {
List<Clustering<?>> crs = new ArrayList<>(1);
crs.add((Clustering<?>) r);
return crs;
}
if(r instanceof HierarchicalResult) {
return ResultUtil.filterResults(((Hierarchic... | java | public static List<Clustering<? extends Model>> getClusteringResults(Result r) {
if(r instanceof Clustering<?>) {
List<Clustering<?>> crs = new ArrayList<>(1);
crs.add((Clustering<?>) r);
return crs;
}
if(r instanceof HierarchicalResult) {
return ResultUtil.filterResults(((Hierarchic... | [
"public",
"static",
"List",
"<",
"Clustering",
"<",
"?",
"extends",
"Model",
">",
">",
"getClusteringResults",
"(",
"Result",
"r",
")",
"{",
"if",
"(",
"r",
"instanceof",
"Clustering",
"<",
"?",
">",
")",
"{",
"List",
"<",
"Clustering",
"<",
"?",
">",
... | Collect all clustering results from a Result
@param r Result
@return List of clustering results | [
"Collect",
"all",
"clustering",
"results",
"from",
"a",
"Result"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Clustering.java#L167-L177 |
64,109 | elki-project/elki | addons/tutorial/src/main/java/tutorial/javaapi/GeoIndexing.java | GeoIndexing.randomLatitudeLongitude | private static double[] randomLatitudeLongitude(Random r) {
// Make marginally more realistic looking data by non-uniformly sampling
// latitude, since Earth is a sphere, and there is not much at the poles
double lat = Math.pow(1. - r.nextDouble() * 2., 2) / 2. * 180;
double lng = (.5 - r.nextDouble()) ... | java | private static double[] randomLatitudeLongitude(Random r) {
// Make marginally more realistic looking data by non-uniformly sampling
// latitude, since Earth is a sphere, and there is not much at the poles
double lat = Math.pow(1. - r.nextDouble() * 2., 2) / 2. * 180;
double lng = (.5 - r.nextDouble()) ... | [
"private",
"static",
"double",
"[",
"]",
"randomLatitudeLongitude",
"(",
"Random",
"r",
")",
"{",
"// Make marginally more realistic looking data by non-uniformly sampling",
"// latitude, since Earth is a sphere, and there is not much at the poles",
"double",
"lat",
"=",
"Math",
".... | Generate random coordinates.
@param r Random generator
@return Latitude, Longitude array. | [
"Generate",
"random",
"coordinates",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/tutorial/src/main/java/tutorial/javaapi/GeoIndexing.java#L138-L144 |
64,110 | elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/correlation/AbsolutePearsonCorrelationDistanceFunction.java | AbsolutePearsonCorrelationDistanceFunction.distance | @Override
public double distance(NumberVector v1, NumberVector v2) {
return 1 - Math.abs(PearsonCorrelation.coefficient(v1, v2));
} | java | @Override
public double distance(NumberVector v1, NumberVector v2) {
return 1 - Math.abs(PearsonCorrelation.coefficient(v1, v2));
} | [
"@",
"Override",
"public",
"double",
"distance",
"(",
"NumberVector",
"v1",
",",
"NumberVector",
"v2",
")",
"{",
"return",
"1",
"-",
"Math",
".",
"abs",
"(",
"PearsonCorrelation",
".",
"coefficient",
"(",
"v1",
",",
"v2",
")",
")",
";",
"}"
] | Computes the absolute Pearson correlation distance for two given feature
vectors.
The absolute Pearson correlation distance is computed from the Pearson
correlation coefficient <code>r</code> as: <code>1-abs(r)</code>. Hence,
possible values of this distance are between 0 and 1.
@param v1 first feature vector
@param ... | [
"Computes",
"the",
"absolute",
"Pearson",
"correlation",
"distance",
"for",
"two",
"given",
"feature",
"vectors",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/correlation/AbsolutePearsonCorrelationDistanceFunction.java#L71-L74 |
64,111 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/HaltonUniformDistribution.java | HaltonUniformDistribution.inverse | private long inverse(double current) {
// Represent to base b.
short[] digits = new short[maxi];
for(int j = 0; j < maxi; j++) {
current *= base;
digits[j] = (short) current;
current -= digits[j];
if(current <= 1e-10) {
break;
}
}
long inv = 0;
for(int j = m... | java | private long inverse(double current) {
// Represent to base b.
short[] digits = new short[maxi];
for(int j = 0; j < maxi; j++) {
current *= base;
digits[j] = (short) current;
current -= digits[j];
if(current <= 1e-10) {
break;
}
}
long inv = 0;
for(int j = m... | [
"private",
"long",
"inverse",
"(",
"double",
"current",
")",
"{",
"// Represent to base b.",
"short",
"[",
"]",
"digits",
"=",
"new",
"short",
"[",
"maxi",
"]",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"maxi",
";",
"j",
"++",
")",
"{",... | Compute the inverse with respect to the given base.
@param current Current value
@return Integer inverse | [
"Compute",
"the",
"inverse",
"with",
"respect",
"to",
"the",
"given",
"base",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/HaltonUniformDistribution.java#L240-L256 |
64,112 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/HaltonUniformDistribution.java | HaltonUniformDistribution.radicalInverse | private double radicalInverse(long i) {
double digit = 1.0 / (double) base;
double radical = digit;
double inverse = 0.0;
while(i > 0) {
inverse += digit * (double) (i % base);
digit *= radical;
i /= base;
}
return inverse;
} | java | private double radicalInverse(long i) {
double digit = 1.0 / (double) base;
double radical = digit;
double inverse = 0.0;
while(i > 0) {
inverse += digit * (double) (i % base);
digit *= radical;
i /= base;
}
return inverse;
} | [
"private",
"double",
"radicalInverse",
"(",
"long",
"i",
")",
"{",
"double",
"digit",
"=",
"1.0",
"/",
"(",
"double",
")",
"base",
";",
"double",
"radical",
"=",
"digit",
";",
"double",
"inverse",
"=",
"0.0",
";",
"while",
"(",
"i",
">",
"0",
")",
... | Compute the radical inverse of i.
@param i Input long value
@return Double radical inverse | [
"Compute",
"the",
"radical",
"inverse",
"of",
"i",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/HaltonUniformDistribution.java#L264-L274 |
64,113 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/HaltonUniformDistribution.java | HaltonUniformDistribution.nextRadicalInverse | private double nextRadicalInverse() {
counter++;
// Do at most MAXFAST appromate steps
if(counter >= MAXFAST) {
counter = 0;
inverse += MAXFAST;
current = radicalInverse(inverse);
return current;
}
// Fast approximation:
double nextInverse = current + invbase;
if(next... | java | private double nextRadicalInverse() {
counter++;
// Do at most MAXFAST appromate steps
if(counter >= MAXFAST) {
counter = 0;
inverse += MAXFAST;
current = radicalInverse(inverse);
return current;
}
// Fast approximation:
double nextInverse = current + invbase;
if(next... | [
"private",
"double",
"nextRadicalInverse",
"(",
")",
"{",
"counter",
"++",
";",
"// Do at most MAXFAST appromate steps",
"if",
"(",
"counter",
">=",
"MAXFAST",
")",
"{",
"counter",
"=",
"0",
";",
"inverse",
"+=",
"MAXFAST",
";",
"current",
"=",
"radicalInverse",... | Compute the next radical inverse.
@return Next inverse | [
"Compute",
"the",
"next",
"radical",
"inverse",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/HaltonUniformDistribution.java#L281-L305 |
64,114 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Subspace.java | Subspace.dimensonsToString | public String dimensonsToString(String sep) {
StringBuilder result = new StringBuilder(100).append('[');
for(int dim = BitsUtil.nextSetBit(dimensions, 0); dim >= 0; dim = BitsUtil.nextSetBit(dimensions, dim + 1)) {
result.append(dim + 1).append(sep);
}
if(result.length() > sep.length()) { // Un-ap... | java | public String dimensonsToString(String sep) {
StringBuilder result = new StringBuilder(100).append('[');
for(int dim = BitsUtil.nextSetBit(dimensions, 0); dim >= 0; dim = BitsUtil.nextSetBit(dimensions, dim + 1)) {
result.append(dim + 1).append(sep);
}
if(result.length() > sep.length()) { // Un-ap... | [
"public",
"String",
"dimensonsToString",
"(",
"String",
"sep",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"100",
")",
".",
"append",
"(",
"'",
"'",
")",
";",
"for",
"(",
"int",
"dim",
"=",
"BitsUtil",
".",
"nextSetBit",
"(",
... | Returns a string representation of the dimensions of this subspace.
@param sep the separator between the dimensions
@return a string representation of the dimensions of this subspace | [
"Returns",
"a",
"string",
"representation",
"of",
"the",
"dimensions",
"of",
"this",
"subspace",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Subspace.java#L129-L138 |
64,115 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Subspace.java | Subspace.isSubspace | public boolean isSubspace(Subspace subspace) {
return this.dimensionality <= subspace.dimensionality && //
BitsUtil.intersectionSize(dimensions, subspace.dimensions) == dimensionality;
} | java | public boolean isSubspace(Subspace subspace) {
return this.dimensionality <= subspace.dimensionality && //
BitsUtil.intersectionSize(dimensions, subspace.dimensions) == dimensionality;
} | [
"public",
"boolean",
"isSubspace",
"(",
"Subspace",
"subspace",
")",
"{",
"return",
"this",
".",
"dimensionality",
"<=",
"subspace",
".",
"dimensionality",
"&&",
"//",
"BitsUtil",
".",
"intersectionSize",
"(",
"dimensions",
",",
"subspace",
".",
"dimensions",
")... | Returns true if this subspace is a subspace of the specified subspace, i.e.
if the set of dimensions building this subspace are contained in the set of
dimensions building the specified subspace.
@param subspace the subspace to test
@return true if this subspace is a subspace of the specified subspace,
false otherwise | [
"Returns",
"true",
"if",
"this",
"subspace",
"is",
"a",
"subspace",
"of",
"the",
"specified",
"subspace",
"i",
".",
"e",
".",
"if",
"the",
"set",
"of",
"dimensions",
"building",
"this",
"subspace",
"are",
"contained",
"in",
"the",
"set",
"of",
"dimensions"... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/data/Subspace.java#L149-L152 |
64,116 | elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/split/AngTanLinearSplit.java | AngTanLinearSplit.computeOverlap | protected <E extends SpatialComparable, A> double computeOverlap(A entries, ArrayAdapter<E, A> getter, long[] assign) {
ModifiableHyperBoundingBox mbr1 = null, mbr2 = null;
for(int i = 0; i < getter.size(entries); i++) {
E e = getter.get(entries, i);
if(BitsUtil.get(assign, i)) {
if(mbr1 == ... | java | protected <E extends SpatialComparable, A> double computeOverlap(A entries, ArrayAdapter<E, A> getter, long[] assign) {
ModifiableHyperBoundingBox mbr1 = null, mbr2 = null;
for(int i = 0; i < getter.size(entries); i++) {
E e = getter.get(entries, i);
if(BitsUtil.get(assign, i)) {
if(mbr1 == ... | [
"protected",
"<",
"E",
"extends",
"SpatialComparable",
",",
"A",
">",
"double",
"computeOverlap",
"(",
"A",
"entries",
",",
"ArrayAdapter",
"<",
"E",
",",
"A",
">",
"getter",
",",
"long",
"[",
"]",
"assign",
")",
"{",
"ModifiableHyperBoundingBox",
"mbr1",
... | Compute overlap of assignment
@param entries Entries
@param getter Entry accessor
@param assign Assignment
@return Overlap amount | [
"Compute",
"overlap",
"of",
"assignment"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/strategies/split/AngTanLinearSplit.java#L150-L175 |
64,117 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/BinarySplitSpatialSorter.java | BinarySplitSpatialSorter.binarySplitSort | private void binarySplitSort(List<? extends SpatialComparable> objs, final int start, final int end, int depth, final int numdim, int[] dims, Sorter comp) {
final int mid = start + ((end - start) >>> 1);
// Make invariant
comp.setDimension(dims != null ? dims[depth] : depth);
QuickSelect.quickSelect(obj... | java | private void binarySplitSort(List<? extends SpatialComparable> objs, final int start, final int end, int depth, final int numdim, int[] dims, Sorter comp) {
final int mid = start + ((end - start) >>> 1);
// Make invariant
comp.setDimension(dims != null ? dims[depth] : depth);
QuickSelect.quickSelect(obj... | [
"private",
"void",
"binarySplitSort",
"(",
"List",
"<",
"?",
"extends",
"SpatialComparable",
">",
"objs",
",",
"final",
"int",
"start",
",",
"final",
"int",
"end",
",",
"int",
"depth",
",",
"final",
"int",
"numdim",
",",
"int",
"[",
"]",
"dims",
",",
"... | Sort the array using a binary split in dimension curdim, then recurse with
the next dimension.
@param objs List of objects
@param start Interval start
@param end Interval end (exclusive)
@param depth Recursion depth
@param numdim Number of dimensions
@param dims Dimension indexes to sort by.
@param comp Comparator to ... | [
"Sort",
"the",
"array",
"using",
"a",
"binary",
"split",
"in",
"dimension",
"curdim",
"then",
"recurse",
"with",
"the",
"next",
"dimension",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/spacefillingcurves/BinarySplitSpatialSorter.java#L86-L99 |
64,118 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgElement | public static Element svgElement(Document document, String name) {
return document.createElementNS(SVGConstants.SVG_NAMESPACE_URI, name);
} | java | public static Element svgElement(Document document, String name) {
return document.createElementNS(SVGConstants.SVG_NAMESPACE_URI, name);
} | [
"public",
"static",
"Element",
"svgElement",
"(",
"Document",
"document",
",",
"String",
"name",
")",
"{",
"return",
"document",
".",
"createElementNS",
"(",
"SVGConstants",
".",
"SVG_NAMESPACE_URI",
",",
"name",
")",
";",
"}"
] | Create a SVG element in appropriate namespace
@param document containing document
@param name node name
@return new SVG element. | [
"Create",
"a",
"SVG",
"element",
"in",
"appropriate",
"namespace"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L283-L285 |
64,119 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.setStyle | public static void setStyle(Element el, String d) {
el.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, d);
} | java | public static void setStyle(Element el, String d) {
el.setAttribute(SVGConstants.SVG_STYLE_ATTRIBUTE, d);
} | [
"public",
"static",
"void",
"setStyle",
"(",
"Element",
"el",
",",
"String",
"d",
")",
"{",
"el",
".",
"setAttribute",
"(",
"SVGConstants",
".",
"SVG_STYLE_ATTRIBUTE",
",",
"d",
")",
";",
"}"
] | Set a SVG style attribute
@param el element
@param d style value | [
"Set",
"a",
"SVG",
"style",
"attribute"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L326-L328 |
64,120 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.addCSSClass | public static void addCSSClass(Element e, String cssclass) {
String oldval = e.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);
if(oldval == null || oldval.length() == 0) {
setAtt(e, SVGConstants.SVG_CLASS_ATTRIBUTE, cssclass);
return;
}
String[] classes = oldval.split(" ");
for(String c ... | java | public static void addCSSClass(Element e, String cssclass) {
String oldval = e.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);
if(oldval == null || oldval.length() == 0) {
setAtt(e, SVGConstants.SVG_CLASS_ATTRIBUTE, cssclass);
return;
}
String[] classes = oldval.split(" ");
for(String c ... | [
"public",
"static",
"void",
"addCSSClass",
"(",
"Element",
"e",
",",
"String",
"cssclass",
")",
"{",
"String",
"oldval",
"=",
"e",
".",
"getAttribute",
"(",
"SVGConstants",
".",
"SVG_CLASS_ATTRIBUTE",
")",
";",
"if",
"(",
"oldval",
"==",
"null",
"||",
"old... | Add a CSS class to an Element.
@param e Element
@param cssclass class to add. | [
"Add",
"a",
"CSS",
"class",
"to",
"an",
"Element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L347-L360 |
64,121 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.removeCSSClass | public static void removeCSSClass(Element e, String cssclass) {
String oldval = e.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);
if(oldval == null) {
return;
}
String[] classes = oldval.split(" ");
if(classes.length == 1) {
if(cssclass.equals(classes[0])) {
e.removeAttribute(SVG... | java | public static void removeCSSClass(Element e, String cssclass) {
String oldval = e.getAttribute(SVGConstants.SVG_CLASS_ATTRIBUTE);
if(oldval == null) {
return;
}
String[] classes = oldval.split(" ");
if(classes.length == 1) {
if(cssclass.equals(classes[0])) {
e.removeAttribute(SVG... | [
"public",
"static",
"void",
"removeCSSClass",
"(",
"Element",
"e",
",",
"String",
"cssclass",
")",
"{",
"String",
"oldval",
"=",
"e",
".",
"getAttribute",
"(",
"SVGConstants",
".",
"SVG_CLASS_ATTRIBUTE",
")",
";",
"if",
"(",
"oldval",
"==",
"null",
")",
"{... | Remove a CSS class from an Element.
@param e Element
@param cssclass class to remove. | [
"Remove",
"a",
"CSS",
"class",
"from",
"an",
"Element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L368-L404 |
64,122 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.makeStyleElement | public static Element makeStyleElement(Document document) {
Element style = SVGUtil.svgElement(document, SVGConstants.SVG_STYLE_TAG);
style.setAttribute(SVGConstants.SVG_TYPE_ATTRIBUTE, SVGConstants.CSS_MIME_TYPE);
return style;
} | java | public static Element makeStyleElement(Document document) {
Element style = SVGUtil.svgElement(document, SVGConstants.SVG_STYLE_TAG);
style.setAttribute(SVGConstants.SVG_TYPE_ATTRIBUTE, SVGConstants.CSS_MIME_TYPE);
return style;
} | [
"public",
"static",
"Element",
"makeStyleElement",
"(",
"Document",
"document",
")",
"{",
"Element",
"style",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"document",
",",
"SVGConstants",
".",
"SVG_STYLE_TAG",
")",
";",
"style",
".",
"setAttribute",
"(",
"SVGConstant... | Make a new CSS style element for the given Document.
@param document document (factory)
@return new CSS style element. | [
"Make",
"a",
"new",
"CSS",
"style",
"element",
"for",
"the",
"given",
"Document",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L412-L416 |
64,123 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgRect | public static Element svgRect(Document document, double x, double y, double w, double h) {
Element rect = SVGUtil.svgElement(document, SVGConstants.SVG_RECT_TAG);
SVGUtil.setAtt(rect, SVGConstants.SVG_X_ATTRIBUTE, x);
SVGUtil.setAtt(rect, SVGConstants.SVG_Y_ATTRIBUTE, y);
SVGUtil.setAtt(rect, SVGConstan... | java | public static Element svgRect(Document document, double x, double y, double w, double h) {
Element rect = SVGUtil.svgElement(document, SVGConstants.SVG_RECT_TAG);
SVGUtil.setAtt(rect, SVGConstants.SVG_X_ATTRIBUTE, x);
SVGUtil.setAtt(rect, SVGConstants.SVG_Y_ATTRIBUTE, y);
SVGUtil.setAtt(rect, SVGConstan... | [
"public",
"static",
"Element",
"svgRect",
"(",
"Document",
"document",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"w",
",",
"double",
"h",
")",
"{",
"Element",
"rect",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"document",
",",
"SVGConstants",
"... | Create a SVG rectangle element.
@param document document to create in (factory)
@param x X coordinate
@param y Y coordinate
@param w Width
@param h Height
@return new element | [
"Create",
"a",
"SVG",
"rectangle",
"element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L428-L435 |
64,124 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgCircle | public static Element svgCircle(Document document, double cx, double cy, double r) {
Element circ = SVGUtil.svgElement(document, SVGConstants.SVG_CIRCLE_TAG);
SVGUtil.setAtt(circ, SVGConstants.SVG_CX_ATTRIBUTE, cx);
SVGUtil.setAtt(circ, SVGConstants.SVG_CY_ATTRIBUTE, cy);
SVGUtil.setAtt(circ, SVGConstan... | java | public static Element svgCircle(Document document, double cx, double cy, double r) {
Element circ = SVGUtil.svgElement(document, SVGConstants.SVG_CIRCLE_TAG);
SVGUtil.setAtt(circ, SVGConstants.SVG_CX_ATTRIBUTE, cx);
SVGUtil.setAtt(circ, SVGConstants.SVG_CY_ATTRIBUTE, cy);
SVGUtil.setAtt(circ, SVGConstan... | [
"public",
"static",
"Element",
"svgCircle",
"(",
"Document",
"document",
",",
"double",
"cx",
",",
"double",
"cy",
",",
"double",
"r",
")",
"{",
"Element",
"circ",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"document",
",",
"SVGConstants",
".",
"SVG_CIRCLE_TAG"... | Create a SVG circle element.
@param document document to create in (factory)
@param cx center X
@param cy center Y
@param r radius
@return new element | [
"Create",
"a",
"SVG",
"circle",
"element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L446-L452 |
64,125 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgLine | public static Element svgLine(Document document, double x1, double y1, double x2, double y2) {
Element line = SVGUtil.svgElement(document, SVGConstants.SVG_LINE_TAG);
SVGUtil.setAtt(line, SVGConstants.SVG_X1_ATTRIBUTE, x1);
SVGUtil.setAtt(line, SVGConstants.SVG_Y1_ATTRIBUTE, y1);
SVGUtil.setAtt(line, SV... | java | public static Element svgLine(Document document, double x1, double y1, double x2, double y2) {
Element line = SVGUtil.svgElement(document, SVGConstants.SVG_LINE_TAG);
SVGUtil.setAtt(line, SVGConstants.SVG_X1_ATTRIBUTE, x1);
SVGUtil.setAtt(line, SVGConstants.SVG_Y1_ATTRIBUTE, y1);
SVGUtil.setAtt(line, SV... | [
"public",
"static",
"Element",
"svgLine",
"(",
"Document",
"document",
",",
"double",
"x1",
",",
"double",
"y1",
",",
"double",
"x2",
",",
"double",
"y2",
")",
"{",
"Element",
"line",
"=",
"SVGUtil",
".",
"svgElement",
"(",
"document",
",",
"SVGConstants",... | Create a SVG line element. Do not confuse this with path elements.
@param document document to create in (factory)
@param x1 first point x
@param y1 first point y
@param x2 second point x
@param y2 second point y
@return new element | [
"Create",
"a",
"SVG",
"line",
"element",
".",
"Do",
"not",
"confuse",
"this",
"with",
"path",
"elements",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L464-L471 |
64,126 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.stringToColor | public static Color stringToColor(String str) {
int icol = SVG_COLOR_NAMES.getInt(str.toLowerCase());
if(icol != NO_VALUE) {
return new Color(icol, false);
}
return colorLookupStylesheet.stringToColor(str);
} | java | public static Color stringToColor(String str) {
int icol = SVG_COLOR_NAMES.getInt(str.toLowerCase());
if(icol != NO_VALUE) {
return new Color(icol, false);
}
return colorLookupStylesheet.stringToColor(str);
} | [
"public",
"static",
"Color",
"stringToColor",
"(",
"String",
"str",
")",
"{",
"int",
"icol",
"=",
"SVG_COLOR_NAMES",
".",
"getInt",
"(",
"str",
".",
"toLowerCase",
"(",
")",
")",
";",
"if",
"(",
"icol",
"!=",
"NO_VALUE",
")",
"{",
"return",
"new",
"Col... | Convert a color name from SVG syntax to an AWT color object.
@param str Color name
@return Color value | [
"Convert",
"a",
"color",
"name",
"from",
"SVG",
"syntax",
"to",
"an",
"AWT",
"color",
"object",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L528-L534 |
64,127 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.colorToString | public static String colorToString(int col) {
final char[] buf = new char[] { '#', 'X', 'X', 'X', 'X', 'X', 'X' };
for(int i = 6; i > 0; i--) {
final int v = (col & 0xF);
buf[i] = (char) ((v < 10) ? ('0' + v) : ('a' + v - 10));
col >>>= 4;
}
return new String(buf);
} | java | public static String colorToString(int col) {
final char[] buf = new char[] { '#', 'X', 'X', 'X', 'X', 'X', 'X' };
for(int i = 6; i > 0; i--) {
final int v = (col & 0xF);
buf[i] = (char) ((v < 10) ? ('0' + v) : ('a' + v - 10));
col >>>= 4;
}
return new String(buf);
} | [
"public",
"static",
"String",
"colorToString",
"(",
"int",
"col",
")",
"{",
"final",
"char",
"[",
"]",
"buf",
"=",
"new",
"char",
"[",
"]",
"{",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
"'",
",",
"'",
... | Convert a color name from an integer RGB color to CSS syntax
Note: currently only RGB (from ARGB order) are supported. The alpha channel
will be ignored.
@param col Color value
@return Color string | [
"Convert",
"a",
"color",
"name",
"from",
"an",
"integer",
"RGB",
"color",
"to",
"CSS",
"syntax"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L557-L565 |
64,128 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.elementCoordinatesFromEvent | public static SVGPoint elementCoordinatesFromEvent(Document doc, Element tag, Event evt) {
try {
DOMMouseEvent gnme = (DOMMouseEvent) evt;
SVGMatrix mat = ((SVGLocatable) tag).getScreenCTM();
SVGMatrix imat = mat.inverse();
SVGPoint cPt = ((SVGDocument) doc).getRootElement().createSVGPoint()... | java | public static SVGPoint elementCoordinatesFromEvent(Document doc, Element tag, Event evt) {
try {
DOMMouseEvent gnme = (DOMMouseEvent) evt;
SVGMatrix mat = ((SVGLocatable) tag).getScreenCTM();
SVGMatrix imat = mat.inverse();
SVGPoint cPt = ((SVGDocument) doc).getRootElement().createSVGPoint()... | [
"public",
"static",
"SVGPoint",
"elementCoordinatesFromEvent",
"(",
"Document",
"doc",
",",
"Element",
"tag",
",",
"Event",
"evt",
")",
"{",
"try",
"{",
"DOMMouseEvent",
"gnme",
"=",
"(",
"DOMMouseEvent",
")",
"evt",
";",
"SVGMatrix",
"mat",
"=",
"(",
"(",
... | Convert the coordinates of an DOM Event from screen into element
coordinates.
@param doc Document context
@param tag Element containing the coordinate system
@param evt Event to interpret
@return coordinates | [
"Convert",
"the",
"coordinates",
"of",
"an",
"DOM",
"Event",
"from",
"screen",
"into",
"element",
"coordinates",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L627-L641 |
64,129 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.removeLastChild | public static void removeLastChild(Element tag) {
final Node last = tag.getLastChild();
if(last != null) {
tag.removeChild(last);
}
} | java | public static void removeLastChild(Element tag) {
final Node last = tag.getLastChild();
if(last != null) {
tag.removeChild(last);
}
} | [
"public",
"static",
"void",
"removeLastChild",
"(",
"Element",
"tag",
")",
"{",
"final",
"Node",
"last",
"=",
"tag",
".",
"getLastChild",
"(",
")",
";",
"if",
"(",
"last",
"!=",
"null",
")",
"{",
"tag",
".",
"removeChild",
"(",
"last",
")",
";",
"}",... | Remove last child of an element, when present
@param tag Parent | [
"Remove",
"last",
"child",
"of",
"an",
"element",
"when",
"present"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L648-L653 |
64,130 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.removeFromParent | public static void removeFromParent(Element elem) {
if(elem != null && elem.getParentNode() != null) {
elem.getParentNode().removeChild(elem);
}
} | java | public static void removeFromParent(Element elem) {
if(elem != null && elem.getParentNode() != null) {
elem.getParentNode().removeChild(elem);
}
} | [
"public",
"static",
"void",
"removeFromParent",
"(",
"Element",
"elem",
")",
"{",
"if",
"(",
"elem",
"!=",
"null",
"&&",
"elem",
".",
"getParentNode",
"(",
")",
"!=",
"null",
")",
"{",
"elem",
".",
"getParentNode",
"(",
")",
".",
"removeChild",
"(",
"e... | Remove an element from its parent, if defined.
@param elem Element to remove | [
"Remove",
"an",
"element",
"from",
"its",
"parent",
"if",
"defined",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L660-L664 |
64,131 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java | SVGUtil.svgCircleSegment | public static Element svgCircleSegment(SVGPlot svgp, double centerx, double centery, double angleStart, double angleDelta, double innerRadius, double outerRadius) {
final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine
double sin1st = FastMath.sinAndCos(angleStart, tmp);
double cos1st = tmp.val... | java | public static Element svgCircleSegment(SVGPlot svgp, double centerx, double centery, double angleStart, double angleDelta, double innerRadius, double outerRadius) {
final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine
double sin1st = FastMath.sinAndCos(angleStart, tmp);
double cos1st = tmp.val... | [
"public",
"static",
"Element",
"svgCircleSegment",
"(",
"SVGPlot",
"svgp",
",",
"double",
"centerx",
",",
"double",
"centery",
",",
"double",
"angleStart",
",",
"double",
"angleDelta",
",",
"double",
"innerRadius",
",",
"double",
"outerRadius",
")",
"{",
"final"... | Create a circle segment.
@param svgp Plot to draw to
@param centerx Center X position
@param centery Center Y position
@param angleStart Starting angle
@param angleDelta Angle delta
@param innerRadius inner radius
@param outerRadius outer radius
@return SVG element representing this circle segment | [
"Create",
"a",
"circle",
"segment",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGUtil.java#L678-L705 |
64,132 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AbstractHDBSCAN.java | AbstractHDBSCAN.computeCoreDists | protected WritableDoubleDataStore computeCoreDists(DBIDs ids, KNNQuery<O> knnQ, int minPts) {
final Logging LOG = getLogger();
final WritableDoubleDataStore coredists = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_DB);
FiniteProgress cprog = LOG.isVerbose() ? new Fi... | java | protected WritableDoubleDataStore computeCoreDists(DBIDs ids, KNNQuery<O> knnQ, int minPts) {
final Logging LOG = getLogger();
final WritableDoubleDataStore coredists = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_DB);
FiniteProgress cprog = LOG.isVerbose() ? new Fi... | [
"protected",
"WritableDoubleDataStore",
"computeCoreDists",
"(",
"DBIDs",
"ids",
",",
"KNNQuery",
"<",
"O",
">",
"knnQ",
",",
"int",
"minPts",
")",
"{",
"final",
"Logging",
"LOG",
"=",
"getLogger",
"(",
")",
";",
"final",
"WritableDoubleDataStore",
"coredists",
... | Compute the core distances for all objects.
@param ids Objects
@param knnQ kNN query
@param minPts Minimum neighborhood size
@return Data store with core distances | [
"Compute",
"the",
"core",
"distances",
"for",
"all",
"objects",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AbstractHDBSCAN.java#L91-L101 |
64,133 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AbstractHDBSCAN.java | AbstractHDBSCAN.convertToPointerRepresentation | protected void convertToPointerRepresentation(ArrayDBIDs ids, DoubleLongHeap heap, WritableDBIDDataStore pi, WritableDoubleDataStore lambda) {
final Logging LOG = getLogger();
// Initialize parent array:
for(DBIDArrayIter iter = ids.iter(); iter.valid(); iter.advance()) {
pi.put(iter, iter); // Initia... | java | protected void convertToPointerRepresentation(ArrayDBIDs ids, DoubleLongHeap heap, WritableDBIDDataStore pi, WritableDoubleDataStore lambda) {
final Logging LOG = getLogger();
// Initialize parent array:
for(DBIDArrayIter iter = ids.iter(); iter.valid(); iter.advance()) {
pi.put(iter, iter); // Initia... | [
"protected",
"void",
"convertToPointerRepresentation",
"(",
"ArrayDBIDs",
"ids",
",",
"DoubleLongHeap",
"heap",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
")",
"{",
"final",
"Logging",
"LOG",
"=",
"getLogger",
"(",
")",
";",
"// In... | Convert spanning tree to a pointer representation.
Note: the heap must use the correct encoding of indexes.
@param ids IDs indexed
@param heap Heap
@param pi Parent array
@param lambda Distance array | [
"Convert",
"spanning",
"tree",
"to",
"a",
"pointer",
"representation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AbstractHDBSCAN.java#L214-L275 |
64,134 | elki-project/elki | elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/DoubleIntegerDBIDKNNHeap.java | DoubleIntegerDBIDKNNHeap.updateHeap | private void updateHeap(final double distance, final int iid) {
final double prevdist = kdist;
final int previd = heap.peekValue();
heap.replaceTopElement(distance, iid);
kdist = heap.peekKey();
// If the kdist improved, zap ties.
if(kdist < prevdist) {
numties = 0;
}
else {
... | java | private void updateHeap(final double distance, final int iid) {
final double prevdist = kdist;
final int previd = heap.peekValue();
heap.replaceTopElement(distance, iid);
kdist = heap.peekKey();
// If the kdist improved, zap ties.
if(kdist < prevdist) {
numties = 0;
}
else {
... | [
"private",
"void",
"updateHeap",
"(",
"final",
"double",
"distance",
",",
"final",
"int",
"iid",
")",
"{",
"final",
"double",
"prevdist",
"=",
"kdist",
";",
"final",
"int",
"previd",
"=",
"heap",
".",
"peekValue",
"(",
")",
";",
"heap",
".",
"replaceTopE... | Do a full update for the heap.
@param distance
Distance
@param iid
Object id | [
"Do",
"a",
"full",
"update",
"for",
"the",
"heap",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/DoubleIntegerDBIDKNNHeap.java#L145-L157 |
64,135 | elki-project/elki | elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/DoubleIntegerDBIDKNNHeap.java | DoubleIntegerDBIDKNNHeap.addToTies | private void addToTies(int id) {
if(ties.length == numties) {
ties = Arrays.copyOf(ties, (ties.length << 1) + 1); // grow.
}
ties[numties] = id;
++numties;
} | java | private void addToTies(int id) {
if(ties.length == numties) {
ties = Arrays.copyOf(ties, (ties.length << 1) + 1); // grow.
}
ties[numties] = id;
++numties;
} | [
"private",
"void",
"addToTies",
"(",
"int",
"id",
")",
"{",
"if",
"(",
"ties",
".",
"length",
"==",
"numties",
")",
"{",
"ties",
"=",
"Arrays",
".",
"copyOf",
"(",
"ties",
",",
"(",
"ties",
".",
"length",
"<<",
"1",
")",
"+",
"1",
")",
";",
"//... | Ensure the ties array has capacity for at least one more element.
@param id
Id to add | [
"Ensure",
"the",
"ties",
"array",
"has",
"capacity",
"for",
"at",
"least",
"one",
"more",
"element",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids-int/src/main/java/de/lmu/ifi/dbs/elki/database/ids/integer/DoubleIntegerDBIDKNNHeap.java#L165-L171 |
64,136 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/AbstractKMeansQualityMeasure.java | AbstractKMeansQualityMeasure.numberOfFreeParameters | public static int numberOfFreeParameters(Relation<? extends NumberVector> relation, Clustering<? extends MeanModel> clustering) {
// number of clusters
int m = clustering.getAllClusters().size(); // num_ctrs
// dimensionality of data points
int dim = RelationUtil.dimensionality(relation); // num_dims
... | java | public static int numberOfFreeParameters(Relation<? extends NumberVector> relation, Clustering<? extends MeanModel> clustering) {
// number of clusters
int m = clustering.getAllClusters().size(); // num_ctrs
// dimensionality of data points
int dim = RelationUtil.dimensionality(relation); // num_dims
... | [
"public",
"static",
"int",
"numberOfFreeParameters",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
",",
"Clustering",
"<",
"?",
"extends",
"MeanModel",
">",
"clustering",
")",
"{",
"// number of clusters",
"int",
"m",
"=",
"clustering",
... | Compute the number of free parameters.
@param relation Data relation (for dimensionality)
@param clustering Set of clusters
@return Number of free parameters | [
"Compute",
"the",
"number",
"of",
"free",
"parameters",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/kmeans/quality/AbstractKMeansQualityMeasure.java#L181-L190 |
64,137 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/result/ClusteringVectorDumper.java | ClusteringVectorDumper.dumpClusteringOutput | protected void dumpClusteringOutput(PrintStream writer, ResultHierarchy hierarchy, Clustering<?> c) {
DBIDRange ids = null;
for(It<Relation<?>> iter = hierarchy.iterParents(c).filter(Relation.class); iter.valid(); iter.advance()) {
DBIDs pids = iter.get().getDBIDs();
if(pids instanceof DBIDRange) {
... | java | protected void dumpClusteringOutput(PrintStream writer, ResultHierarchy hierarchy, Clustering<?> c) {
DBIDRange ids = null;
for(It<Relation<?>> iter = hierarchy.iterParents(c).filter(Relation.class); iter.valid(); iter.advance()) {
DBIDs pids = iter.get().getDBIDs();
if(pids instanceof DBIDRange) {
... | [
"protected",
"void",
"dumpClusteringOutput",
"(",
"PrintStream",
"writer",
",",
"ResultHierarchy",
"hierarchy",
",",
"Clustering",
"<",
"?",
">",
"c",
")",
"{",
"DBIDRange",
"ids",
"=",
"null",
";",
"for",
"(",
"It",
"<",
"Relation",
"<",
"?",
">",
">",
... | Dump a single clustering result.
@param writer Output writer
@param hierarchy Cluster hierarchy to process
@param c Clustering result | [
"Dump",
"a",
"single",
"clustering",
"result",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/result/ClusteringVectorDumper.java#L145-L194 |
64,138 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/CovarianceMatrix.java | CovarianceMatrix.getMeanVector | public <F extends NumberVector> F getMeanVector(Relation<? extends F> relation) {
return RelationUtil.getNumberVectorFactory(relation).newNumberVector(mean);
} | java | public <F extends NumberVector> F getMeanVector(Relation<? extends F> relation) {
return RelationUtil.getNumberVectorFactory(relation).newNumberVector(mean);
} | [
"public",
"<",
"F",
"extends",
"NumberVector",
">",
"F",
"getMeanVector",
"(",
"Relation",
"<",
"?",
"extends",
"F",
">",
"relation",
")",
"{",
"return",
"RelationUtil",
".",
"getNumberVectorFactory",
"(",
"relation",
")",
".",
"newNumberVector",
"(",
"mean",
... | Get the mean as vector.
@param relation Data relation
@param <F> vector type
@return Mean vector | [
"Get",
"the",
"mean",
"as",
"vector",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/CovarianceMatrix.java#L258-L260 |
64,139 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/CovarianceMatrix.java | CovarianceMatrix.reset | public void reset() {
Arrays.fill(mean, 0.);
Arrays.fill(nmea, 0.);
if(elements != null) {
for(int i = 0; i < elements.length; i++) {
Arrays.fill(elements[i], 0.);
}
}
else {
elements = new double[mean.length][mean.length];
}
wsum = 0.;
} | java | public void reset() {
Arrays.fill(mean, 0.);
Arrays.fill(nmea, 0.);
if(elements != null) {
for(int i = 0; i < elements.length; i++) {
Arrays.fill(elements[i], 0.);
}
}
else {
elements = new double[mean.length][mean.length];
}
wsum = 0.;
} | [
"public",
"void",
"reset",
"(",
")",
"{",
"Arrays",
".",
"fill",
"(",
"mean",
",",
"0.",
")",
";",
"Arrays",
".",
"fill",
"(",
"nmea",
",",
"0.",
")",
";",
"if",
"(",
"elements",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | Reset the covariance matrix.
This function <em>may</em> be called after a "destroy". | [
"Reset",
"the",
"covariance",
"matrix",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/CovarianceMatrix.java#L335-L347 |
64,140 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/CovarianceMatrix.java | CovarianceMatrix.make | public static CovarianceMatrix make(Relation<? extends NumberVector> relation) {
int dim = RelationUtil.dimensionality(relation);
CovarianceMatrix c = new CovarianceMatrix(dim);
double[] mean = c.mean;
int count = 0;
// Compute mean first:
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid... | java | public static CovarianceMatrix make(Relation<? extends NumberVector> relation) {
int dim = RelationUtil.dimensionality(relation);
CovarianceMatrix c = new CovarianceMatrix(dim);
double[] mean = c.mean;
int count = 0;
// Compute mean first:
for(DBIDIter iditer = relation.iterDBIDs(); iditer.valid... | [
"public",
"static",
"CovarianceMatrix",
"make",
"(",
"Relation",
"<",
"?",
"extends",
"NumberVector",
">",
"relation",
")",
"{",
"int",
"dim",
"=",
"RelationUtil",
".",
"dimensionality",
"(",
"relation",
")",
";",
"CovarianceMatrix",
"c",
"=",
"new",
"Covarian... | Static Constructor from a full relation.
@param relation Relation to use.
@return Covariance matrix | [
"Static",
"Constructor",
"from",
"a",
"full",
"relation",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/linearalgebra/CovarianceMatrix.java#L355-L398 |
64,141 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/FiniteProgress.java | FiniteProgress.appendToBuffer | @Override
public StringBuilder appendToBuffer(StringBuilder buf) {
String processedString = Integer.toString(getProcessed());
int percentage = (int) (getProcessed() * 100.0 / total);
buf.append(getTask());
buf.append(": ");
for(int i = 0; i < totalLength - processedString.length(); i++) {
bu... | java | @Override
public StringBuilder appendToBuffer(StringBuilder buf) {
String processedString = Integer.toString(getProcessed());
int percentage = (int) (getProcessed() * 100.0 / total);
buf.append(getTask());
buf.append(": ");
for(int i = 0; i < totalLength - processedString.length(); i++) {
bu... | [
"@",
"Override",
"public",
"StringBuilder",
"appendToBuffer",
"(",
"StringBuilder",
"buf",
")",
"{",
"String",
"processedString",
"=",
"Integer",
".",
"toString",
"(",
"getProcessed",
"(",
")",
")",
";",
"int",
"percentage",
"=",
"(",
"int",
")",
"(",
"getPr... | Append a string representation of the progress to the given string buffer.
@param buf Buffer to serialize to
@return Buffer the data was serialized to. | [
"Append",
"a",
"string",
"representation",
"of",
"the",
"progress",
"to",
"the",
"given",
"string",
"buffer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/FiniteProgress.java#L97-L129 |
64,142 | elki-project/elki | elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/FiniteProgress.java | FiniteProgress.ensureCompleted | public void ensureCompleted(Logging logger) {
if(!isComplete()) {
logger.warning("Progress had not completed automatically as expected: " + getProcessed() + "/" + total, new Throwable());
setProcessed(getTotal());
logger.progress(this);
}
} | java | public void ensureCompleted(Logging logger) {
if(!isComplete()) {
logger.warning("Progress had not completed automatically as expected: " + getProcessed() + "/" + total, new Throwable());
setProcessed(getTotal());
logger.progress(this);
}
} | [
"public",
"void",
"ensureCompleted",
"(",
"Logging",
"logger",
")",
"{",
"if",
"(",
"!",
"isComplete",
"(",
")",
")",
"{",
"logger",
".",
"warning",
"(",
"\"Progress had not completed automatically as expected: \"",
"+",
"getProcessed",
"(",
")",
"+",
"\"/\"",
"... | Ensure that the progress was completed, to make progress bars disappear
@param logger Logger to report to. | [
"Ensure",
"that",
"the",
"progress",
"was",
"completed",
"to",
"make",
"progress",
"bars",
"disappear"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-logging/src/main/java/de/lmu/ifi/dbs/elki/logging/progress/FiniteProgress.java#L153-L159 |
64,143 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/DWOF.java | DWOF.clusterData | private void clusterData(DBIDs ids, RangeQuery<O> rnnQuery, WritableDoubleDataStore radii, WritableDataStore<ModifiableDBIDs> labels) {
FiniteProgress clustProg = LOG.isVerbose() ? new FiniteProgress("Density-Based Clustering", ids.size(), LOG) : null;
// Iterate over all objects
for(DBIDIter iter = ids.ite... | java | private void clusterData(DBIDs ids, RangeQuery<O> rnnQuery, WritableDoubleDataStore radii, WritableDataStore<ModifiableDBIDs> labels) {
FiniteProgress clustProg = LOG.isVerbose() ? new FiniteProgress("Density-Based Clustering", ids.size(), LOG) : null;
// Iterate over all objects
for(DBIDIter iter = ids.ite... | [
"private",
"void",
"clusterData",
"(",
"DBIDs",
"ids",
",",
"RangeQuery",
"<",
"O",
">",
"rnnQuery",
",",
"WritableDoubleDataStore",
"radii",
",",
"WritableDataStore",
"<",
"ModifiableDBIDs",
">",
"labels",
")",
"{",
"FiniteProgress",
"clustProg",
"=",
"LOG",
".... | This method applies a density based clustering algorithm.
It looks for an unclustered object and builds a new cluster for it, then
adds all the points within its radius to that cluster.
nChain represents the points to be added to the cluster and its
radius-neighbors
@param ids Database IDs to process
@param rnnQuery... | [
"This",
"method",
"applies",
"a",
"density",
"based",
"clustering",
"algorithm",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/DWOF.java#L242-L283 |
64,144 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/DWOF.java | DWOF.updateSizes | private int updateSizes(DBIDs ids, WritableDataStore<ModifiableDBIDs> labels, WritableIntegerDataStore newSizes) {
// to count the unclustered all over
int countUnmerged = 0;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
// checking the point's new cluster size after the clustering s... | java | private int updateSizes(DBIDs ids, WritableDataStore<ModifiableDBIDs> labels, WritableIntegerDataStore newSizes) {
// to count the unclustered all over
int countUnmerged = 0;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
// checking the point's new cluster size after the clustering s... | [
"private",
"int",
"updateSizes",
"(",
"DBIDs",
"ids",
",",
"WritableDataStore",
"<",
"ModifiableDBIDs",
">",
"labels",
",",
"WritableIntegerDataStore",
"newSizes",
")",
"{",
"// to count the unclustered all over",
"int",
"countUnmerged",
"=",
"0",
";",
"for",
"(",
"... | This method updates each object's cluster size after the clustering step.
@param ids Object IDs to process
@param labels references for each object's cluster
@param newSizes the sizes container to be updated
@return the number of unclustered objects | [
"This",
"method",
"updates",
"each",
"object",
"s",
"cluster",
"size",
"after",
"the",
"clustering",
"step",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/DWOF.java#L293-L306 |
64,145 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java | SLINK.run | public PointerHierarchyRepresentationResult run(Database database, Relation<O> relation) {
DBIDs ids = relation.getDBIDs();
WritableDBIDDataStore pi = DataStoreUtil.makeDBIDStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC);
WritableDoubleDataStore lambda = DataStoreUtil.makeDoubleStorag... | java | public PointerHierarchyRepresentationResult run(Database database, Relation<O> relation) {
DBIDs ids = relation.getDBIDs();
WritableDBIDDataStore pi = DataStoreUtil.makeDBIDStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_STATIC);
WritableDoubleDataStore lambda = DataStoreUtil.makeDoubleStorag... | [
"public",
"PointerHierarchyRepresentationResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"DBIDs",
"ids",
"=",
"relation",
".",
"getDBIDs",
"(",
")",
";",
"WritableDBIDDataStore",
"pi",
"=",
"DataStoreUtil",
".",... | Performs the SLINK algorithm on the given database.
@param database Database to process
@param relation Data relation to use | [
"Performs",
"the",
"SLINK",
"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/hierarchical/SLINK.java#L101-L149 |
64,146 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java | SLINK.process | protected void process(DBIDRef id, ArrayDBIDs ids, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
slinkstep3(id, it, n, pi, lambda, m);
slinkstep4(id, it, n, pi, lambda);
} | java | protected void process(DBIDRef id, ArrayDBIDs ids, DBIDArrayIter it, int n, WritableDBIDDataStore pi, WritableDoubleDataStore lambda, WritableDoubleDataStore m) {
slinkstep3(id, it, n, pi, lambda, m);
slinkstep4(id, it, n, pi, lambda);
} | [
"protected",
"void",
"process",
"(",
"DBIDRef",
"id",
",",
"ArrayDBIDs",
"ids",
",",
"DBIDArrayIter",
"it",
",",
"int",
"n",
",",
"WritableDBIDDataStore",
"pi",
",",
"WritableDoubleDataStore",
"lambda",
",",
"WritableDoubleDataStore",
"m",
")",
"{",
"slinkstep3",
... | SLINK main loop.
@param id Current object
@param ids All objects
@param it Array iterator
@param n Last object to process at this run
@param pi Parent
@param lambda Height
@param m Distance | [
"SLINK",
"main",
"loop",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/SLINK.java#L200-L203 |
64,147 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/ClusterOrder.java | ClusterOrder.add | public void add(DBIDRef id, double reach, DBIDRef pre) {
ids.add(id);
reachability.putDouble(id, reach);
if(pre == null || pre instanceof DBIDVar && !((DBIDVar) pre).isSet()) {
return;
}
predecessor.putDBID(id, pre);
} | java | public void add(DBIDRef id, double reach, DBIDRef pre) {
ids.add(id);
reachability.putDouble(id, reach);
if(pre == null || pre instanceof DBIDVar && !((DBIDVar) pre).isSet()) {
return;
}
predecessor.putDBID(id, pre);
} | [
"public",
"void",
"add",
"(",
"DBIDRef",
"id",
",",
"double",
"reach",
",",
"DBIDRef",
"pre",
")",
"{",
"ids",
".",
"add",
"(",
"id",
")",
";",
"reachability",
".",
"putDouble",
"(",
"id",
",",
"reach",
")",
";",
"if",
"(",
"pre",
"==",
"null",
"... | Add an object to the cluster order.
@param id Object id
@param reach Reachability
@param pre Predecessor | [
"Add",
"an",
"object",
"to",
"the",
"cluster",
"order",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/ClusterOrder.java#L111-L118 |
64,148 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/ClusterOrder.java | ClusterOrder.order | @Override
public ArrayModifiableDBIDs order(DBIDs ids) {
ArrayModifiableDBIDs res = DBIDUtil.newArray(ids.size());
for(DBIDIter it = this.ids.iter(); it.valid(); it.advance()) {
if(ids.contains(it)) {
res.add(it);
}
}
return res;
} | java | @Override
public ArrayModifiableDBIDs order(DBIDs ids) {
ArrayModifiableDBIDs res = DBIDUtil.newArray(ids.size());
for(DBIDIter it = this.ids.iter(); it.valid(); it.advance()) {
if(ids.contains(it)) {
res.add(it);
}
}
return res;
} | [
"@",
"Override",
"public",
"ArrayModifiableDBIDs",
"order",
"(",
"DBIDs",
"ids",
")",
"{",
"ArrayModifiableDBIDs",
"res",
"=",
"DBIDUtil",
".",
"newArray",
"(",
"ids",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"DBIDIter",
"it",
"=",
"this",
".",
"ids"... | Use the cluster order to sort the given collection ids.
Implementation of the {@link OrderingResult} interface. | [
"Use",
"the",
"cluster",
"order",
"to",
"sort",
"the",
"given",
"collection",
"ids",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/ClusterOrder.java#L137-L146 |
64,149 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/ClusterOrder.java | ClusterOrder.getPredecessor | public void getPredecessor(DBIDRef id, DBIDVar out) {
if(predecessor == null) {
out.unset();
return;
}
predecessor.assignVar(id, out);
} | java | public void getPredecessor(DBIDRef id, DBIDVar out) {
if(predecessor == null) {
out.unset();
return;
}
predecessor.assignVar(id, out);
} | [
"public",
"void",
"getPredecessor",
"(",
"DBIDRef",
"id",
",",
"DBIDVar",
"out",
")",
"{",
"if",
"(",
"predecessor",
"==",
"null",
")",
"{",
"out",
".",
"unset",
"(",
")",
";",
"return",
";",
"}",
"predecessor",
".",
"assignVar",
"(",
"id",
",",
"out... | Get the predecessor.
@param id Current id.
@param out Output variable to store the predecessor. | [
"Get",
"the",
"predecessor",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/optics/ClusterOrder.java#L173-L179 |
64,150 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/COF.java | COF.run | public OutlierResult run(Database database, Relation<O> relation) {
StepProgress stepprog = LOG.isVerbose() ? new StepProgress("COF", 3) : null;
DistanceQuery<O> dq = database.getDistanceQuery(relation, getDistanceFunction());
LOG.beginStep(stepprog, 1, "Materializing COF neighborhoods.");
KNNQuery<O> k... | java | public OutlierResult run(Database database, Relation<O> relation) {
StepProgress stepprog = LOG.isVerbose() ? new StepProgress("COF", 3) : null;
DistanceQuery<O> dq = database.getDistanceQuery(relation, getDistanceFunction());
LOG.beginStep(stepprog, 1, "Materializing COF neighborhoods.");
KNNQuery<O> k... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"StepProgress",
"stepprog",
"=",
"LOG",
".",
"isVerbose",
"(",
")",
"?",
"new",
"StepProgress",
"(",
"\"COF\"",
",",
"3",
")",
":",
"null... | Runs the COF algorithm on the given database.
@param database Database to query
@param relation Data to process
@return COF outlier result | [
"Runs",
"the",
"COF",
"algorithm",
"on",
"the",
"given",
"database",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/COF.java#L104-L128 |
64,151 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/COF.java | COF.computeCOFScores | private void computeCOFScores(KNNQuery<O> knnq, DBIDs ids, DoubleDataStore acds, WritableDoubleDataStore cofs, DoubleMinMax cofminmax) {
FiniteProgress progressCOFs = LOG.isVerbose() ? new FiniteProgress("COF for objects", ids.size(), LOG) : null;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
... | java | private void computeCOFScores(KNNQuery<O> knnq, DBIDs ids, DoubleDataStore acds, WritableDoubleDataStore cofs, DoubleMinMax cofminmax) {
FiniteProgress progressCOFs = LOG.isVerbose() ? new FiniteProgress("COF for objects", ids.size(), LOG) : null;
for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
... | [
"private",
"void",
"computeCOFScores",
"(",
"KNNQuery",
"<",
"O",
">",
"knnq",
",",
"DBIDs",
"ids",
",",
"DoubleDataStore",
"acds",
",",
"WritableDoubleDataStore",
"cofs",
",",
"DoubleMinMax",
"cofminmax",
")",
"{",
"FiniteProgress",
"progressCOFs",
"=",
"LOG",
... | Compute Connectivity outlier factors.
@param knnq KNN query
@param ids IDs to process
@param acds Average chaining distances
@param cofs Connectivity outlier factor storage
@param cofminmax Score minimum/maximum tracker | [
"Compute",
"Connectivity",
"outlier",
"factors",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/lof/COF.java#L203-L224 |
64,152 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java | UpdateRunner.invokeLater | public void invokeLater(Runnable r) {
queue.add(r);
synchronized(this) {
if(synchronizer == null) {
runQueue();
}
else {
synchronizer.activate();
}
}
} | java | public void invokeLater(Runnable r) {
queue.add(r);
synchronized(this) {
if(synchronizer == null) {
runQueue();
}
else {
synchronizer.activate();
}
}
} | [
"public",
"void",
"invokeLater",
"(",
"Runnable",
"r",
")",
"{",
"queue",
".",
"add",
"(",
"r",
")",
";",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"synchronizer",
"==",
"null",
")",
"{",
"runQueue",
"(",
")",
";",
"}",
"else",
"{",
"synchr... | Add a new update to run at any appropriate time.
@param r New runnable to perform the update | [
"Add",
"a",
"new",
"update",
"to",
"run",
"at",
"any",
"appropriate",
"time",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java#L67-L77 |
64,153 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java | UpdateRunner.runQueue | public void runQueue() {
synchronized(sync) {
while(!queue.isEmpty()) {
Runnable r = queue.poll();
if(r != null) {
try {
r.run();
}
catch(Exception e) {
// Alternatively, we could allow the specification of exception
// handlers... | java | public void runQueue() {
synchronized(sync) {
while(!queue.isEmpty()) {
Runnable r = queue.poll();
if(r != null) {
try {
r.run();
}
catch(Exception e) {
// Alternatively, we could allow the specification of exception
// handlers... | [
"public",
"void",
"runQueue",
"(",
")",
"{",
"synchronized",
"(",
"sync",
")",
"{",
"while",
"(",
"!",
"queue",
".",
"isEmpty",
"(",
")",
")",
"{",
"Runnable",
"r",
"=",
"queue",
".",
"poll",
"(",
")",
";",
"if",
"(",
"r",
"!=",
"null",
")",
"{... | Run the processing queue now. This should usually be only invoked by the
UpdateSynchronizer | [
"Run",
"the",
"processing",
"queue",
"now",
".",
"This",
"should",
"usually",
"be",
"only",
"invoked",
"by",
"the",
"UpdateSynchronizer"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java#L83-L103 |
64,154 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java | UpdateRunner.synchronizeWith | public synchronized void synchronizeWith(UpdateSynchronizer newsync) {
// LoggingUtil.warning("Synchronizing: " + sync + " " + newsync, new
// Throwable());
if(synchronizer == newsync) {
LoggingUtil.warning("Double-synced to the same plot!", new Throwable());
return;
}
if(synchronizer !=... | java | public synchronized void synchronizeWith(UpdateSynchronizer newsync) {
// LoggingUtil.warning("Synchronizing: " + sync + " " + newsync, new
// Throwable());
if(synchronizer == newsync) {
LoggingUtil.warning("Double-synced to the same plot!", new Throwable());
return;
}
if(synchronizer !=... | [
"public",
"synchronized",
"void",
"synchronizeWith",
"(",
"UpdateSynchronizer",
"newsync",
")",
"{",
"// LoggingUtil.warning(\"Synchronizing: \" + sync + \" \" + newsync, new",
"// Throwable());",
"if",
"(",
"synchronizer",
"==",
"newsync",
")",
"{",
"LoggingUtil",
".",
"warn... | Set a new update synchronizer.
@param newsync Update synchronizer | [
"Set",
"a",
"new",
"update",
"synchronizer",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java#L126-L139 |
64,155 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java | UpdateRunner.unsynchronizeWith | public synchronized void unsynchronizeWith(UpdateSynchronizer oldsync) {
if(synchronizer == null) {
LoggingUtil.warning("Warning: was not synchronized.");
return;
}
if(synchronizer != oldsync) {
LoggingUtil.warning("Warning: was synchronized differently!");
return;
}
// Loggi... | java | public synchronized void unsynchronizeWith(UpdateSynchronizer oldsync) {
if(synchronizer == null) {
LoggingUtil.warning("Warning: was not synchronized.");
return;
}
if(synchronizer != oldsync) {
LoggingUtil.warning("Warning: was synchronized differently!");
return;
}
// Loggi... | [
"public",
"synchronized",
"void",
"unsynchronizeWith",
"(",
"UpdateSynchronizer",
"oldsync",
")",
"{",
"if",
"(",
"synchronizer",
"==",
"null",
")",
"{",
"LoggingUtil",
".",
"warning",
"(",
"\"Warning: was not synchronized.\"",
")",
";",
"return",
";",
"}",
"if",
... | Remove an update synchronizer
@param oldsync Update synchronizer to remove | [
"Remove",
"an",
"update",
"synchronizer"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/UpdateRunner.java#L146-L158 |
64,156 | elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/PerplexityAffinityMatrixBuilder.java | PerplexityAffinityMatrixBuilder.estimateInitialBeta | protected static double estimateInitialBeta(double[] dist_i, double perplexity) {
double sum = 0.;
for(double d : dist_i) {
double d2 = d * d;
sum += d2 < Double.POSITIVE_INFINITY ? d2 : 0.;
}
return sum > 0 && sum < Double.POSITIVE_INFINITY ? .5 / sum * perplexity * (dist_i.length - 1.) : 1... | java | protected static double estimateInitialBeta(double[] dist_i, double perplexity) {
double sum = 0.;
for(double d : dist_i) {
double d2 = d * d;
sum += d2 < Double.POSITIVE_INFINITY ? d2 : 0.;
}
return sum > 0 && sum < Double.POSITIVE_INFINITY ? .5 / sum * perplexity * (dist_i.length - 1.) : 1... | [
"protected",
"static",
"double",
"estimateInitialBeta",
"(",
"double",
"[",
"]",
"dist_i",
",",
"double",
"perplexity",
")",
"{",
"double",
"sum",
"=",
"0.",
";",
"for",
"(",
"double",
"d",
":",
"dist_i",
")",
"{",
"double",
"d2",
"=",
"d",
"*",
"d",
... | Estimate beta from the distances in a row.
This lacks a mathematical argument, but is a handcrafted heuristic to avoid
numerical problems. The average distance is usually too large, so we scale
the average distance by 2*N/perplexity. Then estimate beta as 1/x.
@param dist_i Distances
@param perplexity Desired perplex... | [
"Estimate",
"beta",
"from",
"the",
"distances",
"in",
"a",
"row",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/PerplexityAffinityMatrixBuilder.java#L206-L213 |
64,157 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.getRelations | public static List<Relation<?>> getRelations(Result r) {
if(r instanceof Relation<?>) {
List<Relation<?>> anns = new ArrayList<>(1);
anns.add((Relation<?>) r);
return anns;
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r).getHierarchy(), r, Relati... | java | public static List<Relation<?>> getRelations(Result r) {
if(r instanceof Relation<?>) {
List<Relation<?>> anns = new ArrayList<>(1);
anns.add((Relation<?>) r);
return anns;
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r).getHierarchy(), r, Relati... | [
"public",
"static",
"List",
"<",
"Relation",
"<",
"?",
">",
">",
"getRelations",
"(",
"Result",
"r",
")",
"{",
"if",
"(",
"r",
"instanceof",
"Relation",
"<",
"?",
">",
")",
"{",
"List",
"<",
"Relation",
"<",
"?",
">",
">",
"anns",
"=",
"new",
"Ar... | Collect all Annotation results from a Result
@param r Result
@return List of all annotation results | [
"Collect",
"all",
"Annotation",
"results",
"from",
"a",
"Result"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L53-L63 |
64,158 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.getOrderingResults | public static List<OrderingResult> getOrderingResults(Result r) {
if(r instanceof OrderingResult) {
List<OrderingResult> ors = new ArrayList<>(1);
ors.add((OrderingResult) r);
return ors;
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r).getHierarc... | java | public static List<OrderingResult> getOrderingResults(Result r) {
if(r instanceof OrderingResult) {
List<OrderingResult> ors = new ArrayList<>(1);
ors.add((OrderingResult) r);
return ors;
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r).getHierarc... | [
"public",
"static",
"List",
"<",
"OrderingResult",
">",
"getOrderingResults",
"(",
"Result",
"r",
")",
"{",
"if",
"(",
"r",
"instanceof",
"OrderingResult",
")",
"{",
"List",
"<",
"OrderingResult",
">",
"ors",
"=",
"new",
"ArrayList",
"<>",
"(",
"1",
")",
... | Collect all ordering results from a Result
@param r Result
@return List of ordering results | [
"Collect",
"all",
"ordering",
"results",
"from",
"a",
"Result"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L71-L81 |
64,159 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.getCollectionResults | public static List<CollectionResult<?>> getCollectionResults(Result r) {
if(r instanceof CollectionResult<?>) {
List<CollectionResult<?>> crs = new ArrayList<>(1);
crs.add((CollectionResult<?>) r);
return crs;
}
if(r instanceof HierarchicalResult) {
return filterResults(((Hierarchica... | java | public static List<CollectionResult<?>> getCollectionResults(Result r) {
if(r instanceof CollectionResult<?>) {
List<CollectionResult<?>> crs = new ArrayList<>(1);
crs.add((CollectionResult<?>) r);
return crs;
}
if(r instanceof HierarchicalResult) {
return filterResults(((Hierarchica... | [
"public",
"static",
"List",
"<",
"CollectionResult",
"<",
"?",
">",
">",
"getCollectionResults",
"(",
"Result",
"r",
")",
"{",
"if",
"(",
"r",
"instanceof",
"CollectionResult",
"<",
"?",
">",
")",
"{",
"List",
"<",
"CollectionResult",
"<",
"?",
">",
">",... | Collect all collection results from a Result
@param r Result
@return List of collection results | [
"Collect",
"all",
"collection",
"results",
"from",
"a",
"Result"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L89-L99 |
64,160 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.getIterableResults | public static List<IterableResult<?>> getIterableResults(Result r) {
if(r instanceof IterableResult<?>) {
List<IterableResult<?>> irs = new ArrayList<>(1);
irs.add((IterableResult<?>) r);
return irs;
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r... | java | public static List<IterableResult<?>> getIterableResults(Result r) {
if(r instanceof IterableResult<?>) {
List<IterableResult<?>> irs = new ArrayList<>(1);
irs.add((IterableResult<?>) r);
return irs;
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r... | [
"public",
"static",
"List",
"<",
"IterableResult",
"<",
"?",
">",
">",
"getIterableResults",
"(",
"Result",
"r",
")",
"{",
"if",
"(",
"r",
"instanceof",
"IterableResult",
"<",
"?",
">",
")",
"{",
"List",
"<",
"IterableResult",
"<",
"?",
">",
">",
"irs"... | Return all Iterable results
@param r Result
@return List of iterable results | [
"Return",
"all",
"Iterable",
"results"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L107-L117 |
64,161 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.filterResults | public static <C extends Result> ArrayList<C> filterResults(ResultHierarchy hier, Result r, Class<? super C> restrictionClass) {
ArrayList<C> res = new ArrayList<>();
final It<C> it = hier.iterDescendantsSelf(r).filter(restrictionClass);
it.forEach(res::add);
return res;
} | java | public static <C extends Result> ArrayList<C> filterResults(ResultHierarchy hier, Result r, Class<? super C> restrictionClass) {
ArrayList<C> res = new ArrayList<>();
final It<C> it = hier.iterDescendantsSelf(r).filter(restrictionClass);
it.forEach(res::add);
return res;
} | [
"public",
"static",
"<",
"C",
"extends",
"Result",
">",
"ArrayList",
"<",
"C",
">",
"filterResults",
"(",
"ResultHierarchy",
"hier",
",",
"Result",
"r",
",",
"Class",
"<",
"?",
"super",
"C",
">",
"restrictionClass",
")",
"{",
"ArrayList",
"<",
"C",
">",
... | Return only results of the given restriction class
@param <C> Class type
@param hier Result hierarchy
@param r Starting position
@param restrictionClass Class restriction
@return filtered results list | [
"Return",
"only",
"results",
"of",
"the",
"given",
"restriction",
"class"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L128-L133 |
64,162 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.addChildResult | public static void addChildResult(HierarchicalResult parent, Result child) {
parent.getHierarchy().add(parent, child);
} | java | public static void addChildResult(HierarchicalResult parent, Result child) {
parent.getHierarchy().add(parent, child);
} | [
"public",
"static",
"void",
"addChildResult",
"(",
"HierarchicalResult",
"parent",
",",
"Result",
"child",
")",
"{",
"parent",
".",
"getHierarchy",
"(",
")",
".",
"add",
"(",
"parent",
",",
"child",
")",
";",
"}"
] | Add a child result.
@param parent Parent
@param child Child | [
"Add",
"a",
"child",
"result",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L156-L158 |
64,163 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.findDatabase | public static Database findDatabase(ResultHierarchy hier, Result baseResult) {
final List<Database> dbs = filterResults(hier, baseResult, Database.class);
return (!dbs.isEmpty()) ? dbs.get(0) : null;
} | java | public static Database findDatabase(ResultHierarchy hier, Result baseResult) {
final List<Database> dbs = filterResults(hier, baseResult, Database.class);
return (!dbs.isEmpty()) ? dbs.get(0) : null;
} | [
"public",
"static",
"Database",
"findDatabase",
"(",
"ResultHierarchy",
"hier",
",",
"Result",
"baseResult",
")",
"{",
"final",
"List",
"<",
"Database",
">",
"dbs",
"=",
"filterResults",
"(",
"hier",
",",
"baseResult",
",",
"Database",
".",
"class",
")",
";"... | Find the first database result in the tree.
@param baseResult Result tree base.
@return Database | [
"Find",
"the",
"first",
"database",
"result",
"in",
"the",
"tree",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L166-L169 |
64,164 | elki-project/elki | elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java | ResultUtil.removeRecursive | public static void removeRecursive(ResultHierarchy hierarchy, Result child) {
for(It<Result> iter = hierarchy.iterParents(child); iter.valid(); iter.advance()) {
hierarchy.remove(iter.get(), child);
}
for(It<Result> iter = hierarchy.iterChildren(child); iter.valid(); iter.advance()) {
removeRecu... | java | public static void removeRecursive(ResultHierarchy hierarchy, Result child) {
for(It<Result> iter = hierarchy.iterParents(child); iter.valid(); iter.advance()) {
hierarchy.remove(iter.get(), child);
}
for(It<Result> iter = hierarchy.iterChildren(child); iter.valid(); iter.advance()) {
removeRecu... | [
"public",
"static",
"void",
"removeRecursive",
"(",
"ResultHierarchy",
"hierarchy",
",",
"Result",
"child",
")",
"{",
"for",
"(",
"It",
"<",
"Result",
">",
"iter",
"=",
"hierarchy",
".",
"iterParents",
"(",
"child",
")",
";",
"iter",
".",
"valid",
"(",
"... | Recursively remove a result and its children.
@param hierarchy Result hierarchy
@param child Result to remove | [
"Recursively",
"remove",
"a",
"result",
"and",
"its",
"children",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core/src/main/java/de/lmu/ifi/dbs/elki/result/ResultUtil.java#L188-L195 |
64,165 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java | FastMultidimensionalScalingTransform.findEigenVectors | protected void findEigenVectors(double[][] imat, double[][] evs, double[] lambda) {
final int size = imat.length;
Random rnd = random.getSingleThreadedRandom();
double[] tmp = new double[size];
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Learning projections", tdim, LOG) : null;
for(... | java | protected void findEigenVectors(double[][] imat, double[][] evs, double[] lambda) {
final int size = imat.length;
Random rnd = random.getSingleThreadedRandom();
double[] tmp = new double[size];
FiniteProgress prog = LOG.isVerbose() ? new FiniteProgress("Learning projections", tdim, LOG) : null;
for(... | [
"protected",
"void",
"findEigenVectors",
"(",
"double",
"[",
"]",
"[",
"]",
"imat",
",",
"double",
"[",
"]",
"[",
"]",
"evs",
",",
"double",
"[",
"]",
"lambda",
")",
"{",
"final",
"int",
"size",
"=",
"imat",
".",
"length",
";",
"Random",
"rnd",
"="... | Find the first eigenvectors and eigenvalues using power iterations.
@param imat Matrix (will be modified!)
@param evs Eigenvectors output
@param lambda Eigenvalues output | [
"Find",
"the",
"first",
"eigenvectors",
"and",
"eigenvalues",
"using",
"power",
"iterations",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L178-L204 |
64,166 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java | FastMultidimensionalScalingTransform.randomInitialization | protected void randomInitialization(double[] out, Random rnd) {
double l2 = 0.;
while(!(l2 > 0)) {
for(int d = 0; d < out.length; d++) {
final double val = rnd.nextDouble();
out[d] = val;
l2 += val * val;
}
}
// Standardize:
final double s = 1. / FastMath.sqrt(l2)... | java | protected void randomInitialization(double[] out, Random rnd) {
double l2 = 0.;
while(!(l2 > 0)) {
for(int d = 0; d < out.length; d++) {
final double val = rnd.nextDouble();
out[d] = val;
l2 += val * val;
}
}
// Standardize:
final double s = 1. / FastMath.sqrt(l2)... | [
"protected",
"void",
"randomInitialization",
"(",
"double",
"[",
"]",
"out",
",",
"Random",
"rnd",
")",
"{",
"double",
"l2",
"=",
"0.",
";",
"while",
"(",
"!",
"(",
"l2",
">",
"0",
")",
")",
"{",
"for",
"(",
"int",
"d",
"=",
"0",
";",
"d",
"<",... | Choose a random vector of unit norm for power iterations.
@param out Output storage
@param rnd Random source. | [
"Choose",
"a",
"random",
"vector",
"of",
"unit",
"norm",
"for",
"power",
"iterations",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L212-L226 |
64,167 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java | FastMultidimensionalScalingTransform.updateEigenvector | protected double updateEigenvector(double[] in, double[] out, double l) {
double s = 1. / (l > 0. ? l : l < 0. ? -l : 1.);
s = (in[0] > 0.) ? s : -s; // Reduce flipping vectors
double diff = 0.;
for(int d = 0; d < in.length; d++) {
in[d] *= s; // Scale to unit length
// Compute change from p... | java | protected double updateEigenvector(double[] in, double[] out, double l) {
double s = 1. / (l > 0. ? l : l < 0. ? -l : 1.);
s = (in[0] > 0.) ? s : -s; // Reduce flipping vectors
double diff = 0.;
for(int d = 0; d < in.length; d++) {
in[d] *= s; // Scale to unit length
// Compute change from p... | [
"protected",
"double",
"updateEigenvector",
"(",
"double",
"[",
"]",
"in",
",",
"double",
"[",
"]",
"out",
",",
"double",
"l",
")",
"{",
"double",
"s",
"=",
"1.",
"/",
"(",
"l",
">",
"0.",
"?",
"l",
":",
"l",
"<",
"0.",
"?",
"-",
"l",
":",
"1... | Compute the change in the eigenvector, and normalize the output vector
while doing so.
@param in Input vector
@param out Output vector
@param l Eigenvalue
@return Change | [
"Compute",
"the",
"change",
"in",
"the",
"eigenvector",
"and",
"normalize",
"the",
"output",
"vector",
"while",
"doing",
"so",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L260-L272 |
64,168 | elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java | FastMultidimensionalScalingTransform.updateMatrix | protected void updateMatrix(double[][] mat, final double[] evec, double eval) {
final int size = mat.length;
for(int i = 0; i < size; i++) {
final double[] mati = mat[i];
final double eveci = evec[i];
for(int j = 0; j < size; j++) {
mati[j] -= eval * eveci * evec[j];
}
}
} | java | protected void updateMatrix(double[][] mat, final double[] evec, double eval) {
final int size = mat.length;
for(int i = 0; i < size; i++) {
final double[] mati = mat[i];
final double eveci = evec[i];
for(int j = 0; j < size; j++) {
mati[j] -= eval * eveci * evec[j];
}
}
} | [
"protected",
"void",
"updateMatrix",
"(",
"double",
"[",
"]",
"[",
"]",
"mat",
",",
"final",
"double",
"[",
"]",
"evec",
",",
"double",
"eval",
")",
"{",
"final",
"int",
"size",
"=",
"mat",
".",
"length",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";... | Update matrix, by removing the effects of a known Eigenvector.
@param mat Matrix
@param evec Known normalized Eigenvector
@param eval Eigenvalue | [
"Update",
"matrix",
"by",
"removing",
"the",
"effects",
"of",
"a",
"known",
"Eigenvector",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/transform/FastMultidimensionalScalingTransform.java#L304-L313 |
64,169 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedExtremeValueDistribution.java | GeneralizedExtremeValueDistribution.pdf | public static double pdf(double x, double mu, double sigma, double k) {
if(x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {
return 0.;
}
x = (x - mu) / sigma;
if(k > 0 || k < 0) {
if(k * x > 1) {
return 0.;
}
double t = FastMath.log(1 - k * x);
retu... | java | public static double pdf(double x, double mu, double sigma, double k) {
if(x == Double.POSITIVE_INFINITY || x == Double.NEGATIVE_INFINITY) {
return 0.;
}
x = (x - mu) / sigma;
if(k > 0 || k < 0) {
if(k * x > 1) {
return 0.;
}
double t = FastMath.log(1 - k * x);
retu... | [
"public",
"static",
"double",
"pdf",
"(",
"double",
"x",
",",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"k",
")",
"{",
"if",
"(",
"x",
"==",
"Double",
".",
"POSITIVE_INFINITY",
"||",
"x",
"==",
"Double",
".",
"NEGATIVE_INFINITY",
")",
"{",... | PDF of GEV distribution
@param x Value
@param mu Location parameter mu
@param sigma Scale parameter sigma
@param k Shape parameter k
@return PDF at position x. | [
"PDF",
"of",
"GEV",
"distribution"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedExtremeValueDistribution.java#L130-L147 |
64,170 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedExtremeValueDistribution.java | GeneralizedExtremeValueDistribution.cdf | public static double cdf(double val, double mu, double sigma, double k) {
final double x = (val - mu) / sigma;
if(k > 0 || k < 0) {
if(k * x > 1) {
return k > 0 ? 1 : 0;
}
return FastMath.exp(-FastMath.exp(FastMath.log(1 - k * x) / k));
}
else { // Gumbel case:
return Fas... | java | public static double cdf(double val, double mu, double sigma, double k) {
final double x = (val - mu) / sigma;
if(k > 0 || k < 0) {
if(k * x > 1) {
return k > 0 ? 1 : 0;
}
return FastMath.exp(-FastMath.exp(FastMath.log(1 - k * x) / k));
}
else { // Gumbel case:
return Fas... | [
"public",
"static",
"double",
"cdf",
"(",
"double",
"val",
",",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"k",
")",
"{",
"final",
"double",
"x",
"=",
"(",
"val",
"-",
"mu",
")",
"/",
"sigma",
";",
"if",
"(",
"k",
">",
"0",
"||",
"k... | CDF of GEV distribution
@param val Value
@param mu Location parameter mu
@param sigma Scale parameter sigma
@param k Shape parameter k
@return CDF at position x. | [
"CDF",
"of",
"GEV",
"distribution"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedExtremeValueDistribution.java#L196-L207 |
64,171 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedExtremeValueDistribution.java | GeneralizedExtremeValueDistribution.quantile | public static double quantile(double val, double mu, double sigma, double k) {
if(val < 0.0 || val > 1.0) {
return Double.NaN;
}
if(k < 0) {
return mu + sigma * Math.max((1. - FastMath.pow(-FastMath.log(val), k)) / k, 1. / k);
}
else if(k > 0) {
return mu + sigma * Math.min((1. - F... | java | public static double quantile(double val, double mu, double sigma, double k) {
if(val < 0.0 || val > 1.0) {
return Double.NaN;
}
if(k < 0) {
return mu + sigma * Math.max((1. - FastMath.pow(-FastMath.log(val), k)) / k, 1. / k);
}
else if(k > 0) {
return mu + sigma * Math.min((1. - F... | [
"public",
"static",
"double",
"quantile",
"(",
"double",
"val",
",",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"k",
")",
"{",
"if",
"(",
"val",
"<",
"0.0",
"||",
"val",
">",
"1.0",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"}",
... | Quantile function of GEV distribution
@param val Value
@param mu Location parameter mu
@param sigma Scale parameter sigma
@param k Shape parameter k
@return Quantile function at position x. | [
"Quantile",
"function",
"of",
"GEV",
"distribution"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/GeneralizedExtremeValueDistribution.java#L223-L236 |
64,172 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/RayleighDistribution.java | RayleighDistribution.cdf | public static double cdf(double x, double sigma) {
if(x <= 0.) {
return 0.;
}
final double xs = x / sigma;
return 1. - FastMath.exp(-.5 * xs * xs);
} | java | public static double cdf(double x, double sigma) {
if(x <= 0.) {
return 0.;
}
final double xs = x / sigma;
return 1. - FastMath.exp(-.5 * xs * xs);
} | [
"public",
"static",
"double",
"cdf",
"(",
"double",
"x",
",",
"double",
"sigma",
")",
"{",
"if",
"(",
"x",
"<=",
"0.",
")",
"{",
"return",
"0.",
";",
"}",
"final",
"double",
"xs",
"=",
"x",
"/",
"sigma",
";",
"return",
"1.",
"-",
"FastMath",
".",... | CDF of Rayleigh distribution
@param x Value
@param sigma Scale parameter
@return CDF at position x. | [
"CDF",
"of",
"Rayleigh",
"distribution"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/RayleighDistribution.java#L173-L179 |
64,173 | elki-project/elki | elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/RayleighDistribution.java | RayleighDistribution.quantile | public static double quantile(double val, double sigma) {
if(!(val >= 0.) || !(val <= 1.)) {
return Double.NaN;
}
if(val == 0.) {
return 0.;
}
if(val == 1.) {
return Double.POSITIVE_INFINITY;
}
return sigma * FastMath.sqrt(-2. * FastMath.log(1. - val));
} | java | public static double quantile(double val, double sigma) {
if(!(val >= 0.) || !(val <= 1.)) {
return Double.NaN;
}
if(val == 0.) {
return 0.;
}
if(val == 1.) {
return Double.POSITIVE_INFINITY;
}
return sigma * FastMath.sqrt(-2. * FastMath.log(1. - val));
} | [
"public",
"static",
"double",
"quantile",
"(",
"double",
"val",
",",
"double",
"sigma",
")",
"{",
"if",
"(",
"!",
"(",
"val",
">=",
"0.",
")",
"||",
"!",
"(",
"val",
"<=",
"1.",
")",
")",
"{",
"return",
"Double",
".",
"NaN",
";",
"}",
"if",
"("... | Quantile function of Rayleigh distribution
@param val Value
@param sigma Scale parameter
@return Quantile function at position x. | [
"Quantile",
"function",
"of",
"Rayleigh",
"distribution"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-math/src/main/java/de/lmu/ifi/dbs/elki/math/statistics/distribution/RayleighDistribution.java#L193-L204 |
64,174 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/ABOD.java | ABOD.run | public OutlierResult run(Database db, Relation<V> relation) {
ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());
// Build a kernel matrix, to make O(n^3) slightly less bad.
SimilarityQuery<V> sq = db.getSimilarityQuery(relation, kernelFunction);
KernelMatrix kernelMatrix = new KernelMatrix(sq, ... | java | public OutlierResult run(Database db, Relation<V> relation) {
ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());
// Build a kernel matrix, to make O(n^3) slightly less bad.
SimilarityQuery<V> sq = db.getSimilarityQuery(relation, kernelFunction);
KernelMatrix kernelMatrix = new KernelMatrix(sq, ... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"db",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"ArrayDBIDs",
"ids",
"=",
"DBIDUtil",
".",
"ensureArray",
"(",
"relation",
".",
"getDBIDs",
"(",
")",
")",
";",
"// Build a kernel matrix, to make O(... | Run ABOD on the data set.
@param relation Relation to process
@return Outlier detection result | [
"Run",
"ABOD",
"on",
"the",
"data",
"set",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/ABOD.java#L114-L135 |
64,175 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/ABOD.java | ABOD.computeABOF | protected double computeABOF(KernelMatrix kernelMatrix, DBIDRef pA, DBIDArrayIter pB, DBIDArrayIter pC, MeanVariance s) {
s.reset(); // Reused
double simAA = kernelMatrix.getSimilarity(pA, pA);
for(pB.seek(0); pB.valid(); pB.advance()) {
if(DBIDUtil.equal(pB, pA)) {
continue;
}
do... | java | protected double computeABOF(KernelMatrix kernelMatrix, DBIDRef pA, DBIDArrayIter pB, DBIDArrayIter pC, MeanVariance s) {
s.reset(); // Reused
double simAA = kernelMatrix.getSimilarity(pA, pA);
for(pB.seek(0); pB.valid(); pB.advance()) {
if(DBIDUtil.equal(pB, pA)) {
continue;
}
do... | [
"protected",
"double",
"computeABOF",
"(",
"KernelMatrix",
"kernelMatrix",
",",
"DBIDRef",
"pA",
",",
"DBIDArrayIter",
"pB",
",",
"DBIDArrayIter",
"pC",
",",
"MeanVariance",
"s",
")",
"{",
"s",
".",
"reset",
"(",
")",
";",
"// Reused",
"double",
"simAA",
"="... | Compute the exact ABOF value.
@param kernelMatrix Kernel matrix
@param pA Object A to compute ABOF for
@param pB Iterator over objects B
@param pC Iterator over objects C
@param s Statistics tracker
@return ABOF value | [
"Compute",
"the",
"exact",
"ABOF",
"value",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/anglebased/ABOD.java#L147-L183 |
64,176 | elki-project/elki | elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/parallel/ParallelKNNWeightOutlier.java | ParallelKNNWeightOutlier.run | public OutlierResult run(Database database, Relation<O> relation) {
DBIDs ids = relation.getDBIDs();
WritableDoubleDataStore store = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_DB);
DistanceQuery<O> distq = database.getDistanceQuery(relation, getDistanceFunction());
KNNQuery<O> knnq = dat... | java | public OutlierResult run(Database database, Relation<O> relation) {
DBIDs ids = relation.getDBIDs();
WritableDoubleDataStore store = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_DB);
DistanceQuery<O> distq = database.getDistanceQuery(relation, getDistanceFunction());
KNNQuery<O> knnq = dat... | [
"public",
"OutlierResult",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"DBIDs",
"ids",
"=",
"relation",
".",
"getDBIDs",
"(",
")",
";",
"WritableDoubleDataStore",
"store",
"=",
"DataStoreUtil",
".",
"makeDoubleStor... | Run the parallel kNN weight outlier detector.
@param database Database to process
@param relation Relation to analyze
@return Outlier detection result | [
"Run",
"the",
"parallel",
"kNN",
"weight",
"outlier",
"detector",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-outlier/src/main/java/de/lmu/ifi/dbs/elki/algorithm/outlier/distance/parallel/ParallelKNNWeightOutlier.java#L119-L147 |
64,177 | elki-project/elki | addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java | UKMeans.run | public Clustering<?> run(final Database database, final Relation<DiscreteUncertainObject> relation) {
if(relation.size() <= 0) {
return new Clustering<>("Uk-Means Clustering", "ukmeans-clustering");
}
// Choose initial means randomly
DBIDs sampleids = DBIDUtil.randomSample(relation.getDBIDs(), k, ... | java | public Clustering<?> run(final Database database, final Relation<DiscreteUncertainObject> relation) {
if(relation.size() <= 0) {
return new Clustering<>("Uk-Means Clustering", "ukmeans-clustering");
}
// Choose initial means randomly
DBIDs sampleids = DBIDUtil.randomSample(relation.getDBIDs(), k, ... | [
"public",
"Clustering",
"<",
"?",
">",
"run",
"(",
"final",
"Database",
"database",
",",
"final",
"Relation",
"<",
"DiscreteUncertainObject",
">",
"relation",
")",
"{",
"if",
"(",
"relation",
".",
"size",
"(",
")",
"<=",
"0",
")",
"{",
"return",
"new",
... | Run the clustering.
@param database the Database
@param relation the Relation
@return Clustering result | [
"Run",
"the",
"clustering",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java#L132-L180 |
64,178 | elki-project/elki | addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java | UKMeans.updateAssignment | protected boolean updateAssignment(DBIDIter iditer, List<? extends ModifiableDBIDs> clusters, WritableIntegerDataStore assignment, int newA) {
final int oldA = assignment.intValue(iditer);
if(oldA == newA) {
return false;
}
clusters.get(newA).add(iditer);
assignment.putInt(iditer, newA);
i... | java | protected boolean updateAssignment(DBIDIter iditer, List<? extends ModifiableDBIDs> clusters, WritableIntegerDataStore assignment, int newA) {
final int oldA = assignment.intValue(iditer);
if(oldA == newA) {
return false;
}
clusters.get(newA).add(iditer);
assignment.putInt(iditer, newA);
i... | [
"protected",
"boolean",
"updateAssignment",
"(",
"DBIDIter",
"iditer",
",",
"List",
"<",
"?",
"extends",
"ModifiableDBIDs",
">",
"clusters",
",",
"WritableIntegerDataStore",
"assignment",
",",
"int",
"newA",
")",
"{",
"final",
"int",
"oldA",
"=",
"assignment",
"... | Update the cluster assignment.
@param iditer Object id
@param clusters Cluster list
@param assignment Assignment storage
@param newA New assignment.
@return {@code true} if the assignment has changed. | [
"Update",
"the",
"cluster",
"assignment",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java#L223-L234 |
64,179 | elki-project/elki | addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java | UKMeans.getExpectedRepDistance | protected double getExpectedRepDistance(NumberVector rep, DiscreteUncertainObject uo) {
SquaredEuclideanDistanceFunction euclidean = SquaredEuclideanDistanceFunction.STATIC;
int counter = 0;
double sum = 0.0;
for(int i = 0; i < uo.getNumberSamples(); i++) {
sum += euclidean.distance(rep, uo.getSam... | java | protected double getExpectedRepDistance(NumberVector rep, DiscreteUncertainObject uo) {
SquaredEuclideanDistanceFunction euclidean = SquaredEuclideanDistanceFunction.STATIC;
int counter = 0;
double sum = 0.0;
for(int i = 0; i < uo.getNumberSamples(); i++) {
sum += euclidean.distance(rep, uo.getSam... | [
"protected",
"double",
"getExpectedRepDistance",
"(",
"NumberVector",
"rep",
",",
"DiscreteUncertainObject",
"uo",
")",
"{",
"SquaredEuclideanDistanceFunction",
"euclidean",
"=",
"SquaredEuclideanDistanceFunction",
".",
"STATIC",
";",
"int",
"counter",
"=",
"0",
";",
"d... | Get expected distance between a Vector and an uncertain object
@param rep A vector, e.g. a cluster representative
@param uo A discrete uncertain object
@return The distance | [
"Get",
"expected",
"distance",
"between",
"a",
"Vector",
"and",
"an",
"uncertain",
"object"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java#L243-L252 |
64,180 | elki-project/elki | addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java | UKMeans.logVarstat | protected void logVarstat(DoubleStatistic varstat, double[] varsum) {
if(varstat != null) {
double s = sum(varsum);
getLogger().statistics(varstat.setDouble(s));
}
} | java | protected void logVarstat(DoubleStatistic varstat, double[] varsum) {
if(varstat != null) {
double s = sum(varsum);
getLogger().statistics(varstat.setDouble(s));
}
} | [
"protected",
"void",
"logVarstat",
"(",
"DoubleStatistic",
"varstat",
",",
"double",
"[",
"]",
"varsum",
")",
"{",
"if",
"(",
"varstat",
"!=",
"null",
")",
"{",
"double",
"s",
"=",
"sum",
"(",
"varsum",
")",
";",
"getLogger",
"(",
")",
".",
"statistics... | Log statistics on the variance sum.
@param varstat Statistics log instance
@param varsum Variance sum per cluster | [
"Log",
"statistics",
"on",
"the",
"variance",
"sum",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/uncertain/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/uncertain/UKMeans.java#L306-L311 |
64,181 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java | SavedSettingsFile.save | public void save() throws FileNotFoundException {
PrintStream p = new PrintStream(file);
p.println(COMMENT_PREFIX + "Saved ELKI settings. First line is title, remaining lines are parameters.");
for (Pair<String, ArrayList<String>> settings : store) {
p.println(settings.first);
for (String str : ... | java | public void save() throws FileNotFoundException {
PrintStream p = new PrintStream(file);
p.println(COMMENT_PREFIX + "Saved ELKI settings. First line is title, remaining lines are parameters.");
for (Pair<String, ArrayList<String>> settings : store) {
p.println(settings.first);
for (String str : ... | [
"public",
"void",
"save",
"(",
")",
"throws",
"FileNotFoundException",
"{",
"PrintStream",
"p",
"=",
"new",
"PrintStream",
"(",
"file",
")",
";",
"p",
".",
"println",
"(",
"COMMENT_PREFIX",
"+",
"\"Saved ELKI settings. First line is title, remaining lines are parameters... | Save the current data to the given file.
@throws FileNotFoundException thrown on output errors. | [
"Save",
"the",
"current",
"data",
"to",
"the",
"given",
"file",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java#L73-L84 |
64,182 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java | SavedSettingsFile.load | public void load() throws FileNotFoundException, IOException {
BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
ArrayList<String> buf = new ArrayList<>();
while (is.ready()) {
String line = is.readLine();
// skip comments
if (line.startsWith(COMMENT... | java | public void load() throws FileNotFoundException, IOException {
BufferedReader is = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
ArrayList<String> buf = new ArrayList<>();
while (is.ready()) {
String line = is.readLine();
// skip comments
if (line.startsWith(COMMENT... | [
"public",
"void",
"load",
"(",
")",
"throws",
"FileNotFoundException",
",",
"IOException",
"{",
"BufferedReader",
"is",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamReader",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
")",
")",
";",
"ArrayList",
... | Read the current file
@throws FileNotFoundException thrown when file not found
@throws IOException thrown on IO errprs | [
"Read",
"the",
"current",
"file"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java#L92-L115 |
64,183 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java | SavedSettingsFile.remove | public void remove(String key) {
Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
while (it.hasNext()) {
String thisKey = it.next().first;
if (key.equals(thisKey)) {
it.remove();
break;
}
}
} | java | public void remove(String key) {
Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
while (it.hasNext()) {
String thisKey = it.next().first;
if (key.equals(thisKey)) {
it.remove();
break;
}
}
} | [
"public",
"void",
"remove",
"(",
"String",
"key",
")",
"{",
"Iterator",
"<",
"Pair",
"<",
"String",
",",
"ArrayList",
"<",
"String",
">",
">",
">",
"it",
"=",
"store",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
... | Remove a given key from the file.
@param key Key to remove | [
"Remove",
"a",
"given",
"key",
"from",
"the",
"file",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java#L127-L136 |
64,184 | elki-project/elki | elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java | SavedSettingsFile.get | public ArrayList<String> get(String key) {
Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
while (it.hasNext()) {
Pair<String, ArrayList<String>> pair = it.next();
if (key.equals(pair.first)) {
return pair.second;
}
}
return null;
} | java | public ArrayList<String> get(String key) {
Iterator<Pair<String, ArrayList<String>>> it = store.iterator();
while (it.hasNext()) {
Pair<String, ArrayList<String>> pair = it.next();
if (key.equals(pair.first)) {
return pair.second;
}
}
return null;
} | [
"public",
"ArrayList",
"<",
"String",
">",
"get",
"(",
"String",
"key",
")",
"{",
"Iterator",
"<",
"Pair",
"<",
"String",
",",
"ArrayList",
"<",
"String",
">",
">",
">",
"it",
"=",
"store",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"it",
".",
... | Find a saved setting by key.
@param key Key to search for
@return saved settings for this key | [
"Find",
"a",
"saved",
"setting",
"by",
"key",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-gui-minigui/src/main/java/de/lmu/ifi/dbs/elki/gui/util/SavedSettingsFile.java#L144-L153 |
64,185 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java | ORCLUS.run | public Clustering<Model> run(Database database, Relation<V> relation) {
// current dimensionality associated with each seed
int dim_c = RelationUtil.dimensionality(relation);
if(dim_c < l) {
throw new IllegalStateException("Dimensionality of data < parameter l! " + "(" + dim_c + " < " + l + ")");
... | java | public Clustering<Model> run(Database database, Relation<V> relation) {
// current dimensionality associated with each seed
int dim_c = RelationUtil.dimensionality(relation);
if(dim_c < l) {
throw new IllegalStateException("Dimensionality of data < parameter l! " + "(" + dim_c + " < " + l + ")");
... | [
"public",
"Clustering",
"<",
"Model",
">",
"run",
"(",
"Database",
"database",
",",
"Relation",
"<",
"V",
">",
"relation",
")",
"{",
"// current dimensionality associated with each seed",
"int",
"dim_c",
"=",
"RelationUtil",
".",
"dimensionality",
"(",
"relation",
... | Performs the ORCLUS algorithm on the given database.
@param database Database
@param relation Relation | [
"Performs",
"the",
"ORCLUS",
"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/correlation/ORCLUS.java#L129-L177 |
64,186 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java | ORCLUS.initialSeeds | private List<ORCLUSCluster> initialSeeds(Relation<V> database, int k) {
DBIDs randomSample = DBIDUtil.randomSample(database.getDBIDs(), k, rnd);
List<ORCLUSCluster> seeds = new ArrayList<>(k);
for(DBIDIter iter = randomSample.iter(); iter.valid(); iter.advance()) {
seeds.add(new ORCLUSCluster(database... | java | private List<ORCLUSCluster> initialSeeds(Relation<V> database, int k) {
DBIDs randomSample = DBIDUtil.randomSample(database.getDBIDs(), k, rnd);
List<ORCLUSCluster> seeds = new ArrayList<>(k);
for(DBIDIter iter = randomSample.iter(); iter.valid(); iter.advance()) {
seeds.add(new ORCLUSCluster(database... | [
"private",
"List",
"<",
"ORCLUSCluster",
">",
"initialSeeds",
"(",
"Relation",
"<",
"V",
">",
"database",
",",
"int",
"k",
")",
"{",
"DBIDs",
"randomSample",
"=",
"DBIDUtil",
".",
"randomSample",
"(",
"database",
".",
"getDBIDs",
"(",
")",
",",
"k",
",",... | Initializes the list of seeds wit a random sample of size k.
@param database the database holding the objects
@param k the size of the random sample
@return the initial seed list | [
"Initializes",
"the",
"list",
"of",
"seeds",
"wit",
"a",
"random",
"sample",
"of",
"size",
"k",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java#L186-L193 |
64,187 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java | ORCLUS.assign | private void assign(Relation<V> database, List<ORCLUSCluster> clusters) {
NumberVectorDistanceFunction<? super V> distFunc = SquaredEuclideanDistanceFunction.STATIC;
// clear the current clusters
for(ORCLUSCluster cluster : clusters) {
cluster.objectIDs.clear();
}
// projected centroids of th... | java | private void assign(Relation<V> database, List<ORCLUSCluster> clusters) {
NumberVectorDistanceFunction<? super V> distFunc = SquaredEuclideanDistanceFunction.STATIC;
// clear the current clusters
for(ORCLUSCluster cluster : clusters) {
cluster.objectIDs.clear();
}
// projected centroids of th... | [
"private",
"void",
"assign",
"(",
"Relation",
"<",
"V",
">",
"database",
",",
"List",
"<",
"ORCLUSCluster",
">",
"clusters",
")",
"{",
"NumberVectorDistanceFunction",
"<",
"?",
"super",
"V",
">",
"distFunc",
"=",
"SquaredEuclideanDistanceFunction",
".",
"STATIC"... | Creates a partitioning of the database by assigning each object to its
closest seed.
@param database the database holding the objects
@param clusters the array of clusters to which the objects should be
assigned to | [
"Creates",
"a",
"partitioning",
"of",
"the",
"database",
"by",
"assigning",
"each",
"object",
"to",
"its",
"closest",
"seed",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java#L203-L243 |
64,188 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java | ORCLUS.merge | private void merge(Relation<V> relation, List<ORCLUSCluster> clusters, int k_new, int d_new, IndefiniteProgress cprogress) {
ArrayList<ProjectedEnergy> projectedEnergies = new ArrayList<>((clusters.size() * (clusters.size() - 1)) >>> 1);
for(int i = 0; i < clusters.size(); i++) {
for(int j = i + 1; j < cl... | java | private void merge(Relation<V> relation, List<ORCLUSCluster> clusters, int k_new, int d_new, IndefiniteProgress cprogress) {
ArrayList<ProjectedEnergy> projectedEnergies = new ArrayList<>((clusters.size() * (clusters.size() - 1)) >>> 1);
for(int i = 0; i < clusters.size(); i++) {
for(int j = i + 1; j < cl... | [
"private",
"void",
"merge",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"List",
"<",
"ORCLUSCluster",
">",
"clusters",
",",
"int",
"k_new",
",",
"int",
"d_new",
",",
"IndefiniteProgress",
"cprogress",
")",
"{",
"ArrayList",
"<",
"ProjectedEnergy",
">",
... | Reduces the number of seeds to k_new
@param relation the database holding the objects
@param clusters the set of current seeds
@param k_new the new number of seeds
@param d_new the new dimensionality of the subspaces for each seed | [
"Reduces",
"the",
"number",
"of",
"seeds",
"to",
"k_new"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java#L268-L327 |
64,189 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java | ORCLUS.projectedEnergy | private ProjectedEnergy projectedEnergy(Relation<V> relation, ORCLUSCluster c_i, ORCLUSCluster c_j, int i, int j, int dim) {
NumberVectorDistanceFunction<? super V> distFunc = SquaredEuclideanDistanceFunction.STATIC;
// union of cluster c_i and c_j
ORCLUSCluster c_ij = union(relation, c_i, c_j, dim);
d... | java | private ProjectedEnergy projectedEnergy(Relation<V> relation, ORCLUSCluster c_i, ORCLUSCluster c_j, int i, int j, int dim) {
NumberVectorDistanceFunction<? super V> distFunc = SquaredEuclideanDistanceFunction.STATIC;
// union of cluster c_i and c_j
ORCLUSCluster c_ij = union(relation, c_i, c_j, dim);
d... | [
"private",
"ProjectedEnergy",
"projectedEnergy",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"ORCLUSCluster",
"c_i",
",",
"ORCLUSCluster",
"c_j",
",",
"int",
"i",
",",
"int",
"j",
",",
"int",
"dim",
")",
"{",
"NumberVectorDistanceFunction",
"<",
"?",
"s... | Computes the projected energy of the specified clusters. The projected
energy is given by the mean square distance of the points to the centroid
of the union cluster c, when all points in c are projected to the subspace
of c.
@param relation the relation holding the objects
@param c_i the first cluster
@param c_j the ... | [
"Computes",
"the",
"projected",
"energy",
"of",
"the",
"specified",
"clusters",
".",
"The",
"projected",
"energy",
"is",
"given",
"by",
"the",
"mean",
"square",
"distance",
"of",
"the",
"points",
"to",
"the",
"centroid",
"of",
"the",
"union",
"cluster",
"c",... | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java#L343-L357 |
64,190 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java | ORCLUS.union | private ORCLUSCluster union(Relation<V> relation, ORCLUSCluster c1, ORCLUSCluster c2, int dim) {
ORCLUSCluster c = new ORCLUSCluster();
c.objectIDs = DBIDUtil.newHashSet(c1.objectIDs);
c.objectIDs.addDBIDs(c2.objectIDs);
c.objectIDs = DBIDUtil.newArray(c.objectIDs);
if(c.objectIDs.size() > 0) {
... | java | private ORCLUSCluster union(Relation<V> relation, ORCLUSCluster c1, ORCLUSCluster c2, int dim) {
ORCLUSCluster c = new ORCLUSCluster();
c.objectIDs = DBIDUtil.newHashSet(c1.objectIDs);
c.objectIDs.addDBIDs(c2.objectIDs);
c.objectIDs = DBIDUtil.newArray(c.objectIDs);
if(c.objectIDs.size() > 0) {
... | [
"private",
"ORCLUSCluster",
"union",
"(",
"Relation",
"<",
"V",
">",
"relation",
",",
"ORCLUSCluster",
"c1",
",",
"ORCLUSCluster",
"c2",
",",
"int",
"dim",
")",
"{",
"ORCLUSCluster",
"c",
"=",
"new",
"ORCLUSCluster",
"(",
")",
";",
"c",
".",
"objectIDs",
... | Returns the union of the two specified clusters.
@param relation the database holding the objects
@param c1 the first cluster
@param c2 the second cluster
@param dim the dimensionality of the union cluster
@return the union of the two specified clusters | [
"Returns",
"the",
"union",
"of",
"the",
"two",
"specified",
"clusters",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/correlation/ORCLUS.java#L368-L383 |
64,191 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java | AnderbergHierarchicalClustering.initializeNNCache | private static void initializeNNCache(double[] scratch, double[] bestd, int[] besti) {
final int size = bestd.length;
Arrays.fill(bestd, Double.POSITIVE_INFINITY);
Arrays.fill(besti, -1);
for(int x = 0, p = 0; x < size; x++) {
assert (p == MatrixParadigm.triangleSize(x));
double bestdx = Dou... | java | private static void initializeNNCache(double[] scratch, double[] bestd, int[] besti) {
final int size = bestd.length;
Arrays.fill(bestd, Double.POSITIVE_INFINITY);
Arrays.fill(besti, -1);
for(int x = 0, p = 0; x < size; x++) {
assert (p == MatrixParadigm.triangleSize(x));
double bestdx = Dou... | [
"private",
"static",
"void",
"initializeNNCache",
"(",
"double",
"[",
"]",
"scratch",
",",
"double",
"[",
"]",
"bestd",
",",
"int",
"[",
"]",
"besti",
")",
"{",
"final",
"int",
"size",
"=",
"bestd",
".",
"length",
";",
"Arrays",
".",
"fill",
"(",
"be... | Initialize the NN cache.
@param scratch Scratch space
@param bestd Best distance
@param besti Best index | [
"Initialize",
"the",
"NN",
"cache",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java#L149-L171 |
64,192 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java | AnderbergHierarchicalClustering.findMerge | protected int findMerge(int size, MatrixParadigm mat, double[] bestd, int[] besti, PointerHierarchyRepresentationBuilder builder) {
double mindist = Double.POSITIVE_INFINITY;
int x = -1, y = -1;
// Find minimum:
for(int cx = 0; cx < size; cx++) {
// Skip if object has already joined a cluster:
... | java | protected int findMerge(int size, MatrixParadigm mat, double[] bestd, int[] besti, PointerHierarchyRepresentationBuilder builder) {
double mindist = Double.POSITIVE_INFINITY;
int x = -1, y = -1;
// Find minimum:
for(int cx = 0; cx < size; cx++) {
// Skip if object has already joined a cluster:
... | [
"protected",
"int",
"findMerge",
"(",
"int",
"size",
",",
"MatrixParadigm",
"mat",
",",
"double",
"[",
"]",
"bestd",
",",
"int",
"[",
"]",
"besti",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
")",
"{",
"double",
"mindist",
"=",
"Double",
".",
"P... | Perform the next merge step.
Due to the cache, this is now O(n) each time, instead of O(n*n).
@param size Data set size
@param mat Matrix paradigm
@param bestd Best distance
@param besti Index of best distance
@param builder Hierarchy builder
@return x, for shrinking the working set. | [
"Perform",
"the",
"next",
"merge",
"step",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java#L185-L206 |
64,193 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java | AnderbergHierarchicalClustering.merge | protected void merge(int size, MatrixParadigm mat, double[] bestd, int[] besti, PointerHierarchyRepresentationBuilder builder, double mindist, int x, int y) {
// Avoid allocating memory, by reusing existing iterators:
final DBIDArrayIter ix = mat.ix.seek(x), iy = mat.iy.seek(y);
if(LOG.isDebuggingFine()) {
... | java | protected void merge(int size, MatrixParadigm mat, double[] bestd, int[] besti, PointerHierarchyRepresentationBuilder builder, double mindist, int x, int y) {
// Avoid allocating memory, by reusing existing iterators:
final DBIDArrayIter ix = mat.ix.seek(x), iy = mat.iy.seek(y);
if(LOG.isDebuggingFine()) {
... | [
"protected",
"void",
"merge",
"(",
"int",
"size",
",",
"MatrixParadigm",
"mat",
",",
"double",
"[",
"]",
"bestd",
",",
"int",
"[",
"]",
"besti",
",",
"PointerHierarchyRepresentationBuilder",
"builder",
",",
"double",
"mindist",
",",
"int",
"x",
",",
"int",
... | Execute the cluster merge.
@param size Data set size
@param mat Matrix paradigm
@param bestd Best distance
@param besti Index of best distance
@param builder Hierarchy builder
@param mindist Distance that was used for merging
@param x First matrix position
@param y Second matrix position | [
"Execute",
"the",
"cluster",
"merge",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java#L220-L242 |
64,194 | elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java | AnderbergHierarchicalClustering.updateCache | private void updateCache(int size, double[] scratch, double[] bestd, int[] besti, int x, int y, int j, double d) {
// New best
if(d <= bestd[j]) {
bestd[j] = d;
besti[j] = y;
return;
}
// Needs slow update.
if(besti[j] == x || besti[j] == y) {
findBest(size, scratch, bestd, b... | java | private void updateCache(int size, double[] scratch, double[] bestd, int[] besti, int x, int y, int j, double d) {
// New best
if(d <= bestd[j]) {
bestd[j] = d;
besti[j] = y;
return;
}
// Needs slow update.
if(besti[j] == x || besti[j] == y) {
findBest(size, scratch, bestd, b... | [
"private",
"void",
"updateCache",
"(",
"int",
"size",
",",
"double",
"[",
"]",
"scratch",
",",
"double",
"[",
"]",
"bestd",
",",
"int",
"[",
"]",
"besti",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"j",
",",
"double",
"d",
")",
"{",
"// New be... | Update the cache.
@param size Working set size
@param scratch Scratch matrix
@param bestd Best distance
@param besti Best index
@param x First cluster
@param y Second cluster, {@code y < x}
@param j Updated value d(y, j)
@param d New distance | [
"Update",
"the",
"cache",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/hierarchical/AnderbergHierarchicalClustering.java#L312-L323 |
64,195 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java | VisualizerParameterizer.newContext | public VisualizerContext newContext(ResultHierarchy hier, Result start) {
Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class);
for(Relation<?> rel : rels) {
if(samplesize == 0) {
continue;
}
if(!ResultUtil.filterResults(hier, rel, SamplingResult.class).isEmpty... | java | public VisualizerContext newContext(ResultHierarchy hier, Result start) {
Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class);
for(Relation<?> rel : rels) {
if(samplesize == 0) {
continue;
}
if(!ResultUtil.filterResults(hier, rel, SamplingResult.class).isEmpty... | [
"public",
"VisualizerContext",
"newContext",
"(",
"ResultHierarchy",
"hier",
",",
"Result",
"start",
")",
"{",
"Collection",
"<",
"Relation",
"<",
"?",
">",
">",
"rels",
"=",
"ResultUtil",
".",
"filterResults",
"(",
"hier",
",",
"Relation",
".",
"class",
")"... | Make a new visualization context
@param hier Result hierarchy
@param start Starting result
@return New context | [
"Make",
"a",
"new",
"visualization",
"context"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java#L128-L144 |
64,196 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java | VisualizerParameterizer.getTitle | public static String getTitle(Database db, Result result) {
List<TrackedParameter> settings = new ArrayList<>();
for(SettingsResult sr : SettingsResult.getSettingsResults(result)) {
settings.addAll(sr.getSettings());
}
String algorithm = null;
String distance = null;
String dataset = null;... | java | public static String getTitle(Database db, Result result) {
List<TrackedParameter> settings = new ArrayList<>();
for(SettingsResult sr : SettingsResult.getSettingsResults(result)) {
settings.addAll(sr.getSettings());
}
String algorithm = null;
String distance = null;
String dataset = null;... | [
"public",
"static",
"String",
"getTitle",
"(",
"Database",
"db",
",",
"Result",
"result",
")",
"{",
"List",
"<",
"TrackedParameter",
">",
"settings",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"SettingsResult",
"sr",
":",
"SettingsResult",
"... | Try to automatically generate a title for this.
@param db Database
@param result Result object
@return generated title | [
"Try",
"to",
"automatically",
"generate",
"a",
"title",
"for",
"this",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java#L153-L196 |
64,197 | elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java | VisualizerParameterizer.shortenClassname | protected static String shortenClassname(String nam, char c) {
final int lastdot = nam.lastIndexOf(c);
if(lastdot >= 0) {
nam = nam.substring(lastdot + 1);
}
return nam;
} | java | protected static String shortenClassname(String nam, char c) {
final int lastdot = nam.lastIndexOf(c);
if(lastdot >= 0) {
nam = nam.substring(lastdot + 1);
}
return nam;
} | [
"protected",
"static",
"String",
"shortenClassname",
"(",
"String",
"nam",
",",
"char",
"c",
")",
"{",
"final",
"int",
"lastdot",
"=",
"nam",
".",
"lastIndexOf",
"(",
"c",
")",
";",
"if",
"(",
"lastdot",
">=",
"0",
")",
"{",
"nam",
"=",
"nam",
".",
... | Shorten the class name.
@param nam Class name
@param c Splitting character
@return Shortened name | [
"Shorten",
"the",
"class",
"name",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java#L205-L211 |
64,198 | elki-project/elki | elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/DocumentParameters.java | DocumentParameters.getRestrictionClass | private static Class<?> getRestrictionClass(OptionID oid, final Parameter<?> firstopt, Map<OptionID, List<Pair<Parameter<?>, Class<?>>>> byopt) {
Class<?> superclass = getRestrictionClass(firstopt);
// Also look for more general restrictions:
for(Pair<Parameter<?>, Class<?>> clinst : byopt.get(oid)) {
... | java | private static Class<?> getRestrictionClass(OptionID oid, final Parameter<?> firstopt, Map<OptionID, List<Pair<Parameter<?>, Class<?>>>> byopt) {
Class<?> superclass = getRestrictionClass(firstopt);
// Also look for more general restrictions:
for(Pair<Parameter<?>, Class<?>> clinst : byopt.get(oid)) {
... | [
"private",
"static",
"Class",
"<",
"?",
">",
"getRestrictionClass",
"(",
"OptionID",
"oid",
",",
"final",
"Parameter",
"<",
"?",
">",
"firstopt",
",",
"Map",
"<",
"OptionID",
",",
"List",
"<",
"Pair",
"<",
"Parameter",
"<",
"?",
">",
",",
"Class",
"<",... | Get the restriction class of an option.
@param oid Option ID
@param firstopt Parameter
@param byopt Option to parameter map
@return Restriction class | [
"Get",
"the",
"restriction",
"class",
"of",
"an",
"option",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/DocumentParameters.java#L791-L809 |
64,199 | elki-project/elki | elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/DocumentParameters.java | DocumentParameters.sorted | private static <T> ArrayList<T> sorted(Collection<T> cls, Comparator<? super T> c) {
ArrayList<T> sorted = new ArrayList<>(cls);
sorted.sort(c);
return sorted;
} | java | private static <T> ArrayList<T> sorted(Collection<T> cls, Comparator<? super T> c) {
ArrayList<T> sorted = new ArrayList<>(cls);
sorted.sort(c);
return sorted;
} | [
"private",
"static",
"<",
"T",
">",
"ArrayList",
"<",
"T",
">",
"sorted",
"(",
"Collection",
"<",
"T",
">",
"cls",
",",
"Comparator",
"<",
"?",
"super",
"T",
">",
"c",
")",
"{",
"ArrayList",
"<",
"T",
">",
"sorted",
"=",
"new",
"ArrayList",
"<>",
... | Sort a collection of classes.
@param cls Classes to sort
@return Sorted list | [
"Sort",
"a",
"collection",
"of",
"classes",
"."
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-docutil/src/main/java/de/lmu/ifi/dbs/elki/application/internal/DocumentParameters.java#L831-L835 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.