タグ

2009年10月30日のブックマーク (4件)

  • SciPy Cookbook — SciPy Cookbook documentation

    SciPy Cookbook¶ This is the “SciPy Cookbook” — a collection of various user-contributed recipes, which once lived under wiki.scipy.org. If you have a nice notebook you’d like to add here, or you’d like to make some other edits, please see the SciPy-CookBook repository.

    tettsyun
    tettsyun 2009/10/30
    kd-tree
  • CatTail Wiki*

    状態遷移確率行列を2乗することで,2時点先の状態遷移確率行列を得ます.ですから,1年間の状態遷移確率行列の12乗根を求めれば,1ヶ月間の状態遷移確率行列になります. ですが,SASの行列演算言語IMLでは,行列の冪乗演算子**は,-1以上の整数しか受付けません. そこで,以下に,行列を固有値と固有ベクトル行列に分解して,冪乗根を求める方法を示します. ここでは,平方根を求めていますが,##(1/2)を,##(1/12)にすれば12乗根が得られます. (注:##は,IMLでの,行列の「各要素」の冪乗演算子です.) 警告!:すみません.固有値が複素数になるケースに対応していませんでした. そのうち,直しますが,どなたか直してくれるとうれしいです(翔) →たねやさんが回答してくれました.(感謝感謝) ************************************************

    CatTail Wiki*
    tettsyun
    tettsyun 2009/10/30
    ベキ乗根
  • SciPyを用いて潜在的意味解析(LSA) - 未来は僕以外の手の中

    自然言語処理の技法の1つに、潜在的意味解析(LSA)というものがある。 単語文書行列Aがあった場合、特異値分解(SVD)により A=UΣV に分解し、特異値を大きいほうからk個使って Ak=UkΣkVk のように階数の低減を行うことで、階数kのAへの近似を最小誤差で得ることができる。 つまり特異値分解の計算さえできてしまえばLSAもすぐできるわけだが、 pythonの数値解析モジュールScipyにかかれば特異値分解もあっという間である。 まずは特異値分解まで↓ from numpy import * from scipy import linalg A = matrix([ [5, 8, 9, -4, 2, 4], [2, -4, 9, 4, 3, 3], [-3, 4, 8, 0, 5, 6], [-2, 5, 4, 7, 0, 2] ]) u, sigma, v = linalg.sv

    SciPyを用いて潜在的意味解析(LSA) - 未来は僕以外の手の中
    tettsyun
    tettsyun 2009/10/30
    scipy, LSA(LSI)
  • NumPy for Matlab Users -

    Introduction MATLAB® and NumPy/SciPy have a lot in common. But there are many differences. NumPy and SciPy were created to do numerical and scientific computing in the most natural way with Python, not to be MATLAB® clones. This page is intended to be a place to collect wisdom about the differences, mostly for the purpose of helping proficient MATLAB® users become proficient NumPy and SciPy users.

    tettsyun
    tettsyun 2009/10/30
    numpy for matlab