Displaying 11 results from an estimated 11 matches for "trainx".
Did you mean:
train
2012 Oct 10
2
lm on matrix data
Hi,
I have a question about using lm on matrix, have to admit it is very
trivial but I just couldn't find the answer after searched the mailing
list and other online tutorial. It would be great if you could help.
I have a matrix "trainx" of 492(rows) by 220(columns) that is my x,
and trainy is 492 by 1. Also, I have the newdata testx which is 240
(rows) by 220 (columns). Here is what I got:
py <- predict(lm(trainy ~ trainx ), data.frame(testx))
Warning message:
'newdata' had 240 rows but variable(s) found have 492...
2017 Aug 23
1
cross validation in random forest using rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package documentation example for iris data set....
2017 Aug 23
2
cross validation in random forest rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package documentation example for iris data set.
He...
2012 May 16
1
survival survfit with newdata
...l package confirm that this behaviour is as expected or not - because I cannot find a way of using 'newdata' with really new data. Thanks in advance. DK
> x<-matrix(rnorm(100*20),100,20)
>
time<-runif(100,min=0,max=7)
>
status<-sample(c(0,1), 100, replace = TRUE)
> trainX<-x[11:100,]
>
trainTime<-time[11:100]
>
trainStatus<-status[11:100]
>
testX<-x[1:10,]
> coxph.model<-
coxph(Surv(trainTime,trainStatus)~ trainX)
> sfit<- survfit(coxph.model,newdata=data.frame(testX))
>
dim(sfit$surv)
[1] 90 90
[[alter...
2017 Aug 23
0
cross validation in random forest using rfcv functin
Any responds?!
On Wednesday, August 23, 2017 5:50 AM, Elahe chalabi via R-help <r-help at r-project.org> wrote:
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package documentation example for iris data set....
2008 Sep 18
1
caret package: arguments passed to the classification or regression routine
...7],
method="gbm",
distribution=list(name="quantile",alpha=0.5), verbose=FALSE,
trControl=trainControl(method="cv",number=5),
tuneGrid=gbmGrid
)
Model 1: interaction.depth=1, shrinkage=0.1, n.trees=300
collapsing over other values of n.trees
Error in gbm.fit(trainX, modY, interaction.depth =
tuneValue$.interaction.depth, :
formal argument "distribution" matched by multiple actual arguments
The same error occured with distribution="laplace".
I also tried the following without and success :
gbm.test <- train(x.enet, y.matrix[,7],...
2012 May 07
1
estimating survival times with glmnet and coxph
...ot;Coxnet: Regularized Cox
Regression".
Thanks in advance.
DK
library(survival)
library(glmnet)
load(system.file("doc","VignetteExample.rdata",package="glmnet"))
attach(patient.data)
# leave the first patient for testing
# and train glmnet on all other patients
trainX????? <-x[-1,]
trainTime?? <-time[-1]
trainStatus <- status[-1]
# fit Coxnet
fit <- glmnet(trainX,Surv(trainTime,trainStatus),family="cox",alpha=0.5,maxit=10000)
# find lambda for which dev.ratio is max
max.dev.index???? <- which.max(fit$dev.ratio)
optimal.lambda <- fit...
2013 Apr 15
1
Imputation with SOM using kohonen package
...re quite difficult to interpret.
# there's much work needed here to understand it, but for now I want to see
if it's possible to impute values for another variable...
# here's where I lose it, missing values, trainY, don't get it.
bw.predict <- predict(bw.som, newdata=scale(bw), trainX=???, trainY=???)
Ben.
[[alternative HTML version deleted]]
2010 Mar 30
1
predict.kohonen for SOM returns NA?
...])
> Xtest <- scale(wines[-training, ],
+ center = attr(Xtraining, "scaled:center"),
+ scale = attr(Xtraining, "scaled:scale"))
> som.wines <- som(Xtraining, grid = somgrid(5, 5, "hexagonal"))
> som.prediction <- predict(som.wines, newdata = Xtest,
+ trainX = Xtraining,
+ trainY = factor(wine.classes[training]))
> table(wine.classes[-training], som.prediction$prediction)
1
2
3
> som.prediction$prediction
[1] NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA
NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA NA...
2011 Jan 24
5
Train error:: subscript out of bonds
Hi,
I am trying to construct a svmpoly model using the "caret" package (please
see code below). Using the same data, without changing any setting, I am
just changing the seed value. Sometimes it constructs the model
successfully, and sometimes I get an ?Error in indexes[[j]] : subscript out
of bounds?.
For example when I set seed to 357 following code produced result only for 8
2013 Nov 15
1
Inconsistent results between caret+kernlab versions
I'm using caret to assess classifier performance (and it's great!). However, I've found that my results differ between R2.* and R3.* - reported accuracies are reduced dramatically. I suspect that a code change to kernlab ksvm may be responsible (see version 5.16-24 here: http://cran.r-project.org/web/packages/caret/news.html). I get very different results between caret_5.15-61 +