initial coordinates are exported as `NaN` or throws an error
jlmelville opened this issue · 1 comments
jlmelville commented
First, thanks for your work on this package and technique and making it available for others to study and experiment with.
The following example (using return_seq=True
) raises a ValueError
for me:
import trimap
from sklearn.datasets import load_digits
digits = load_digits()
embedding = trimap.TRIMAP(return_seq=True).fit_transform(digits.data, init="pca")
Omitting the init
argument and letting it be the default None
, allows the computation to finish, but the initial coordinates are exported as nan
:
embedding = trimap.TRIMAP(return_seq=True).fit_transform(digits.data)
embedding[:, :, 0]
array([[nan, nan],
[nan, nan],
[nan, nan],
...,
[nan, nan],
[nan, nan],
[nan, nan]])
I think the following:
Line 591 in a7250f3
should be:
Y_all[:, :, 0] = Y
as Y_init
may hold a string like "random"
(which causes the ValueError
) or None
(hence the nan
s).
Happy to provide a PR for this if needed.
eamid commented
Thank you for catching this! Happy to merge the fix if you could send a PR :)