Comments (6)
mmm that's a good one. Could you open the file setup.py
and check if you have some unrecognized characters.
Check also which encoding are you using:
from imbalanced-learn.
Interesting.
OK, I forced the encoding as follows, just in the open (as suggested in the link):
with open(os.path.join('imblearn', 'version.py'), encoding='utf-8-sig') as fp:
exec(fp.read(), globals_dict)
and voila, it works.
Weirdly though, in my PyCharm IDE, in the right-bottom corner, it says "UTF-8", which I'm assuming is the encoding for the context, but it seems the Win current encoding was still somehow overriding that.
I also used a "chchp" command in Win cmd, and it displayed "437", which is apparently a "US encoding"
I don't know a lot, but the above might give you insight to change the code to avoid this bug on other Win systems.
Cheers
from imbalanced-learn.
I got the same bug with Appveyor so I will investigate a bit more.
Thanks for the solution.
from imbalanced-learn.
So actually there is a need for
# *- encoding: utf-8 -*-
in version.py
to enforce the encoding. open
function do not allow encoding argument in Python 2.
This is a Windows thing probably, I don't know to much about these stuff.
from imbalanced-learn.
I tested that for you and it made no difference, exact same problem.
But found this:
[http://stackoverflow.com/questions/10971033/backporting-python-3-openencoding-utf-8-to-python-2]
So, the following worked and apparently will do on Python 2 as well:
import codecs
with codecs.open(os.path.join('imblearn', 'version.py'), encoding='utf-8-sig') as fp:
exec(fp.read(), globals_dict)
from imbalanced-learn.
thanks
from imbalanced-learn.
Related Issues (20)
- KMeansSMOTE balance_threshold formula HOT 2
- Add mypy stuff HOT 1
- Columns and DataType Not Explicitly Set on line 55 of _validation.py HOT 1
- [BUG] `_transform_one` fails on sparse DataFrame
- [BUG] RandomOversampler crashes on timedelta64 column that only contains NaTs
- [BUG] `BorderlineSMOTE` takes an unusually long amount of time in later versions of scikit-learn HOT 5
- Compatibility with scikit-learn 1.4.0 HOT 3
- [BUG] `sklearn=1.4` TypeError: BaggingClassifier.__init__() got an unexpected keyword argument 'base_estimator'
- [BUG] Attribute Error: Pipeline object has no attribute "_check_fit_params" HOT 1
- [BUG] Test issues with sklearn 1.4 HOT 3
- [SO] SMOTEEN generates imbalance dataset HOT 2
- AttributeError: 'NoneType' object has no attribute 'split' HOT 3
- [BUG]sampling_strategy working incorrectly with random oversampling HOT 2
- SmoteNC leads to Killed process HOT 2
- [BUG] ImportError: cannot import name '_check_X' from 'imblearn.utils._validation' (/usr/local/lib/python3.10/dist-packages/imblearn/utils/_validation.py) HOT 2
- fix scikit-learn 1.5 parse_version link HOT 1
- Python 3.13: Two tests from test_docstring.py are failing HOT 2
- New error message from established workflow: AttributeError: 'Pipeline' object has no attribute '_check_fit_params'[BUG] HOT 7
- how can the tool be used with DASK-ML to deal with large data HOT 1
- [BUG] ImportError: cannot import name '_get_column_indices' from 'sklearn.utils with pre-release versions HOT 1
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 imbalanced-learn.