操作步骤
- 数据准备完成后,单击组件,在工具和数据预处理文件夹下将SQL脚本、类型转换、归一化组件拖到画布中,并拼接成如下实验。
- 单击SQL脚本组件,在画布右侧的SQL脚本输入栏中输入sql语句,根据每个字段的含义将字符型转为数值。
select age,
(case sex when 'male' then 1 else 0 end) as sex,
(case cp when 'angina' then 0 when 'notang' then 1 else 2 end) as cp,
trestbps,
chol,
(case fbs when 'true' then 1 else 0 end) as fbs,
(case restecg when 'norm' then 0 when 'abn' then 1 else 2 end) as restecg,
thalach,
(case exang when 'true' then 1 else 0 end) as exang,
oldpeak,
(case slop when 'up' then 0 when 'flat' then 1 else 2 end) as slop,
ca,
(case thal when 'norm' then 0 when 'fix' then 1 else 2 end) as thal,
(case status when 'sick' then 1 else 0 end) as ifHealth
from ${t1};
- 单击数据转换组件,在画布右侧的字段设置页签,单击转换为double类型的列下方的选择字段,选择全部字段,将字段类型转换为double。
4. 单击归一化组件,在画布右侧的字段设置页签,选择全部字段。完成后单击画布下方的运行,系统将自动开始运行实验,在运行过程中可右键查看各组件的输出。
- 在数据预处理文件夹下,将拆分组件拖到画布中,并拼接运行,如下图所示。
说明:此步骤的目的是将数据拆分成两份,80%作为模型训练集,20%作为模型预测集。