What is your outcome variable in the model?
My suspicion is that you meant to write as.factor(training_data) (lowercase t ) instead of as.factor(Training_data) (uppercase T) in your formula. The first refers to a single column in your dataframe while the latter refers to the whole data frame thus giving an error.