From b76711727586a51aadc335aad378f4c52873cdb8 Mon Sep 17 00:00:00 2001 From: Tim Head Date: Mon, 9 Nov 2015 16:02:53 +0100 Subject: [PATCH] Use six to detect integral numbers --- sklearn/ensemble/iforest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn/ensemble/iforest.py b/sklearn/ensemble/iforest.py index 08e64ccfba8bc..5b803f16fb34a 100644 --- a/sklearn/ensemble/iforest.py +++ b/sklearn/ensemble/iforest.py @@ -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 " @@ -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: