我正在使用iris
scikit - learn函数load_iris()
和.sklearn.datasets
normalize
VarianceThreshold
似乎如果我正在使用MinMaxScaler
然后运行VarianceThreshold
- 就没有任何功能了。
缩放前:
Column: sepal length (cm) Mean: 5.843333333333334 var = 0.6811222222222223 var/mean: 0.11656398554858338
Column: sepal width (cm) Mean: 3.0573333333333337 var = 0.1887128888888889 var/mean: 0.06172466928332606
Column: petal length (cm) Mean: 3.7580000000000005 var = 3.0955026666666665 var/mean: 0.8237101295015078
Column: petal width (cm) Mean: 1.1993333333333336 var = 0.5771328888888888 var/mean: 0.48121141374837856
缩放后 ( MinMaxScaler
)
Column: sepal length (cm) Mean: 0.42870370370370364 var = 0.052555727023319614 var/mean: 0.12259219262459005
Column: sepal width (cm) Mean: 0.44055555555555553 var = 0.03276265432098764 var/mean: 0.07436668067815606
Column: petal length (cm) Mean: 0.46745762711864397 var = 0.08892567269941587 var/mean: 0.19023258481745967
Column: petal width (cm) Mean: 0.4580555555555556 var = 0.10019668209876545 var/mean: 0.2187435145879658
我VarianceThreshold
用作:
from sklearn.feature_selection import VarianceThreshold
sel = VarianceThreshold(threshold=(.8 * (1 - .8)))
MinMaxScaler
如果我们想删除低方差的特征,我们是否应该缩放数据(例如,通过)?