You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run some preprocessing on my data the line triggering the error is:
C:\local_tools\Anaconda3\envs\mother_env\lib\site-packages\sklearn\feature_extraction\_dict_vectorizer.py in _transform(self, X, fitting)
226 indices=indices, values=values)
227
--> 228 if feature_name is not None:
229 if fitting and feature_name not in vocab:
230 vocab[feature_name] = len(feature_names)
UnboundLocalError: local variable 'feature_name' referenced before assignment
Steps/Code to Reproduce
It involves a bit too much preprocessing to put here but from inspecting the respective source file (see above, sklearn\feature_extraction_dict_vectorizer.py) I have the strong suspicion that feature_name can go through all if/elif checks without being assigned anything.
Describe the bug
When I run some preprocessing on my data the line triggering the error is:
Steps/Code to Reproduce
It involves a bit too much preprocessing to put here but from inspecting the respective source file (see above, sklearn\feature_extraction_dict_vectorizer.py) I have the strong suspicion that
feature_name
can go through all if/elif checks without being assigned anything.Versions
System:
python: 3.8.5 (default, Sep 3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)]
executable: C:\local_tools\Anaconda3\envs\mother_env\python.exe
machine: Windows-10-10.0.18362-SP0
Python dependencies:
pip: 20.3.3
setuptools: 52.0.0.post20210125
sklearn: 0.24.1
numpy: 1.19.2
scipy: 1.6.0
Cython: None
pandas: 1.2.1
matplotlib: 3.3.4
joblib: 1.0.1
threadpoolctl: 2.1.0
Built with OpenMP: True
The text was updated successfully, but these errors were encountered: