0.5, 0.5, 0.5, 1.0, 0.5, 200) time_end = time.time() sys.stdout.flush() outlier_size = float(len(outliers)) time_used = (time_end - time_begin) / outlier_size rms_list.append((rms, data_size)) precision_list.append((precision, data_size)) recall_list.append((recall, data_size)) accuracy_list.append((accuracy, data_size)) time_list.append((time_used, outlier_size)) data_size_list.append(data_size) repair_distance_list.append(repair_distance) rms = [ UtilFunc.rms_average(rms_lists[name]) for name, _ in exp_methods ] precision = [ UtilFunc.plat_average(precision_lists[name]) for name, _ in exp_methods ] recall = [ UtilFunc.plat_average(recall_lists[name]) for name, _ in exp_methods ] accuracy = [ UtilFunc.plat_average(accuracy_lists[name]) for name, _ in exp_methods ] time_used = [ UtilFunc.plat_average(time_lists[name]) for name, _ in exp_methods
else: jaccard, precision, recall, f1, accuracy, errorcount, data_size = (0.5, 0.5, 0.5, 0.5, 0.5, 0, 200) time_end = time.time() outlier_size = float(len(outliers)) time_used = (time_end - time_begin) / outlier_size jaccard_list.append((jaccard, data_size)) precision_list.append((precision, data_size)) recall_list.append((recall, data_size)) f1_list.append((f1, data_size)) accuracy_list.append((accuracy, data_size)) errorcount_list.append((errorcount, data_size)) time_list.append((time_used, outlier_size)) datasize_list.append(data_size) jaccard = [UtilFunc.plat_average(jaccard_lists[name]) for name, _ in exp_methods] precision = [UtilFunc.plat_average(precision_lists[name]) for name, _ in exp_methods] recall = [UtilFunc.plat_average(recall_lists[name]) for name, _ in exp_methods] f1 = [UtilFunc.plat_average(f1_lists[name]) for name, _ in exp_methods] accuracy = [UtilFunc.plat_average(accuracy_lists[name]) for name, _ in exp_methods] errorcount = [UtilFunc.plat_average(errorcount_lists[name]) for name, _ in exp_methods] time_used = [UtilFunc.plat_average(time_lists[name]) for name, _ in exp_methods] output_content_jaccard += str(error_distance) + '\t%f\t%f\t%f\t%f\t%f\r\n' % tuple(jaccard) output_content_precision += str(error_distance) + '\t%f\t%f\t%f\t%f\t%f\r\n' % tuple(precision) output_content_recall += str(error_distance) + '\t%f\t%f\t%f\t%f\t%f\r\n' % tuple(recall) output_content_f1 += str(error_distance) + '\t%f\t%f\t%f\t%f\t%f\r\n' % tuple(f1) output_content_accuracy += str(error_distance) + '\t%f\t%f\t%f\t%f\t%f\r\n' % tuple(accuracy) output_content_error_count += str(error_distance) + '\t%f\t%f\t%f\t%f\t%f\r\n' % tuple(errorcount) output_content_time += str(error_distance) + '\t%f\t%f\t%f\t%f\t%f\r\n' % tuple(time_used)
if exp_func is not None: errorcount, data_size = exp_func(schema, epsilon=epsilon, neighbor_k=neighbor_k, filenames=filenames) else: errorcount, data_size = (0, 200) time_end = time.time() outlier_size = float(len(outliers)) errorcount_list.append((errorcount, data_size)) datasize_list.append(data_size) errorcount = [ UtilFunc.plat_average(errorcount_lists[name]) for name, _ in exp_methods ] #time_used = [UtilFunc.plat_average(time_lists[name]) for name, _ in exp_methods] output_content_error_count += str( k) + '\t%f\t%f\t%f\t%f\r\n' % tuple(errorcount) #output_content_time += str(k) + '\t%f\t%f\r\n' % tuple(time_used) #print 'Average time(s): %s' % time_used print 'Error Count: %s' % errorcount print output_content_error_count #print output_content_time with open('result/subspace_k_error_count_magic.dat', 'w') as f: f.write(output_content_error_count)
0.5, 0.5, 0.5, 0.5, 0.5, 0, 200) time_end = time.time() outlier_size = float(len(outliers)) time_used = (time_end - time_begin) / outlier_size jaccard_list.append((jaccard, data_size)) precision_list.append((precision, data_size)) recall_list.append((recall, data_size)) f1_list.append((f1, data_size)) accuracy_list.append((accuracy, data_size)) errorcount_list.append((errorcount, data_size)) time_list.append((time_used, outlier_size)) datasize_list.append(data_size) jaccard = [ UtilFunc.plat_average(jaccard_lists[name]) for name, _ in exp_methods ] precision = [ UtilFunc.plat_average(precision_lists[name]) for name, _ in exp_methods ] recall = [ UtilFunc.plat_average(recall_lists[name]) for name, _ in exp_methods ] f1 = [UtilFunc.plat_average(f1_lists[name]) for name, _ in exp_methods] accuracy = [ UtilFunc.plat_average(accuracy_lists[name]) for name, _ in exp_methods ]