search for: extractprediction

Displaying 3 results from an estimated 3 matches for "extractprediction".

2009 Jun 08
3
caret package
Hi all I am using the caret package and having difficulty in obtaining the results using regression, I used the glmnet to model and trying to get the coefficients and the model parameters I am trying to use the extractPrediction to obtain a confusion matrix and it seems to be giving me errors. x<-read.csv("x.csv", header=TRUE); y<-read.csv("y.csv", header=TRUE); tc=trainControl(method="cv", number=10 ); glmmat<-train(x,y,method="glmnet", trControl=tc); extractPrediction(li...
2009 Jan 15
2
problems with extractPrediction in package caret
...rfControl <- trainControl(method = "oob", returnResamp = "all", returnData=TRUE, verboseIter = TRUE) rftrain <- train(x=train_x, y=trainclass, method="rf", tuneGrid=tuneGrid, tr.control=rfControl) pred <- predict(rftrain) pred # this works fine expred <- extractPrediction(rftrain) Error in models[[1]]$trainingData : $ operator is invalid for atomic vectors My predictors are 28 numeric attributes and one factor. I`m working with the latest version of caret and R 2.7.2 on WinXP. Any advice is very welcome. Thanks. TIM -----------------------------------------...
2012 Jun 09
1
caret: compare linear models of different degree
...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 in eval(expr, envir, enclos) : object 'Girth:Height' not found --- How can I set the degree used when training a linear model without changing the formula? I need the 'extractPrediction' function...