feature selection python
from sklearn.feature_selection import VarianceThreshold
sel = VarianceThreshold(threshold=(.05))
X = sel.fit_transform(X)
feature selection python
from sklearn.feature_selection import VarianceThreshold
sel = VarianceThreshold(threshold=(.05))
X = sel.fit_transform(X)
how to feature selection in python
>>> from sklearn.datasets import load_iris
>>> from sklearn.feature_selection import SelectKBest
>>> from sklearn.feature_selection import chi2
>>> X, y = load_iris(return_X_y=True)
>>> X.shape
(150, 4)
>>> X_new = SelectKBest(chi2, k=2).fit_transform(X, y)
>>> X_new.shape
(150, 2)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us