Undo the scaling of X according to feature_range. Parameters ---------- X : array-like of shape (n_samples, n_features) Input data that will be transformed. It cannot be sparse. Returns ------- X_original : ndarray of shape (n_samples, n_
(self, X)
| 586 | return X |
| 587 | |
| 588 | def inverse_transform(self, X): |
| 589 | """Undo the scaling of X according to feature_range. |
| 590 | |
| 591 | Parameters |
| 592 | ---------- |
| 593 | X : array-like of shape (n_samples, n_features) |
| 594 | Input data that will be transformed. It cannot be sparse. |
| 595 | |
| 596 | Returns |
| 597 | ------- |
| 598 | X_original : ndarray of shape (n_samples, n_features) |
| 599 | Transformed data. |
| 600 | """ |
| 601 | check_is_fitted(self) |
| 602 | |
| 603 | xp, _ = get_namespace(X) |
| 604 | |
| 605 | X = check_array( |
| 606 | X, |
| 607 | copy=self.copy, |
| 608 | dtype=_array_api.supported_float_dtypes(xp, device=device(X)), |
| 609 | force_writeable=True, |
| 610 | ensure_all_finite="allow-nan", |
| 611 | ) |
| 612 | |
| 613 | X -= self.min_ |
| 614 | X /= self.scale_ |
| 615 | return X |
| 616 | |
| 617 | def __sklearn_tags__(self): |
| 618 | tags = super().__sklearn_tags__() |