Displaying 1 result from an estimated 1 matches for "degformula".
2012 Jun 09
1
caret: compare linear models of different degree
...stomizing the
degree for the 'lm' method. This might be due to the fact that the basic
'lm' function does not support the degree parameter.
I tried the following solution using a different formula for the second
training:
-----
library(caret)
data(trees)
formula=Volume~Girth+Height
degFormula=Volume~(Girth+Height)^2
m1 = train(formula, data=trees, method="lm")
m2 = train(degFormula, data=trees, method="lm")
-------
The problem with this solution is that the 'extractPrediction' method of
R does not work if comparing models with different formulas:
---
Error...