Skip to content

Commit

Permalink
change isinstance check for SVM estimator to simply clone the estimat…
Browse files Browse the repository at this point in the history
…or - similar to _validate_estimator() in KMeansSMOTE
  • Loading branch information
sft-managed authored and sft-managed committed Sep 10, 2021
1 parent e997e23 commit 94b0725
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions imblearn/over_sampling/_smote/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,8 @@ def _validate_estimator(self):

if self.svm_estimator is None:
self.svm_estimator_ = SVC(gamma="scale", random_state=self.random_state)
elif isinstance(self.svm_estimator, SVC):
self.svm_estimator_ = clone(self.svm_estimator)
else:
raise_isinstance_error("svm_estimator", [SVC], self.svm_estimator)
self.svm_estimator_ = clone(self.svm_estimator)

def _fit_resample(self, X, y):
self._validate_estimator()
Expand Down

0 comments on commit 94b0725

Please sign in to comment.