Skip to content

TSNE has no fit #4133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amueller opened this issue Jan 20, 2015 · 6 comments
Closed

TSNE has no fit #4133

amueller opened this issue Jan 20, 2015 · 6 comments
Labels

Comments

@amueller
Copy link
Member

The TSNE class has no fit method. This issue is basically asking whether this is ok.
I thought having a fit was an API requirement.
Other manifold methods store the result of fit_transform in a member and simply return self in fit.

@amueller amueller added the API label Jan 20, 2015
@GaelVaroquaux
Copy link
Member

The TSNE class has no fit method. This issue is basically asking whether this
is ok.

IMHO no: we are breaking the API contract here.

@8evers
Copy link

8evers commented Jan 27, 2015

I was wondering about this too there is no way to put new data through the existing model ie transform / predict. So although I can create very nice clusters with T-SNE, I cannot use the model to embed new data and use those values for prediction.

Looking in more depth at the algorithm and code it may not be possible to embed new values with an existing model. Could someone confirm??

@jnothman
Copy link
Member

It's not intended to be inductive, i.e. generalise to new samples. But
other estimators in scikit-learn that are similarly transductive still
support fit.

On 27 January 2015 at 15:13, 8evers notifications@github.com wrote:

I was wondering about this too there is no way to put new data through
the existing model ie transform / predict. So although I can create very
nice clusters with T-SNE, I cannot use the model to embed new data and use
those values for prediction.

Looking in more depth at the algorithm and code it may not be possible to
embed new values with an existing model. Could someone confirm??


Reply to this email directly or view it on GitHub
#4133 (comment)
.

@GaelVaroquaux
Copy link
Member

It's not intended to be inductive, i.e. generalise to new samples.

I thought that the new Barn-Hut solver could to that.

@ogrisel
Copy link
Member

ogrisel commented Feb 5, 2015

I confirm that this is fixed in #4025 that is still under review (I plan on finishing my pass on the code that today).

The semantics of fit_transform(X) are not equivalent to fit(X) then transform(X) for that class but this is a mathematical limitation of the model. As long that it's properly documented in the docstrings it's fine with me.

@amueller
Copy link
Member Author

Fixed by #4136, will get a even more of a fix in #4025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants