Skip to content

Commit

Permalink
Make imbalanced-learn optional
Browse files Browse the repository at this point in the history
  • Loading branch information
lixfz committed Feb 18, 2024
1 parent aa44d23 commit 171c549
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hypergbm/hyper_gbm.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
from imblearn.over_sampling import RandomOverSampler, SMOTE, ADASYN
from imblearn.under_sampling import RandomUnderSampler, NearMiss, TomekLinks, EditedNearestNeighbours

imblearn_istalled = True
imblearn_installed = True
except:
logger.warning('Failed to load imbalanced-learn', exc_info=sys.exc_info())
imblearn_istalled = False
imblearn_installed = False


def get_sampler(sampler):
if imblearn_istalled:
if imblearn_installed:
samplers = {'RandomOverSampler': RandomOverSampler,
'SMOTE': SMOTE,
'ADASYN': ADASYN,
Expand Down

0 comments on commit 171c549

Please sign in to comment.