Skip to content

Commit

Permalink
default tsne
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulaKramer committed Nov 12, 2024
1 parent fe806fb commit d84df6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions kinfraglib/filters/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,18 @@ def debug_tsne(fragment_library):
pca = PCA(n_components=50)
crds = pca.fit_transform(list(fragment_library_concat["maccs"]))

# crds_embedded = TSNE(
# n_components=2, init="pca", learning_rate="auto"
# ).fit_transform(crds)
crds_embedded = TSNE(
n_components=2, init="pca", learning_rate="auto"
).fit_transform(crds)


def debug_tsne_v2():
import numpy as np

X = np.array([[0, 0, 0], [0, 1, 1], [1, 0, 1], [1, 1, 1]])
X_embedded = TSNE(
n_components=2, learning_rate="auto", init="random", perplexity=3
).fit_transform(X)


def create_tsne_plots(fragment_library):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,8 @@
"metadata": {},
"outputs": [],
"source": [
"filters.plots.debug_tsne(fragment_library)"
"#filters.plots.debug_tsne(fragment_library)\n",
"filters.plots.debug_tsne_v2()"
]
},
{
Expand Down

0 comments on commit d84df6e

Please sign in to comment.