我有一个包含 300 个数字(从 1 到 300)的向量。我想创建两个子集,即模型/训练(200 个数字)和测试集(100 个数字)并进行替换。我尝试使用sample
,subset
但没有得到我想要的结果。
MWE:
x=(1,2,3,.......300)
x1 = (1,1,2,3,5,5,...........,300) (Consider it training set of 200 samples)
x2 = (1,3,9,101,130,130,..........299)
请有任何建议!!!!