I am trying to use the bagging technique to increase my model's predictive power. My response variable, status, is a binary variable where 0 indicates no disease and 1 indicates disease. The variable `status` is just a vector of repeating 0's and 1's (so its class is 'numeric' not 'factor'). Not sure if this is relevant but I just wanted to point that out.
And `pred` consists of a list of values ranging from 0 to 1
I'm confused about why `pred` didn't just return a value of either 0, or 1? Does this have to do with the fact that my response variable, status, is just a vector and not a factor variable? If the predictions are supposed to range from 0 to 1 in this case, what's the cut off point for whether the prediction should be classified as 0, or 1? Would it simply be 0.5?
mod=bagging(status~x1+x2+x3+x4, method="class") pred=predict(bagging, newdata=fit26data[1:282,], type="Class")
> pred  0.0465 0.3930 0.4426 0.4905...and so on