示例#1
0
def main():
  arff_file1, arff_file2 = read_args()
  arff1 = Arff.fromfile(arff_file1)
  arff2 = Arff.fromfile(arff_file2)
  norm_arff1 = arff1.normalize()
  norm_arff2 = arff2.normalize()

  space1= Space(len(norm_arff1.attributes))
  populate_space_from_arff(norm_arff1, space1)

  print "Outliers from "+arff_file1+":"
  outliers1 = get_outliers(3, 5, space1)
  if outliers1:
    for x in outliers1:
      print x
  else:
    print "None"

  space2 = Space(len(norm_arff2.attributes))
  populate_space_from_arff(norm_arff2, space2)

  print "Outliers from "+arff_file2+":"
  outliers2 = get_outliers(3, 12, space2)
  if outliers2:
    for x in outliers2:
      print x
  else:
    print "None"
示例#2
0
def main():
  arff_file1, arff_file2 = read_args()
  arff1 = Arff.fromfile(arff_file1)
  arff2 = Arff.fromfile(arff_file2)
  norm_arff1 = arff1.normalize()
  norm_arff2 = arff2.normalize()

  space1= Space(len(norm_arff1.attributes))
  populate_space_from_arff(norm_arff1, space1)

  print "Outliers from "+arff_file1+":"
  for x in get_outliers(space1, 0.05):
    print x

  space2 = Space(len(norm_arff2.attributes))
  populate_space_from_arff(norm_arff2, space2)

  print "Outliers from "+arff_file2+":"
  for x in get_outliers(space2, 0.05):
    print x