@@ -99,12 +99,12 @@ class ImprovedPCA(skl_decomposition.PCA):
99
99
# pylint: disable=too-many-branches
100
100
def _fit (self , X ):
101
101
"""Dispatch to the right submethod depending on the chosen solver."""
102
- X = check_array (
102
+ X = self . _validate_data (
103
103
X ,
104
- accept_sparse = ["csr" , "csc" ],
105
104
dtype = [np .float64 , np .float32 ],
106
- ensure_2d = True ,
107
- copy = self .copy ,
105
+ reset = False ,
106
+ accept_sparse = ["csr" , "csc" ],
107
+ copy = self .copy
108
108
)
109
109
110
110
# Handle n_components==None
@@ -201,7 +201,7 @@ def _fit_truncated(self, X, n_components, svd_solver):
201
201
random_state = random_state ,
202
202
)
203
203
204
- self .n_samples_ , self . n_features_ = n_samples , n_features
204
+ self .n_samples_ = n_samples
205
205
self .components_ = V
206
206
self .n_components_ = n_components
207
207
@@ -221,12 +221,12 @@ def _fit_truncated(self, X, n_components, svd_solver):
221
221
def transform (self , X ):
222
222
check_is_fitted (self , ["mean_" , "components_" ], all_or_any = all )
223
223
224
- X = check_array (
224
+ X = self . _validate_data (
225
225
X ,
226
226
accept_sparse = ["csr" , "csc" ],
227
227
dtype = [np .float64 , np .float32 ],
228
- ensure_2d = True ,
229
- copy = self .copy ,
228
+ reset = False ,
229
+ copy = self .copy
230
230
)
231
231
232
232
if self .mean_ is not None :
0 commit comments