rohaniのブログ

ゆるっと自然言語処理奴。ときどき工作系バイト。

scikit-learn Tutorial【デコ14日目】

Google Colaboratoryを使って、scikit-learn tutorialをやってみた。

An introduction to machine learning with scikit-learn

Conventions(規則)

  • The sklearn.random_projection module implements a simple and computationally efficient way to reduce the dimensionality of the data by trading a controlled amount of accuracy (as additional variance) for faster processing times and smaller model sizes.
  • np.random.RandomState: seedの設定
  • np.random.RandomState.rand: Random values in a given shape. Create an array of the given shape and populate it with random samples from a uniform distribution over [0, 1).
  • Reduce dimensionality through Gaussian random projection
  • svm.SVC のtargetはstringでもfittingできる

Refitting and updating parameters

  • np.random.RandomState.binomial(n, p, size): Samples are drawn from a binomial distribution with specified parameters, n trials and p probability of success where n an integer >= 0 and p is in the interval [0,1]. (n may be input as a float, but it is truncated to an integer in use)
  • clf.set_parameters(): svm.SVCのパラメタを設定。clfのパラメタを再設、再学習可能。

感想

モチベ維持のために記事に残しているけど、走り書きのメモじゃなくて、ちゃんと未来に生きるようにまとめた記事にした方が、自分のためになる記事になる気がした。 processingみたいに目に見える成果物があれば記事にしてもいいけど...。

あと、tutorialの写経だと考えてる感がなくて、これで良いのか?と迷う。