この広告は、90日以上更新していないブログに表示しています。
scikit-learn 信者としてはとりあえず scikit-learn の実装を使いたくなるが、scikit-learn の実装はおすすめできないらしい。
Besides being slower, sklearn's t-SNE implementation isfine once you realize the default learning rate is way too high for most applications. The definitive bh_tsne implementation by the author sets the learning rate to 200, and the original 2008 paper describes setting it to 100, while sklearn is set to 1000.
とのこと。それに加えて、自分の経験としては、Barnes Hut 木を指定してもメモリをもりもり確保して(即 Θ(n^2) のメモリを確保してる気がする)メモリ不足で死ぬ。だめ。
$ pip install bhtsne
からの
import sklearn.baseimport bhtsneimport numpyas npclassBHTSNE(sklearn.base.BaseEstimator, sklearn.base.TransformerMixin):def__init__(self, dimensions=2, perplexity=30.0, theta=0.5, rand_seed=-1): self.dimensions = dimensions self.perplexity = perplexity self.theta = theta self.rand_seed = rand_seeddeffit_transform(self, x):return bhtsne.tsne( x.astype(np.float64), dimensions=self.dimensions, perplexity=self.perplexity, theta=self.theta, rand_seed=self.rand_seed)
引用をストックしました
引用するにはまずログインしてください
引用をストックできませんでした。再度お試しください
限定公開記事のため引用できません。