基本的に、私は単純な行列乗算を実行しようとしています。具体的には、各列を抽出し、その長さで除算して正規化します。
#csc sparse matrix
self.__WeightMatrix__ = self.__WeightMatrix__.tocsc()
#iterate through columns
for Col in xrange(self.__WeightMatrix__.shape[1]):
Column = self.__WeightMatrix__[:,Col].data
List = [x**2 for x in Column]
#get the column length
Len = math.sqrt(sum(List))
#here I assumed dot(number,Column) would do a basic scalar product
dot((1/Len),Column)
#now what? how do I update the original column of the matrix, everything that have been returned are copies, which drove me nuts and missed pointers so much
scipyのスパース行列のドキュメントを検索しましたが、有用な情報は得られませんでした。値を直接変更できるように、関数がマトリックスへのポインター/参照を返すことを望んでいました。ありがとう