R 最大最小父和子特征选择技术

R 最大最小父和子特征选择技术,r,R,我使用MXM库中的MMPC算法运行Feature selection Max-Min Parents and Children and Feature selection,得到以下错误: cor(目标,数据集)中出错:“x”必须是数字 注:Cardio1M是一个具有6个级别的因子变量,数据是因子和数值变量的数据集 mxres<-MMPC(data$Cardio1M,data[,-72],max_k = 3, threshold = 0.05,test = 'testIndFisher')

我使用MXM库中的MMPC算法运行Feature selection Max-Min Parents and Children and Feature selection,得到以下错误: cor(目标,数据集)中出错:“x”必须是数字

注:Cardio1M是一个具有6个级别的因子变量,数据是因子和数值变量的数据集

mxres<-MMPC(data$Cardio1M,data[,-72],max_k = 3, threshold = 0.05,test = 'testIndFisher')

mxres当我将目标变量的类更改为numeric时,它可以工作,如下所示
数据:100万美元