search for: nfolds

Displaying 18 results from an estimated 18 matches for "nfolds".

Did you mean: folds
2011 Jan 06
1
Cross validation for Ordinary Kriging
ear ALL, The last part of my thesis analysis is the cross validation. Right now I am having difficulty using the cross validation of gstat. Below are my commands with the tsport_ace as the variable: nfold <- 3 part <- sample(1:nfold, 69, replace = TRUE) sel <- (part != 1) m.model <- x2[sel, ] m.valid <- x2[-sel, ] t<- fit.variogram(v,vgm(0.0437, "Exp", 26, 0)) cv69
2011 Feb 17
1
cv.glmnet errors
Hi, I am trying to do multinomial regression using the glmnet package, but the following gives me an error (for no reason apparent to me): library(glmnet) cv.glmnet(x=matrix(c(1,2,3,4,5,6,1,2,3,4,5,6), nrow=6),y=as.factor(c(1,2,1,2,3,3)),family='multinomial',alpha=0.5, nfolds=2) The error i get is: Error in if (outlist$msg != "Unknown error") return(outlist) : argument is of length zero If i change the number of folds to 1, i get a seg fault: *** caught segfault *** address 0x0, cause 'memory not mapped' Traceback: 1: .Fortran("lognet&quot...
2012 Jun 15
0
argument "x" is missing, with no default - Please help find argument x
...all accuracy. cv.evaluate$correct <- cv.evaluate$prediction == cv.evaluate$remitter mymean<-mean(cv.evaluate$correct) retlist<-data.frame(mtry, sumvar$se, sumvar$sp, mean(cv.evaluate$correct)) return(retlist) } subloop<- function(mtry=mtry, ml.frame=ml.frame, ntrees=ntrees) { nfolds<- 10 # shuffle the numbers and divide into 10 groups numberOfRows<-dim(ml.frame)[1] lengthOfDiv<-numberOfRows/nfolds shuffled<-sample(c(1:numberOfRows), numberOfRows, replace=F) rownumber<-split(shuffled, 1:nfolds) #combine mymean into my vec myvec<-foreach (i = 1:le...
2011 Jun 20
2
Error of Cross Validation
Dear R users: Recently, I tried to write a program to calculate cross-validated predicted value. My sources are as follows. However, the R reported an error. Could you please check the sources? Thanks. set.seed(100) x<-rnorm(100) y<-sample(rep(0:1,50),replace=T) dat<-data.frame(x,y) library(rms) fito<-lrm(y~x) preo<-predict(fito) pre<-matrix(NA,nrow=100,ncol=200) for (i in
2012 May 28
0
GLMNET AUC vs. MSE
...ent story). Thanks in advance for any advice. Below is my code and sample output for AUC/MSE. xc <- split(dataS$P1_retained, dataS$TotalHours_R) yc <- split(dataS$x, dataS$TotalHours_R) for (i in 1:length(yc)) { fit=cv.glmnet(as.matrix(yc[[i]]), y=xc[[i]], alpha=.05, type="mse", nfolds=10, standardize=TRUE,family="binomial") c_output = c(i,fit$cvlo[fit$lambda==fit$lambda.1se],fit$cvm[fit$lambda==fit$lambda.1se], fit$cvup[fit$lambda==fit$lambda.1se]) names(c_output) = names(output_x) output_x = rbind(output_x, t(c_output)) fit1=cv.glmnet(as.matrix(yc[[i]]), y=xc[[i]],...
2011 Aug 11
1
Cv.glment question -- why giving me an error
Hi All,  I am trying to run cv.glmnet(x,y,family="multinomial", nfolds =4) and I only have 8 observations and the number of features I have is 1000, so my x matrix is 8 by 1000 and when I run the following, I get this error, I am not sure what is causing this problem.  Error in predmat[which, , seq(nlami)] = preds :   number of items to replace is not a multiple of re...
2011 Oct 12
1
CVbinary - Help
...ry response) but I got an error with CVbinary. Well I did this: fit <- lm(resp ~ PC1 + PC2 + PC3 + PC4 + PC5 + PC6 + PC7 + PC8 + PC9+PC10+PC11+PC12+PC13+PC14+PC15+PC16+PC17+PC18+PC19+PC20+PC21+PC22+PC23+PC24+PC25+PC26+PC27+PC28, data = dexp.cp, family=binomial()) CVbinary(fit) Error in sample(nfolds, m, replace = TRUE) : invalid 'size' argument I cannot understand this error, I was googling it, but i didn't find nothing really helpfull. Can someone help with is?...It's really important. Thank you for your time, Ana Rita -- View this message in context: http://r.789695.n4.na...
2007 Jan 22
0
Recursive-SVM (R-SVM)
I am trying to implement a simple r-svm example using the iris data (only two of the classes are taken and data is within the code). I am running into some errors. I am not an expert on svm's. If any one has used it, I would appreciate their help. I am appending the code below. Thanks../Murli ####################################################### ### R-code for R-SVM ### use leave-one-out
2011 Jul 21
1
Error: bad index in plotmo functions for MARS model (package earth)
Hello all useRs, I am tring make a simple surface plot ( 2 by 2 terms of a MARS model (with earth package) but I get the follow error message: > plotmo( mars ) Error: bad index (missing column in x?) I don't no how to workround this... :-( I thanks in advanced by some help! Thanks. Cleber ############### > > ### example code: > library( earth ) > data( gasoline,
2007 Aug 11
1
LDA and RDA: different training errors
Hello I try to fit a LDA and RDA model to the same data, which has two classes. The problem now is that the training errors of the LDA model and the training error of the RDA model with alpha=0 are not the same. In my understanding this should be the case. Am I wrong? Can someone explain what the reason for this difference could be? Here my code: LDA model: =========== % x is a dataframe tmp =
2011 Jan 16
1
Memory issues
...t of LASSO regression on several subsets of a big dataset. For some subsets it works well, and for some bigger subsets it does not work, with errors of type "cannot allocate vector of size 1.6Gb". The error occurs at this line of the code: example <- cv.glmnet(x=bigmatrix, y=price, nfolds=3) It also depends on the number of variables that were included in "bigmatrix". I tried on R and R64 for both Mac and R for PC but recently went onto a faster virtual machine on Linux thinking I would avoid any memory issues. It was better but still had some limits, even though memor...
2013 Jul 17
1
glmnet on Autopilot
...cv.glmnet(x, ly, family = "binomial", alpha = 1, # lasso penalty type.measure = "deviance", standardize = FALSE, intercept = FALSE, nfolds = 10, keep = FALSE) plot(fit.net) log(fit.net$lambda.1se) pred <- predict(fit.net, x, type = "response", s = "lambda.1se") all(coef(fit.net) == 0) all(pred ==0.5) Thanks in advance for your thoughts. Regards, Lars. [[alternative HTML...
2011 May 01
1
Different results of coefficients by packages penalized and glmnet
...rdize=TRUE) coef(pena.fit2) #lasso using gamnet library(glmnet) factors<-matrix(c(CN,NoSus),ncol=2) colnames(factors)<-c("CN","NoSus") glmn.fit2<-glmnet(x=factors,y=HRLNM,family="binomial") cvglmnet<-cv.glmnet(x=factors,y=HRLNM,family="binomial",nfolds=5) plot(cvglmnet) cvglmnet$lambda.min which(cvglmnet$lambda==cvglmnet$lambda.min) glmn.fit2<-glmnet(x=factors,y=HRLNM,family="binomial",lambda=cvglmnet$lambda.min) coef(glmn.fit2) Thanks a lot btw: how to calculate the C.I. of coefs? *Yao Zhu* *Department of Urology Fudan Univers...
2011 May 24
1
seeking help on using LARS package
...t; for a Bioinformatics project that we are working on. I know that the authors of the paper are using Lasso regression and so far looking at their paper this is what I have gotten to. xtrain <- trainData > dim(trainData) [1] 18520 88 ytrain <- trainScore length(ytrain) [1] 18520 nfolds <- 100 epsilon <- exp(-10) # code from JP Vert object1 <- cv.lars(xtrain,ytrain, K=nfolds, fraction = seq(from = 0, to = 1 , length= 1000), type='lasso', eps=epsilon, plot.it=TRUE) bestfraction <- object1$fraction[min(which(object1$cv <= min(object1$cv)+ 0.01*(max(object1...
2006 Apr 27
0
pamr package: pamr.adaptthresh() error rates
Hi, I was working on a classification problem using the pamr package. I used the pamr.adaptthresh() function to find the optimal accuracy of the classifier. I must not be doing it right, since it doesn't return the threshold values for optimum classification. For example,if I run it on a dataset, I get the following result using pamr.adaptthresh(): predicted true (1)
2006 Apr 27
0
package pamr: pamr.adaptthresh() error rates
Hi, I was working on a classification problem using the pamr package. I used the pamr.adaptthresh() function to find the optimal accuracy of the classifier. I must not be doing it right, since it doesn't return the threshold values for optimum classification. For example,if I run it on a dataset, I get the following result using pamr.adaptthresh(): predicted true
2006 Apr 27
0
package pamr: pamr.adapthresh() ---- Take 2!
Hi, Sorry about the earlier formatting errors... I was working on a classification problem using the pamr package. I used the pamr.adaptthresh() function to find the optimal accuracy of the classifier. I must not be doing it right, since it doesn't return the threshold values for optimum classification. For example,if I run it on a dataset, I get the following result using
2010 Jan 21
5
Logistic regression
can you do Logistic regression in R, if so how do you do it and how do you test the fit of a model? -- View this message in context: http://n4.nabble.com/Logistic-regression-tp1059870p1059870.html Sent from the R help mailing list archive at Nabble.com.