Skip to content

Commit

Permalink
Merge pull request dpeerlab#8 from dpeerlab/MultiCoreTSNE
Browse files Browse the repository at this point in the history
Replace bhtsne with MultiCoreTSNE
  • Loading branch information
ManuSetty authored May 2, 2019
2 parents 3ca67cd + bdffeab commit ae0bdc0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@
'phenograph',
'tables>=3.4.2',
'Cython',
'bhtsne',
'cmake',
'MulticoreTSNE',
'matplotlib>=2.2.2',
'seaborn>=0.8.1',
'tzlocal',
Expand Down
5 changes: 2 additions & 3 deletions src/palantir/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pandas as pd
import numpy as np
import bhtsne
from MulticoreTSNE import MulticoreTSNE as TSNE
import phenograph

from sklearn.decomposition import PCA
Expand Down Expand Up @@ -129,8 +129,7 @@ def run_tsne(data, n_dim=2, perplexity=150, **kwargs):
:param n_dim: Number of dimensions for tSNE embedding
:return: tSNE embedding of the data
"""
tsne = bhtsne.tsne(data.values.astype(float),
dimensions=n_dim, perplexity=perplexity, **kwargs)
tsne = TSNE(n_components=n_dim, perplexity=perplexity, **kwargs).fit_transform(data.values)
tsne = pd.DataFrame(tsne, index=data.index)
tsne.columns = ['x', 'y']
return tsne
Expand Down

0 comments on commit ae0bdc0

Please sign in to comment.