From a7a3c7e6df457b722de86d7254f8a7724b27978f Mon Sep 17 00:00:00 2001 From: Jesse Leigh Patsolic Date: Tue, 3 Dec 2019 13:21:58 -0500 Subject: [PATCH] update max_features to accept a fraction > 1.0 (#340) * update max_features to accept a fraction > 1.0 * put inequality in easier to read form. --- Python/rerf/rerfClassifier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/rerf/rerfClassifier.py b/Python/rerf/rerfClassifier.py index 2c403a29..362cb610 100644 --- a/Python/rerf/rerfClassifier.py +++ b/Python/rerf/rerfClassifier.py @@ -317,7 +317,7 @@ def fit(self, X, y): self.mtry_ = int(np.log2(num_features)) elif isinstance(self.max_features, int): self.mtry_ = self.max_features - elif isinstance(self.max_features, float) and 0 <= self.max_features <= 1: + elif isinstance(self.max_features, float) and self.max_features > 0: self.mtry_ = int(self.max_features * num_features) else: raise ValueError("max_features has unexpected value")