Skip to content

Commit

Permalink
update max_features to accept a fraction > 1.0 (#340)
Browse files Browse the repository at this point in the history
* update max_features to accept a fraction > 1.0

* put inequality in easier to read form.
  • Loading branch information
MrAE authored Dec 3, 2019
1 parent 7c4cff4 commit a7a3c7e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/rerf/rerfClassifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit a7a3c7e

Please sign in to comment.