I am trying to train an SVM model using Forest Fire data. I split up my data into a test and training set. I am fairly new to this type of analysis but I'm not sure what role the test data plays or even why it's recommended that the data be split into a training and test set. How do I use the test data to see how good of a fit the trained model is? Data comes from https://archive.ics.uci.edu/ml/datasets/Forest+Fires
In addition, I am using ksvm from library(kernlab) because svm from library(e1071) has not worked for me in the past. Variables day and month are categorical so I treated them as factors using as.factor(day) and as.factor(month) in the ksvm model.
forestfires = read.csv("forestfires.csv") # read csv file
head(forestfires)
summary(forestfires)
#build training/ test sample sample
set.seed(0508)
sample<-sample(1:nrow(forestfires), 0.75*nrow(forestfires))
testfire<-forestfires[sample,]
trainfire<-forestfires[-sample,]
#Build SVM model
library(kernlab)
vmod<-ksvm(log(area+1)~X+Y+as.factor(month)+as.factor(day)+
FFMC+DMC+DC+ISI+temp+RH+wind+rain, data=trainfire, type="nu-svr")