def testgendata():
	anchors = 200
	fname = 'test2.dat'
	querys = 1000
	d = 2
	k = 3
	bnds = ((-10,10),)*d
	clsses = (0,1)
	foo = FastKNN(anchors,k)
	data = getflatcsv(fname)
	foo.addEvidence(data[:,:-1],data[:,-1])
	foo.num_checks = 0
	for x in xrange(querys):
		pnt = numpy.array(gendata.gensingle(d,bnds,clsses))
		foo.query(pnt[:-1])
		if x % 50 == 0:
			print float(x+1)/float(foo.num_checks),
			print x,"/",querys
	print "Average # queries:", float(foo.num_checks)/float(querys)
dataset/ETHPy150Open QuantSoftware/QuantSoftwareToolkit/QSTK/qstklearn/fastknn.py/testgendata/swapped operands of `/`