scikit-learn seems to work, but when I did:
from sklearn.feature_selection import VarianceThreshold
I got the following error:
ImportError: cannot import name VarianceThreshold
How to bypass this? I am a newbie in Python, so I have no idea what to do.
I played with the order of my imports, as suggested here: ImportError: Cannot import name X, but no luck.
import sys
import pandas as pd
import numpy as np
import operator
from sklearn.feature_selection import VarianceThreshold
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.feature_extraction.text import HashingVectorizer
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.preprocessing import normalize
from sklearn import decomposition
I am also getting this:
code/python/k_means/serial_version$ python -c 'import sklearn; print(sklearn.VarianceThreshold)'
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'VarianceThreshold'
Version:
>>> import sklearn
>>> sklearn.__version__
'0.14.1'