Skip to content

Commit

Permalink
Ensure random_state is not passed to deterministic classifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Nov 24, 2015
1 parent bc61e5d commit 32a80b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gala/classify.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ def get_classifier(name='random forest', *args, **kwargs):
return DefaultRandomForest(*args, **kwargs)
elif is_naive_bayes:
from sklearn.naive_bayes import GaussianNB
if 'random_state' in kwargs:
del kwargs['random_state']
return GaussianNB(*args, **kwargs)
else:
raise NotImplementedError('Classifier "%s" is either not installed '
Expand Down

0 comments on commit 32a80b5

Please sign in to comment.