Add inverse_transform() to random projection classes
See original GitHub issueDescribe 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?
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
6.6. Random Projection — scikit-learn 1.2.0 documentation
When the inverse_transform method is called, it computes the product of the input X and the transpose of the inverse components. If the...
Read more >Source code for scprep.reduce - Read the Docs
[docs]class InvertibleRandomProjection(random_projection.GaussianRandomProjection): """Gaussian random projection with an inverse transform using the ...
Read more >Random projections
Random projections are a useful tool in the analysis and processing of high-dimensional data. We will analyze two applications that use random ...
Read more >Linear Discriminant Analysis inverse transform - Stack Overflow
I try to use Linear Discriminant Analysis from scikit-learn library, in order to perform dimensionality reduction on my data which has more than ......
Read more >Random Projections and Dimension Reduction - arXiv
One solution to these problems is the use of random projections. Instead of ... given by the inverse Fourier transform of k. For...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
true, you could open a PR with that approach.
Done. I named the parameter
fit_inverse_transform
, like inKernelPCA
. I also named the learned pseudo-inverse of the componentscomponents_pinv_
, for lack of a better idea. I propose to continue the discussion in the PR.