• 欢迎光临~

sklearn选择方差大于指定数的特征

开发技术 开发技术 2022-12-09 次浏览
from sqlite3 import Row
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import stats
from sklearn.feature_selection import VarianceThreshold
train_data='zhengqi_train.txt'
test_data='zhengqi_test.txt'
train=pd.read_csv(train_data,sep='t',encoding='utf-8')
test=pd.read_csv(test_data,sep='t',encoding='utf-8')
train=train.drop(['V5','V9','V11','V17','V22','V28'],axis=1)
print(VarianceThreshold(threshold=0.1).fit_transform(train) )
程序员灯塔
转载请注明原文链接:sklearn选择方差大于指定数的特征
喜欢 (0)