矩阵转置:
http://stackoverflow.com/questions/5954603/python-numpy-transpose
http://www.imissy.cn/?p=105
余弦计算:
http://stackoverflow.com/questions/1823293/optimized-method-for-calculating-cosine-distance-in-python
原文:http://www.cnblogs.com/hope100/p/4375307.html