Skip to content

Commit

Permalink
Use six to detect integral numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
betatim committed Nov 9, 2015
1 parent 6f6ec7f commit b767117
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sklearn/ensemble/iforest.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ def fit(self, X, y=None, sample_weight=None):
'Valid choices are: "auto", int or'
'float' % self.max_samples)

elif isinstance(self.max_samples, (numbers.Integral, np.integer)):
elif isinstance(self.max_samples, six.integer_types):
if self.max_samples > n_samples:
warn("max_samples (%s) is greater than the "
"total number of samples (%s). max_samples "
Expand Down Expand Up @@ -263,7 +263,7 @@ def _average_path_length(n_samples_leaf):
average_path_length : array, same shape as n_samples_leaf
"""
if isinstance(n_samples_leaf, int):
if isinstance(n_samples_leaf, six.integer_types):
if n_samples_leaf <= 1:
return 1.
else:
Expand Down

0 comments on commit b767117

Please sign in to comment.