Last active
July 13, 2020 19:00
-
-
Save Ayushijain09/c9b1acf5a6a3b17261969f93df90b65a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn.feature_selection import VarianceThreshold | |
print(df_train.shape) #output (143, 59) | |
var_filter = VarianceThreshold(threshold = 0.0) | |
train = var_filter.fit_transform(df_train) | |
#to get the count of features that are not constant | |
print(train.shape()) # output (143, 56) | |
#or | |
print(len(df_train.columns[var_filter.get_support()])) #output 56 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment