当前位置:网站首页>Feature selection feature_ selection--SelectKBest

Feature selection feature_ selection--SelectKBest

2022-04-23 18:40:00 Capture bamboo shoots 123

feature_selection.SelectKBest(score_func=<function f_classif>, *, k=10)

according to k Highest scores ( Score based on selection algorithm ) Choose k Features

Generally, select the one with the greatest correlation with the output value k Features , The selection algorithm involves statistical knowledge
The purpose of this class is to create a feature selector , The selection and return of features need fit_transform() function

Main class method

fit_transform

Fitting data , In this process, find the one that has the greatest correlation with the tag value k Select a feature and return
fit_transform(X, y=None, **fit_params)

Generally use the format

selector=SelectKBest(k=2)	#  Create a selector 
x_new=selector.fit_transform(x,y)	#  The selector fits the data first , Select the one that is most relevant to the tag value k Features , Return the entire column of these features as a new ndarray

版权声明
本文为[Capture bamboo shoots 123]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231835454651.html