当前位置:网站首页>特征选择feature_selection--SelectKBest
特征选择feature_selection--SelectKBest
2022-04-23 18:35:00 【夺笋123】
feature_selection.SelectKBest(score_func=<function f_classif>, *, k=10)
根据k个最高的分数(根据选择算法得出的分数)来选择k个特征
一般选择与输出值相关性最大的k个特征,选择算法涉及到统计学知识
该类的作用是创建一个特征选择器,特征的选择和返回需要fit_transform()函数
主要类方法
fit_transform
拟合数据,在该过程中寻找与标签值相关性最大的k个特征并返回
fit_transform(X, y=None, **fit_params)
一般使用格式
selector=SelectKBest(k=2) # 创建一个选择器
x_new=selector.fit_transform(x,y) # 选择器先拟合数据,选择出与标签值相关性最大的k个特征,将这些特征的整列返回作为一个新的ndarray
版权声明
本文为[夺笋123]所创,转载请带上原文链接,感谢
https://blog.csdn.net/m0_54510474/article/details/124365670
边栏推荐
- iptables -L执行缓慢
- 【ACM】455. Distribute Biscuits (1. Give priority to big biscuits to big appetite; 2. Traverse two arrays with only one for loop (use subscript index -- to traverse another array))
- ctfshow-web362(SSTI)
- Dynamically add default fusing rules to feign client based on sentinel + Nacos
- 14个py小游戏源代码分享第二弹
- On iptables
- Daily CISSP certification common mistakes (April 18, 2022)
- 硬核解析Promise对象(这七个必会的常用API和七个关键问题你都了解吗?)
- STM32: LCD显示
- 机器学习实战 -朴素贝叶斯
猜你喜欢
【ACM】376. 摆动序列
QT add external font ttf
iptables -L执行缓慢
MATLAB从入门到精通(二)
Function recursion and solving interesting problems
Machine learning theory (7): kernel function kernels -- a way to help SVM realize nonlinear decision boundary
Kettle paoding jieniu Chapter 17 text file output
Use stm32cube MX / stm32cube ide to generate FatFs code and operate SPI flash
根据快递单号查询物流查询更新量
Robocode tutorial 8 - advanced robot
随机推荐
Permission management with binary
QT reading and writing XML files (including source code + comments)
Use Chenxi bookkeeping book to analyze the balance of revenue and expenditure of each account in a certain period of time
ctfshow-web362(SSTI)
On iptables
If condition judgment in shell language
QT curve / oscilloscope customplot control
JD freefuck Jingdong HaoMao control panel background Command Execution Vulnerability
Analysez l'objet promise avec le noyau dur (Connaissez - vous les sept API communes obligatoires et les sept questions clés?)
Daily CISSP certification common mistakes (April 18, 2022)
ESP32 LVGL8. 1 - label (style 14)
回路-通路
Machine learning theory (7): kernel function kernels -- a way to help SVM realize nonlinear decision boundary
14个py小游戏源代码分享第二弹
CISSP certified daily knowledge points (April 14, 2022)
Use bitnami / PostgreSQL repmgr image to quickly set up PostgreSQL ha
Daily network security certification test questions (April 14, 2022)
Log4j2 cross thread print traceid
STM32学习记录0008——GPIO那些事1
os_ authent_ Prefix