-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent a ValueError if the input variable has constant value #33
Conversation
@jmmcd mind taking a look? |
The previous PR did not properly handle magnitudes far away from 1. This revised version dynamically sets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
It just seems a bit convoluted and arbitrary. And most important, none of the bases we create on this variable will be useful, no matter what hack we try!
So how about at line 654, we calculate minx and maxx, and if minx == maxx
, then we just continue
, ie don't create any bases for this variable?
…ust continue. See natekupp#33.
* Bump version number for PyPI release, and include Py3.6 as supported. * Update push_to_pypi to use twine. * Update runffx tool for Python 3 * Added a Scikit-learn API, bumped FFX version number and Python/Sklearn numbers. * Squeeze an unused dimension in y. Move a comment in api. Add a commented line for pushing to test-PyPI. * Bump version number again and remember to rm old versions when uploading to PyPI. * Corrected the count of GP nodes (complexity) and used it in existing test, also added the code from the README as a test. * Bump version number for PyPI * Fix special case for thresholds when x var has no variance. * Change _model to model_ and same for _models to conform to sklearn Estimator API. Add FFXModel.predict as alias of FFXModel.simulate so individual models can be used in pseudo-sklearn model.predict(X) style. * Instead of hacking thresholds for case where x var has no variance, just continue. See #33. * Make FFXModel and ConstantModel into sklearn Regressors and add predict to the latter also, and add a test of all this.
closing this as stale, but please re-open if this is still an issue |
Currently, input variables with a constant value will abort with
ValueError: arange: cannot compute length
, due tonumpy.arange()
cannot handling ranges with zero length. This modification adjusts the range min/max such there is a small offset.