MCPcopy Create free account
hub / github.com/comaps/comaps / avgDistance

Function avgDistance

tools/python/city_radius.py:48–52  ·  view source on GitHub ↗
(approx, data)

Source from the content-addressed store, hash-verified

46 return math.pow(popul, 1 / base) * mult
47
48def avgDistance(approx, data):
49 dist = 0
50 for x in xrange(len(data)):
51 dist += math.fabs(approx[x] - data[x])
52 return dist / float(len(data))
53
54def findBest(popul, data, minBase = 5, maxBase = 100, stepBase = 0.1, minMult = 0.01, maxMult = 1, stepMult = 0.01):
55

Callers 1

findBestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected