我是一个完全的菜鸟,所以这是一个相当基本的问题。我正在寻找在 SAS 中构建基于决策树的分类模型。
我无法在我的问题中嵌入图片,也无法附加图片,但我有一个正在使用的数据集。
这是我的数据集的链接预览:
我正在尝试使用 SAS 中的hpsplit过程
构建此决策树,但它不起作用。我认为是因为:
(1) 我没有使用所有的分类变量
(2) 我在“node-caps”列中有缺失值:可用选项是yes、no和? - 我想我应该使用“ASSIGNMISSING”程序,但不确定。见图片:
这是我当前的代码:
proc hpsplit data=bcancer seed=1;
class class;
model class = Age Menopause tumor_size inv_nodes node_caps deg_malig breast breast_quad irradiat;
grow entropy;
prune costcomplexity;
run;
我认为我应该是:
(1) 在第二行添加更多变量(因为它们是分类的)
(2) 添加“ASSIGNMISSING”程序以解决一列中缺失的变量。见链接:https ://i.imgur.com/aJmB3kx.png
NOTE: The ASSIGNMISSING= option has not been specified. Because of this, all observations with
missing values in the explanatory variables will be excluded from tree construction.
ERROR: Character variable appeared on the MODEL statement without appearing on a CLASS statement.
ERROR: Unable to create a usable predictor variable set.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE HPSPLIT used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
作为参考,这是我在日志中看到的错误。任何帮助将不胜感激!