I tried to split the data(bank) into training data and test data. But I somehow got an error below.How can I solve this problem?
train = bank[1:100, ] test =
If you set the training data like:
data[1: 100,]
Then in lm() function you use the argument:
lm()
data = bank[train,]
Alternatively you can set train like:
seq(1: 100)
as a sequence of indices, you need to use in the
lm(): data = bank, subset = train