備忘録的な

プログラミングや機械学習に関する備忘録

scikit-learn 0.15.0

scikit-learnが0.15.0になってRandom Forestが速くなったと言っているので試してみました.

Huge speed and memory improvements to random forests (and extra trees) that also benefit better from parallel computing

ベンチマーク用のコードは以下

total = 0.0
for i in xrange(5):
    st = time.clock()
    clf = RandomForestClassifier(n_estimators=100, random_state=1, n_jobs=5)
    clf.fit(x, y)
    pred = clf.predict(x)
    total += time.clock() - st

print total / 5

xは(52704, 21)です.

結果.

0.14.1 0.15.0
処理時間[sec] 8.249 3.726

倍程度速くなってますね.これは嬉しい.

なを,scikit-learnを0.15.0にしたところ,

ImportError: cannot import name inplace_column_scal

というエラーがでるようになってしまいました.
これは,
C:\Python27\Lib\site-packages\sklearn\utils\sparsefuncs.pyd
を削除することで解決しました.