|
22 | 22 | from .covariance import ledoit_wolf, empirical_covariance, shrunk_covariance
|
23 | 23 | from .utils.multiclass import unique_labels
|
24 | 24 | from .utils import check_array, check_X_y
|
25 |
| -from .utils.validation import check_is_fitted |
| 25 | +from .utils.validation import check_is_fitted, FLOAT_DTYPES |
26 | 26 | from .utils.multiclass import check_classification_targets
|
27 | 27 | from .preprocessing import StandardScaler
|
28 | 28 |
|
@@ -484,7 +484,7 @@ def transform(self, X):
|
484 | 484 | "solver (use 'svd' or 'eigen').")
|
485 | 485 | check_is_fitted(self, ['xbar_', 'scalings_'], all_or_any=any)
|
486 | 486 |
|
487 |
| - X = check_array(X) |
| 487 | + X = check_array(X, dtype=FLOAT_DTYPES) |
488 | 488 | if self.solver == 'svd':
|
489 | 489 | X_new = np.dot(X - self.xbar_, self.scalings_)
|
490 | 490 | elif self.solver == 'eigen':
|
@@ -698,7 +698,7 @@ def fit(self, X, y):
|
698 | 698 | def _decision_function(self, X):
|
699 | 699 | check_is_fitted(self, 'classes_')
|
700 | 700 |
|
701 |
| - X = check_array(X) |
| 701 | + X = check_array(X, dtype=FLOAT_DTYPES) |
702 | 702 | norm2 = []
|
703 | 703 | for i in range(len(self.classes_)):
|
704 | 704 | R = self.rotations_[i]
|
|
0 commit comments