2017年 tsne cuda
gitee tsne cuda
sklearn api
根据以上的已经集成好的api,有以下示例:
import numpy as np
from sklearn.manifold import TSNE
import matplotlib.pyplot as plt
# Random state.
RS = 20150101
import matplotlib.pyplot as plt
X = np.random.rand(100,20)
y = np.random.randint(0,10,100)
reduced_x = TSNE(random_state=RS).fit_transform(X)
plt.figure(figsize=(8, 8))
# ax = plt.subplot(aspect='equal')
sc = plt.scatter(reduced_x[:,0], reduced_x[:,1],c=y)#,cmap='Spectral')#, lw=0, s=40)
# plt.xlim(-25, 25)
# plt.ylim(-25, 25)
plt.axis('off')
# ax.axis('tight')
plt.savefig('tsne-generated.png', dpi=120)
# plt.show()
可以得到