Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

how to do forward feature selection in python

#importing the necessary libraries
from mlxtend.feature_selection import SequentialFeatureSelector as SFS
from sklearn.linear_model import LinearRegression
# Sequential Forward Selection(sfs)
sfs = SFS(LinearRegression(),
          k_features=11,
          forward=True,
          floating=False,
          scoring = 'r2',
          cv = 0)

sfs.fit(X, y)
sfs.k_feature_names_     # to get the final set of features
Comment

PREVIOUS NEXT
Code Example
Python :: python numpy array check if all nans 
Python :: df shift one column 
Python :: FutureWarning: The frame.append method is deprecated and will be removed from pandas in a future version. Use pandas.concat instead. 
Python :: create text in python if not exists 
Python :: interpoltaion search formula python 
Python :: how to convert column to index in pandas 
Python :: python day number from date 
Python :: mouse in pygame 
Python :: button images in tkinter 
Python :: csrf token exempt django 
Python :: custom 404 page flask 
Python :: how to install panda3D 
Python :: remove unnamed column pandas 
Python :: django admin slug auto populate 
Python :: python WhatsApp messaging spammer 
Python :: split filename and extension python 
Python :: python find the factors of a number 
Python :: python how to get script directory 
Python :: stop a function from continuing when a condition is met python 
Python :: django prepopulated_fields 
Python :: convert int to byte python 
Python :: pca python 
Python :: cv2 resize 
Python :: django import models 
Python :: how to check if a network port is open using python 
Python :: wait for input python 
Python :: python extract name out of mail 
Python :: difference between two dates in days python 
Python :: Square of numbers in non-decreasing order 
Python :: convert dtype of column cudf 
ADD CONTENT
Topic
Content
Source link
Name
9+9 =