Skip to content

Instantly share code, notes, and snippets.

@Ayushijain09
Created July 13, 2020 18:28
Show Gist options
  • Save Ayushijain09/81c0eaf79672887363540f4ef2a8205a to your computer and use it in GitHub Desktop.
Save Ayushijain09/81c0eaf79672887363540f4ef2a8205a to your computer and use it in GitHub Desktop.
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
X_train = X_train.astype(int)
chi2_features = SelectKBest(chi2 , k=12)
X_kbest_features = chi2_features.fit_transform(X_train, y_train)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment