R 分类任务中的所有二进制预测器

R 分类任务中的所有二进制预测器,r,machine-learning,statistics,random-forest,r-caret,R,Machine Learning,Statistics,Random Forest,R Caret,我使用R进行分析,我将实现四种算法 1. RF 2. Log Reg 3. SVM 4. LDA 我有50个预测因子和1个目标变量。我所有的预测器和目标变量都是二进制数0s和1s 我有以下问题: Should I convert them all into factors? Converting them into factors, and applying RF algorithms give 100% accuracy, I am very much surprised to see th

我使用R进行分析,我将实现四种算法

1. RF
2. Log Reg
3. SVM
4. LDA
我有50个预测因子和1个目标变量。我所有的预测器和目标变量都是二进制数0s和1s

我有以下问题:

Should I convert them all into factors?
Converting them into factors, and applying RF algorithms give 100% accuracy, I am very much surprised to see that as well.
Also, for other algorithms, how should i treat my variables priorly, before feeding them into my other algorithms.

谢谢

如果变量/预测值是分类的,那么最好将它们转换为因子。否则,它们很可能会被视为数值

如果您正在执行分类任务,那么最好将target/response变量作为一个因素

最好查看所用函数的文档,以确保它们不会将因子转换为数值

使用adaboost

看看不同的kaggle内核,尤其是Mercedes内核,了解实现adaboost的想法


数据集混合了数字和因子以及0、1

我已经在把它们转换成因素了,我不认为,你的答案是正确的,应该有评论。为什么不正确?你的问题显然是“我应该把它们都转换成因子吗?”如果你不喜欢我的答案,就随它去吧。看起来你是在寻求帮助,然后期望能以某种方式给出令你满意的答案。@HongOoi,即使是在测试数据上。