【发布时间】:2020-09-28 00:18:14
【问题描述】:
使用 train 函数,我正在尝试创建两个子数据集。我的原始数据集有 2215 个观察值(UCI_CC_cleaned)。使用下面的代码,我可以创建包含 575 个观察值的训练数据集 (UCI.train),但测试数据集的维度不正确。我期待 2215-575 个观测值,但它包含 2214 个观测值。
train <- UCI_CC_cleaned$random >0.75
UCI.train <- UCI_CC_cleaned[train, ]
UCI.test <- UCI_CC_cleaned[-train, ]
【问题讨论】: