@ -1,9 +1,9 @@
< template >
< template >
< div class = "app-container 2 ">
< div class = "app-container 4 ">
< div class = "Robot-learning" >
< div class = "Robot-learning" >
< div class = "left" >
< div class = "left" >
< div class = "gdialog" >
< div class = "gdialog" >
< el -scrollbar height = "6 20 px" style = "height: 93% ">
< el -scrollbar height = "6 45 px" style = "height: 93% ;padding: 0 15px; ">
< el -row >
< el -row >
< el -col :span ="24" >
< el -col :span ="24" >
< div class = "TaskBackground" >
< div class = "TaskBackground" >
@ -11,7 +11,7 @@
< / div >
< / div >
< / e l - c o l >
< / e l - c o l >
< / e l - r o w >
< / e l - r o w >
< p style = "color: # ffffff !important"> 假设我们要构建一个决策树来预测一个人是否会购买某个产品 。 我们将使用以下特征来进行预测 : < / p >
< p style = "color: # 000000 !important"> 假设我们要构建一个决策树来预测一个人是否会购买某个产品 。 我们将使用以下特征来进行预测 : < / p >
< p class = "info" >
< p class = "info" >
< img src = "@/assets/images/szjj/年龄.png" / >
< img src = "@/assets/images/szjj/年龄.png" / >
年龄 : 年龄范围在18岁到65岁之间
年龄 : 年龄范围在18岁到65岁之间
@ -24,7 +24,7 @@
< img src = "@/assets/images/szjj/收入.png" / >
< img src = "@/assets/images/szjj/收入.png" / >
收入 : 收入范围在0到100 , 000 之间
收入 : 收入范围在0到100 , 000 之间
< / p >
< / p >
< p style = "color: # ffffff !important"> 我们有一个包含以下数据的训练集 : < / p >
< p style = "color: # 000000 !important"> 我们有一个包含以下数据的训练集 : < / p >
< div class = "tabback" >
< div class = "tabback" >
< el -table :data ="TrainingSet" style = "width: 100%" stripe >
< el -table :data ="TrainingSet" style = "width: 100%" stripe >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
@ -34,7 +34,7 @@
< el -table -column prop = "purchase" label = "购买" align = "center" / >
< el -table -column prop = "purchase" label = "购买" align = "center" / >
< / e l - t a b l e >
< / e l - t a b l e >
< / div >
< / div >
< p style = "color: # ffffff !important">
< p style = "color: # 000000 !important">
现在 , 我们将使用这些数据来构建一个决策树模型 。
现在 , 我们将使用这些数据来构建一个决策树模型 。
< br / >
< br / >
我们可以使用信息增益或基尼不纯度等指标来选择最佳特征 。 在这个例子中 , 我们选择使用信息增益 。 计算结果显示应该选择性别作为根节点 。
我们可以使用信息增益或基尼不纯度等指标来选择最佳特征 。 在这个例子中 , 我们选择使用信息增益 。 计算结果显示应该选择性别作为根节点 。
@ -44,8 +44,6 @@
< br / >
< br / >
对于男性子集 :
对于男性子集 :
< / p >
< / p >
< span > { { MaleSubset } } 111 < / span >
< div class = "tabback tab2" >
< div class = "tabback tab2" >
< el -table :data ="MaleSubset" style = "width: 100%" stripe >
< el -table :data ="MaleSubset" style = "width: 100%" stripe >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
@ -67,7 +65,7 @@
< / e l - t a b l e >
< / e l - t a b l e >
< / div >
< / div >
< el -button @ click = "segmentation(MaleSubset, 1, '男')" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< el -button @ click = "segmentation(MaleSubset, 1, '男')" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< p style = "color: # ffffff !important"> 对于女性子集 : < / p >
< p style = "color: # 000000 !important"> 对于女性子集 : < / p >
< div class = "tabback tab2" >
< div class = "tabback tab2" >
< el -table :data ="FemaleSubset" style = "width: 100%" stripe >
< el -table :data ="FemaleSubset" style = "width: 100%" stripe >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
@ -89,7 +87,7 @@
< / e l - t a b l e >
< / e l - t a b l e >
< / div >
< / div >
< el -button @ click = "segmentation(FemaleSubset, 2, '女')" : disabled = "state < 2" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< el -button @ click = "segmentation(FemaleSubset, 2, '女')" : disabled = "state < 2" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< p style = "color: # ffffff !important">
< p style = "color: # 000000 !important">
对于男性子集 , 我们可以看到购买的结果是 "是" 和 "否" 都有 , 所以我们需要进一步划分 。 我们选择年龄作为下一个节点 。
对于男性子集 , 我们可以看到购买的结果是 "是" 和 "否" 都有 , 所以我们需要进一步划分 。 我们选择年龄作为下一个节点 。
< br / >
< br / >
对于年龄的取值 ( 小于等于30岁和大于30岁 ) :
对于年龄的取值 ( 小于等于30岁和大于30岁 ) :
@ -112,7 +110,7 @@
< / e l - t a b l e >
< / e l - t a b l e >
< / div >
< / div >
< el -button @ click = "divide(greaterThan, 3)" : disabled = "state < 3" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< el -button @ click = "divide(greaterThan, 3)" : disabled = "state < 3" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< p style = "color: # ffffff !important"> 对于大于30岁的子集 : < / p >
< p style = "color: # 000000 !important"> 对于大于30岁的子集 : < / p >
< div class = "tabback tab3" >
< div class = "tabback tab3" >
< el -table :data ="lessThan" style = "width: 100%" stripe >
< el -table :data ="lessThan" style = "width: 100%" stripe >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
< el -table -column type = "index" label = "编号" align = "center" width = "150" / >
@ -129,7 +127,7 @@
< / e l - t a b l e >
< / e l - t a b l e >
< / div >
< / div >
< el -button @ click = "divide(lessThan, 4)" : disabled = "state < 4" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< el -button @ click = "divide(lessThan, 4)" : disabled = "state < 4" class = "LeftbuttonS" > 分割 < / e l - b u t t o n >
< p style = "color: # ffffff !important">
< p style = "color: # 000000 !important">
对于小于等于30岁的子集 , 购买的结果都是 "否" , 所以我们不需要再进行划分 。
对于小于等于30岁的子集 , 购买的结果都是 "否" , 所以我们不需要再进行划分 。
< br / >
< br / >
对于大于30岁的子集 , 购买的结果都是 "是" , 所以我们不需要再进行划分 。
对于大于30岁的子集 , 购买的结果都是 "是" , 所以我们不需要再进行划分 。
@ -189,7 +187,7 @@
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< p style = "color: # ffffff !important">
< p style = "color: # 000000 !important">
上述例子是决策树相关的一个简单案例 , 实际中决策树可以用于金融领域的精准营销 , 利用大数据建模 , 分析客户年龄 、 收入 、 职业 、 历史信贷记录等信息 , 锁定哪些客户群里更有可能发生信贷风险 ,
上述例子是决策树相关的一个简单案例 , 实际中决策树可以用于金融领域的精准营销 , 利用大数据建模 , 分析客户年龄 、 收入 、 职业 、 历史信贷记录等信息 , 锁定哪些客户群里更有可能发生信贷风险 ,
< br / >
< br / >
哪些属于优质客户 , 更可能购买产品和服务等 。
哪些属于优质客户 , 更可能购买产品和服务等 。
@ -725,7 +723,7 @@ onMounted(() => {
. info {
. info {
display : flex ;
display : flex ;
align - items : center ;
align - items : center ;
color : # ffffff ! important ;
color : # 000000 ! important ;
img {
img {
margin - right : 10 px ;
margin - right : 10 px ;
}
}
@ -933,7 +931,14 @@ onMounted(() => {
}
}
}
}
}
}
. tj {
. tj {
-- el - button - hover - text - color : # 000000 ;
width : 136 px ;
height : 40 px ;
color : # 000000 ! important ;
}
. cxks {
width : 136 px ;
height : 40 px ;
color : # 000000 ! important ;
}
}
< / style >
< / style >