Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add inverse_transform() to random projection classes #21687

Closed
@ageron

Description

@ageron

Describe the workflow you want to enable

GaussianRandomProjection and SparseRandomProjection should have an inverse_transform() method.

Describe your proposed solution

Simply add the inverse_transform() method, with the appropriate input validation and tests, and return X @ np.linalg.pinv(self.components_.T).

Describe alternatives you've considered, if relevant

N/A

Additional context

My understanding is that every transformer that performs a reversible transformation should have an inverse_transform() method, unless there's a really good reason not to (e.g., if it's terribly inefficient, or there's a better alternative). Was the inverse_transform() left out because it's too inefficient?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions