Project the data by using matrix product with the random matrix. Parameters ---------- X : {ndarray, sparse matrix} of shape (n_samples, n_features) The input data to project into a smaller dimensional space. Returns ------- X_new : {ndar
(self, X)
| 800 | ) |
| 801 | |
| 802 | def transform(self, X): |
| 803 | """Project the data by using matrix product with the random matrix. |
| 804 | |
| 805 | Parameters |
| 806 | ---------- |
| 807 | X : {ndarray, sparse matrix} of shape (n_samples, n_features) |
| 808 | The input data to project into a smaller dimensional space. |
| 809 | |
| 810 | Returns |
| 811 | ------- |
| 812 | X_new : {ndarray, sparse matrix} of shape (n_samples, n_components) |
| 813 | Projected array. It is a sparse matrix only when the input is sparse and |
| 814 | `dense_output = False`. |
| 815 | """ |
| 816 | check_is_fitted(self) |
| 817 | X = validate_data( |
| 818 | self, |
| 819 | X, |
| 820 | accept_sparse=["csr", "csc"], |
| 821 | reset=False, |
| 822 | dtype=[np.float64, np.float32], |
| 823 | ) |
| 824 | |
| 825 | return _align_api_if_sparse( |
| 826 | safe_sparse_dot(X, self.components_.T, dense_output=self.dense_output) |
| 827 | ) |
nothing calls this directly
no test coverage detected