Пример #1
0
def kendall_printer(list_prev, list_curr):
	print "================="
	print "kendall test:"
	print "list_prev: " + str(list_prev)
	print "list_curr: " + str(list_curr)
	print "kendall_: " + str(ccfcr.compute_kendall(list_prev, list_curr)[0])
	print "kendall_w: " + str(ccfcr.compute_kendall(list_prev, list_curr)[1])
	print "================="
	print
Пример #2
0
def test_compute_kendall():
	c_res = ccfcr.compute_kendall(prev_data_with_centrality, curr_data_with_centrality)
	p_res =ccfpr.compute_kendall(prev_data_with_position, curr_data_with_position)
	assert abs(c_res[0] - p_res[0]) < epsilon
	assert abs(c_res[1] - p_res[1]) < epsilon
	
	p_res_identity = ccfpr.compute_kendall(prev_data_with_position, prev_data_with_position)
	assert abs(p_res_identity[0]-1.0) < epsilon
	assert abs(p_res_identity[1]-1.0) < epsilon

	p_res_reverse = ccfcr.compute_kendall(prev_data_with_position, prev_data_with_position_reverse)
	assert abs(p_res_reverse[0]+1.0) < epsilon
	assert abs(p_res_reverse[1]+1.0) < epsilon
Пример #3
0
def test_kendall_dissimilar():
	c_res = ccfcr.kendall(prev_data_with_centrality, curr_data_with_centrality_d, sorted_ids_d)
	c_res_2 = ccfcr.compute_kendall(prev_data_with_centrality, prev_data_with_centrality)
	p_res =ccfpr.kendall(prev_data_with_position, curr_data_with_position_d, sorted_ids_d)
	assert abs(c_res[0] - p_res[0]) < epsilon
	assert False == (abs(c_res_2[0] - p_res[0]) < epsilon)
	assert abs(c_res[1] - p_res[1]) < epsilon