简体   繁体   English

使用 R 构建预测 model

[英]build predictive model using R

I wanted to build predictive model using R.我想使用 R 构建预测 model。 I used R studio as IDE.我使用 R 工作室作为 IDE。 I used heart disease regarding dataset and created data-model.我使用了有关数据集的心脏病并创建了数据模型。 My predictive value is categorical variable.我的预测值是分类变量。

But when I add data-frame values to model I got below error:但是当我将数据帧值添加到 model 时,出现以下错误:

Error in quantile.default(resid) : factors are not allowed
In addition: Warning message:
In Ops.factor(r, 2) : ‘^’ not meaningful for factors

For this model I wanted to use multiple independent variables and predicted value is factor variable and will return 0 or 1.对于这个 model,我想使用多个自变量,预测值是因子变量,将返回 0 或 1。

Thank you for the response.感谢您的答复。 I found a solution.我找到了解决方案。 Issue is I have used my output variable as a factor.问题是我使用了我的 output 变量作为一个因素。 Now I use as a number and error fixed.现在我将其用作数字并修复了错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM