Skip to content

Manifold learners are not transformers #2887

Closed

Description

@larsmans

MDS and SpectralEmbedding are not transformers: they have fit_transform, but no transform. Of these, SpectralEmbedding inherits from TransformerMixin without good cause. Either it should be removed or the class should get a transform method.

Ping @GaelVaroquaux, @kuantkid, @NelleV.

Activity

  1. arjoly commented on Feb 24, 2014

    @arjoly
    Member

    I bump into this issue today when I wanted to make a pipeline with a spectral embedding.

  2. satra commented on Feb 24, 2014

    @satra
    Member

    same here - i think it would be good to add a transform method to these. they should act no differently from PCA imo.
    [noise here - see below]

  3. jmmcd commented on Feb 24, 2014

    @jmmcd
    Contributor

    This issue comes from my (initially confused) question on Stackoverflow. It would be great to be able to project unseen points into the MDS space, but after thinking about it, I don't think the MDS algorithm can actually do this! Can it? I think it iteratively "moves points around" in the projected space. It doesn't actually represent the transformation.

    I suppose there is a possibility to hack it by find a few nearest neighbours of the unseen point in the original space, and sending it to a weighted average of their transforms or something like that. But there would be no justification in MDS theory for that, I think.

  4. satra commented on Feb 24, 2014

    @satra
    Member

    i see where this is coming from now. indeed for many of these operators one can create a transform for the input data set, but it's not possible to apply that transformation to a different dataset.

    so i take back what i said earlier about adding the transform bit - i was indeed thinking the fit_transform process, which they already have.

  5. GaelVaroquaux commented on Feb 25, 2014

    @GaelVaroquaux
    Member

    same here - i think it would be good to add a transform method to these. they
    should act no differently from PCA imo.

    But what is the algorithm to transform on new data? I am not sure that I
    know of it.

  6. GaelVaroquaux commented on Feb 25, 2014

    @GaelVaroquaux
    Member

    MDS and SpectralEmbedding are not transformers: they have
    fit_transform, but no transform. Of these, SpectralEmbedding inherits
    from TransformerMixin without good cause. Either it should be removed
    or the class should get a transform method.

    Unless we can come up with a principled algorithm to transform new data,
    I completely agree with you: SpectralEmbedding should not inherit from
    TransformerMixin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions