吳裕雄 python 機器學習——數據預處理過濾式特征選取VarianceThreshold模型


from sklearn.feature_selection import  VarianceThreshold

#數據預處理過濾式特征選取VarianceThreshold模型
def test_VarianceThreshold():
    X=[[100,1,2,3],
       [100,4,5,6],
       [100,7,8,9],
       [101,11,12,13]]
    selector=VarianceThreshold(1)
    selector.fit(X)
    print("Variances is %s"%selector.variances_)
    print("After transform is %s"%selector.transform(X))
    print("The surport is %s"%selector.get_support(True))
    print("After reverse transform is %s"%selector.inverse_transform(selector.transform(X)))
    
#調用test_VarianceThreshold()
test_VarianceThreshold()

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM