Comments (7)
Can you provide a bit more background on this issue such as function used, parameters, dataset, .. ?
from boruta_py.
OK. I got myself that same error message. My understanding is that it is numpy
sending a warning while doing comparisons with NaN
. Looking at the code in boruta_py.py
, this suggests that due to your data and/or your parameters, no feature is better than than the best shadow.
Can you confirm that the attribute n_features_
of your Boruta object returned 0?
from boruta_py.
Dear all,
I get the same warning using this simple script (synthetic data from sklearn)
`from sklearn.ensemble import RandomForestClassifier, RandomForestRegressor
from sklearn.datasets import make_regression
from boruta import BorutaPy
Xdum, ydum = make_regression(n_samples = 100, n_features=50,
n_informative=10, bias = 150.0,
noise = 30, random_state=0)
rf = RandomForestRegressor(n_jobs=-1, max_depth=10)
feat_selector = BorutaPy(rf, n_estimators=1000, perc=100, max_iter=20, verbose=2)
feat_selector.fit(Xdum,ydum)`
Please note that I set n_informative to 10 and at the end Boruta finds indeed 7 relevant features: feat_selector.n_features_ returns 7. The problem appears also with max_iter=100.
I'm using sklearn 0.19.1 and numpy 1.13.3
from boruta_py.
Note that the higher max_iter, the more likely you get this error message.
BTW I fixed the problem. Please see my pull request. Your snippet code runs with no warning message applying this small code change.
from boruta_py.
Thanks a lot!
from boruta_py.
Thanks @tagomatech ,accepted the PR.
from boruta_py.
Please re-open this issue, as the proposed (and implemented) solution introduces an error:
The moment NaNs are encountered, this solution behaves in the following way:
(The array printed out is hits right after the assignment in question):
Note: I am working with the Madalon example notebook in the package.
Referred to as code variant A:
[ 28 48 64 105 128 153 204 241 281 318 336 338 378 433 442 451 453 472
475 493]
Iteration: 7 / 100
Confirmed: 0
Tentative: 499
Rejected: 0
[ 28 48 64 105 128 153 241 281 318 336 338 378 433 442 451 453 472 475
493]
Iteration: 8 / 100
Confirmed: 0
Tentative: 21
Rejected: 478
[ 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
Iteration: 9 / 100
Confirmed: 0
Tentative: 21
Rejected: 478
[ 0 1 2 3 4 5 7 8 9 10 11 12 13 14 15 16 17 18 19 20]
Iteration: 10 / 100
Confirmed: 0
Tentative: 21
Rejected: 478
Instead of using the actual features, it uses the n first not rejected features.
For contrast, same pipeline, only using the replaced code:
Referred to as code variant B:
[ 28 48 64 105 128 153 204 241 281 318 336 338 378 433 442 451 453 472
475 493]
Iteration: 7 / 100
Confirmed: 0
Tentative: 499
Rejected: 0
[ 28 48 64 105 128 153 241 281 318 336 338 378 433 442 451 453 472 475
493]
Iteration: 8 / 100
Confirmed: 0
Tentative: 21
Rejected: 478
print(hits)
[ 28 48 64 105 128 153 204 241 281 318 336 338 378 433 442 451 453 455
472 475 493]
Iteration: 9 / 100
Confirmed: 19
Tentative: 2
Rejected: 478
~~~/boruta_py.py:421: RuntimeWarning: invalid value encountered in greater
print(hits)
[ 28 48 64 105 128 153 241 281 318 336 338 378 433 442 451 453 455 472
475 493]
Iteration: 10 / 100
Confirmed: 19
Tentative: 2
Rejected: 478
Line number is off, as I have both code snippets in the file.
The results of both runs are significantly different:
Variant A terminates repeatable after 34 iterations, results vary between 1 or 2 accepted and remainder rejected features.
Variant B terminates after 100 iterations with 21 accepted and 1 or 2 tentative features.
from boruta_py.
Related Issues (20)
- Numpy types aliases deprecated (`np.int`, `np.bool` and `np.float`)
- why estimators num is calculated by feature num in this way?
- max_iter values HOT 3
- ImportError: cannot import name 'BorutaPy' from 'boruta' HOT 1
- PKG for the survival analysis HOT 6
- Can I somehow speed the Borutapy process HOT 2
- Version update of Boruta on pypi? HOT 5
- What percentage of shadow features does each real feature outperform?
- AttributeError: module 'numpy' has no attribute 'int'. HOT 9
- Possible problems in installation HOT 1
- TypeError: BorutaPy.__init__() got an unexpected keyword argument 'early_stopping' HOT 1
- Kaggle n_estimators issue with DecisionTreeClassifier HOT 2
- Error when using BorutaPy with LogisticRegression
- AttributeError: module 'numpy' has no attribute 'bool' when using BorutaPy with RandomForestClassifier HOT 3
- BorutaPy selects different features in different iterations HOT 1
- AttributeError: module 'numpy' has no attribute 'int'. `np.int` was a deprecated alias for the builtin `int`. HOT 13
- Does boruta apply to time series data? HOT 1
- New release HOT 1
- Why does the number of total features (Confirmed + Tentative + Rejected) not equal to the input features?
- Does BorutaPy work with cuML RandomForestClassifier? HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from boruta_py.