当前位置:网站首页>基于sklearn的决策树应用实战
基于sklearn的决策树应用实战
2022-08-10 07:59:00 【白话机器学习】
在sklearn中,我们主要使用两个决策树方法,均封装在tree模块下。
分别是分类树tree.DecisionTreeClassifier、回归树tree.DecisionTreeRegressor,对应分别基于决策树解决分类问题和回归问题。
本次主要以分类树的使用过程为例进行介绍。在sklearn中分类决策树的函数方法如下:
DecisionTreeClassifier(class_weight=None, criterion='gini', max_depth=None,
max_features=None, max_leaf_nodes=None,
min_impurity_decrease=0.0, min_impurity_split=None,
min_samples_leaf=1, min_samples_split=2,
min_weight_fraction_leaf=0.0, presort=False,
random_state=None, splitter='best')
主要参数介绍:
1、criterion
这个参数是用来指定构造树时,树的“不纯度”的计算方法,主要有两种:
(1)entropy,使用信息熵来构造
(2)gini,使用基尼系数来构造(默认采用此模式)
边栏推荐
猜你喜欢
PLSQL学习第四天
90. (cesium house) cesium height monitoring events
【MySQL】使用MySQL Workbench软件新建表
【转】探秘钉钉的即时消息服务DTIM
ATH10 sensor reads temperature and humidity
2022-08-01 Advanced Network Engineering (23) Advanced VLAN Technology - VLAN Aggregation, MUX VLAN
MySQL索引事务
ABAP Data Types 和XSD Type 映射关系以及XSD Type属性
IDLE development wordCount program (5)
MySQL设置初始密码—注意版本mysql-8.0.30
随机推荐
ABAP Data Types 和XSD Type 映射关系以及XSD Type属性
In the SQL SERVER database, if the data of the table is added, deleted, or modified, will the index of the table be recorded in the ldf log?
本地生活商家如何通过短视频赛道,提升销量曝光量?
initramfs与initrd的区别
WooCommerce 安装和 rest api 使用
The precise effect of network integration promotion outsourcing in the era of Internet of Things-Shenzhen Win-Win World News
VS2013-调试汇编代码-生成asm文件-结构体内存布局-函数参数压栈-调用约定
关于数据中心的设计方案,数据中心网络规划设计
卷积神经网络卷积层公式,卷积神经网络运算公式
941 · Sliding Puzzles
CV+Deep Learning——网络架构Pytorch复现系列——classification(三:MobileNet,ShuffleNet)
2022-08-01 网工进阶(二十四) STP进阶知识
Johnson全源最短路
组合数模板
day16--The use of the packet capture tool Charles
Day36 LeetCode
IDLE开发wordCount程序(第五弹)
DGIOT三千万电表集抄压测
[深入研究4G/5G/6G专题-56]: L3信令控制-5-无线承载管理
阿里云数据库 RDS SQL Server 版的服务器绑定域名www.cxsdkt.cn.的呢?