:
You should (break your NDA) and show us the code, we can see who here can get the best time complexity.
|
Okay, here goes (for one part of it, at least):
:
def findCentroid(docMatrix):
valArrayTransposed = getArray(docMatrix).transpose()
return asarray([mean(row) for row in valArrayTransposed]
vs
:
def findCentroid(docMatrix):
return docMatrix.sum(axis=0)/docMatrix.shape[0]
As you can see, it's less to do with algorithmic complexity and more to do with understanding how scipy matrixes operate.