MCPcopy Create free account
hub / github.com/antlr/codebuff / distance

Method distance

src/org/antlr/codebuff/kNNClassifier.java:310–314  ·  view source on GitHub ↗

Compute distance as a probability of match, based solely on context information. Ratio of num differences / num total context positions.

(int[] A, int[] B)

Source from the content-addressed store, hash-verified

308 * Ratio of num differences / num total context positions.
309 */
310 public double distance(int[] A, int[] B) {
311// return ((float)Tool.L0_Distance(categorical, A, B))/num_categorical;
312 double d = Tool.weightedL0_Distance(FEATURES, A, B);
313 return d/maxDistanceCount;
314 }
315}

Callers 1

distancesMethod · 0.95

Calls 1

weightedL0_DistanceMethod · 0.95

Tested by

no test coverage detected