Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiebergman committed Nov 15, 2022
1 parent bf477f1 commit f9e517a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ def fit(self, X, Y=None):
with warnings.catch_warnings():
warnings.filterwarnings("error")
self.preprocessor.fit(X)
# Raise an informative error message, equation is based ~line 249 in
# kernel_pca.py in scikit-learn
if len(self.preprocessor.alphas_ / self.preprocessor.lambdas_) == 0:

if self.preprocessor._n_features_out == 0:
raise ValueError("KernelPCA removed all features!")

return self

def transform(self, X):
Expand Down

0 comments on commit f9e517a

Please sign in to comment.