Error with predict and glm.predict in R
问题 The Problem I trained a linear regression in R to predict this.target from city , variables in data frame data . This trainig is done on a subset of the data, which is specified by train.index . model = glm('data[, this.target] ~ data$city', data = data, subset = train.index) I am trying to test this model on the held out data, which is specified by test.index . predictions = predict(model, data[test.index, ]) For whatever reason, this second step creates an error and a warning. Error in