Thank you Andy.
It seems like this can be the reason for the confusion.
I never thought that there can be this kind of catches for using tune.*
functions.
For the record, I actually emailed to Dr. Friedrich Leisch the author
of this library.
When I get some reply, I will post it also.
Regards,
Looking at the body of tune(), it has:
...
repeat.errors[reps] - if (is.factor(true.y))
1 - classAgreement(table(pred, true.y))
else crossprod(pred - true.y)/length(pred)
...
where classAgreement() is a function defined inside tune() that