@Test public void test7(){ int[] v1 = new int[]{1,0,1,1,0,1,0,1,1}; int[] v2 = new int[]{1,1,0,1,1,1,1,1,0}; double res = Faith.distance(v1, v2); Asserts.assertEquals(res, 0.55555555); }
public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); int[] matches = CommonStats.processTwoBinaryVectors(v1, v2); return 1-((double)(2*matches[0]+matches[3])/(double)(2*v1.length)); }
Faith { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); int[] matches = CommonStats.processTwoBinaryVectors(v1, v2); return 1-((double)(2*matches[0]+matches[3])/(double)(2*v1.length)); } }
Faith { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); int[] matches = CommonStats.processTwoBinaryVectors(v1, v2); return 1-((double)(2*matches[0]+matches[3])/(double)(2*v1.length)); }  }
Faith { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); int[] matches = CommonStats.processTwoBinaryVectors(v1, v2); return 1-((double)(2*matches[0]+matches[3])/(double)(2*v1.length)); }  static double distance(int[] v1, int[] v2); }
Faith { public static double distance(int[] v1, int[] v2){ Asserts.assertEqualLength(v1, v2); int[] matches = CommonStats.processTwoBinaryVectors(v1, v2); return 1-((double)(2*matches[0]+matches[3])/(double)(2*v1.length)); }  static double distance(int[] v1, int[] v2);  }