Skip to content

Commit

Permalink
Added ISOMAP embedding.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lanny committed Dec 11, 2019
1 parent 0781fd2 commit e5df789
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 7 additions & 1 deletion cspace/jobs/compute_facet.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,18 @@ def embedf(dist_mat):
return embedding

return embedf
if job.embedding == '3/TSNE':
elif job.embedding == '3/TSNE':
TSNE = manifold.TSNE(
n_components=3,
metric='precomputed'
)
return lambda d: TSNE.fit(np.array(d)).embedding_
elif job.embedding == '3/ISOMAP':
Isomap = manifold.Isomap(
n_components=3,
metric='precomputed'
)
return lambda d: Isomap.fit(np.array(d)).embedding_
else:
raise Exception('Unknown embedding: %s' % job.embedding)

Expand Down
1 change: 1 addition & 0 deletions cspace/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
('3/RDK/SMACOF', '3/RDKit/SMACOF Multidimensional Scaling'),
('3/RDK/NM-SMACOF', '3/RDKit/Non-Metric SMACOF Multidimensional Scaling'),
('3/TSNE', '3/TSNE'),
('3/ISOMAP', '3/ISOMAP'),
)

class ChemicalTag(models.Model):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ Django==2.2.6
numpy==1.17.3
pytz==2019.3
sqlparse==0.3.0
sklearn==0.0
scikit-learn==0.22

0 comments on commit e5df789

Please sign in to comment.