我正在使用 R 执行分析,我将实现四种算法。
1. RF
2. Log Reg
3. SVM
4. LDA
我有 50 个预测变量和 1 个目标变量。我所有的预测变量和目标变量都只是二进制数 0 和 1。
我有以下问题:
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.
谢谢
最佳答案
如果变量/预测变量是分类的,那么最好将它们转换为因子。否则,它们可能会被视为数值。
如果您正在执行分类任务,那么最好也将目标/响应变量作为一个因素。
最好查看您使用的函数的文档,以确保它们不会将因子转换为数值。
关于r - 分类任务中的所有二元预测器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46844180/