Displaying 20 results from an estimated 1100 matches similar to: "Overlapping parameters "k" in different functions in "ipred""
2010 Mar 09
1
create picture (k -the nearest neighbours)
Hi
I want to create a nice picture about my result of k -the nearest neighbours
algorithm. Here is my easy code:
#################################
library(klaR)
library(ipred)
library(mlbench)
data(PimaIndiansDiabetes2)
dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)]
dane[,2]=log(dane[,2])
dane[,1:2]=scale(dane[,1:2])
zbior.uczacy=sample(1:nrow(dane),nrow(dane)/2,F)
2005 Jan 06
1
different result from the same errorest() in library( ipred)
Dear all,
Does anybody can explain this: different results got when all the same parameters are used in the errorest() in library ipred, as the following?
errorest(Species ~ ., data=iris, model=randomForest, estimator = "cv", est.para=control.errorest(k=3), mtry=2)$err
[1] 0.03333333
> errorest(Species ~ ., data=iris, model=randomForest, estimator = "cv",
2004 Jan 09
3
ipred and lda
Dear all,
can anybody help me with the program below? The function predict.lda
seems to be defined but cannot be used by errortest.
The R version is 1.7.1
Thanks in advance,
Stefan
----------------
library("MASS");
library("ipred");
data(iris3);
tr <- sample(1:50, 25);
train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3]);
test <- rbind(iris3[-tr,,1],
2005 Jun 23
1
errorest
Hi,
I am using errorest function from ipred package.
I am hoping to perform "bootstrap 0.632+" and "bootstrap leave one out".
According to the manual page for errorest, i use the following command:
ce632[i]<-errorest(ytrain ~., data=mydata, model=lda,
estimator=c("boot","632plus"), predict=mypredict.lda)$error
It didn't work. I then tried the
2009 Nov 02
1
modifying predict.nnet() to function with errorest()
Greetings,
I am having trouble calculating artificial neural network
misclassification errors using errorest() from the ipred package.
I have had no problems estimating the values with randomForest()
or svm(), but can't seem to get it to work with nnet(). I believe
this is due to the output of the predict.nnet() function within
cv.factor(). Below is a quick example of the problem I'm
2006 Oct 08
0
Problem in getting 632plus error using randomForest by ipred!
Hello!
I'm Taeho, a graduate student in South Korea.
In order to get .632+ bootstrap error using random forest, I have tried to use 'ipred' package; more specifically the function 'errorest' has been used.
Following the guidelines, I made a simple command line like below:
error<-errorest(class ~ ., data=data, model=randomForest, estimator = "632plus")$err
2009 Oct 27
1
"ipredknn" - How may I find values?
Hi everybody!
I want to find a closer neighbourins observation. This is my code:
##########################
library(klaR)
library(ipred)
library(mlbench)
data(PimaIndiansDiabetes2)
dane=na.omit(PimaIndiansDiabetes2)[,c(2,5,9)]
dane[,2]=log(dane[,2])
dane[,1:2]=scale(dane[,1:2])
zbior.uczacy=sample(1:nrow(dane),nrow(dane)/2,F)
2008 Feb 27
7
Cross Validation
Hello,
How can I do a cross validation in R?
Thank You!
2005 Mar 18
2
logistic model cross validation resolved
This post is NOT a question, but an answer. For readers please disregard all earlier posts by myself about this question.
I'm posting for two reasons. First to say thanks, especially to Dimitris, for suggesting the use of errorest in the ipred library. Second, so that the solution to this problem is in the archives in case it gets asked again.
If one wants to run a k-fold cross-validation
2006 Feb 02
0
crossvalidation in svm regression in e1071 gives incorrect results (PR#8554)
Full_Name: Noel O'Boyle
Version: 2.1.0
OS: Debian GNU/Linux Sarge
Submission from: (NULL) (131.111.8.96)
(1) Description of error
The 10-fold CV option for the svm function in e1071 appears to give incorrect
results for the rmse.
The example code in (3) uses the example regression data in the svm
documentation. The rmse for internal prediction is 0.24. It is expected the
10-fold CV rmse
2006 Feb 02
0
crossvalidation in svm regression in e1071 gives incorre ct results (PR#8554)
1. This is _not_ a bug in R itself. Please don't use R's bug reporting
system for contributed packages.
2. This is _not_ a bug in svm() in `e1071'. I believe you forgot to take
sqrt.
3. You really should use the `tot.MSE' component rather than the mean of
the `MSE' component, but this is only a very small difference.
So, instead of spread[i] <- mean(mysvm$MSE), you
2003 Feb 27
2
PRESS again
Sorry for the repeat.
The PRESS statistic is defined as
sum(y-yhat(i))^2, where yhat(i) denotes the ith predicted value using
all the data except the ith case (as used typically in linear models).
Thanks again
Jacob
Jacob L van Wyk
Department of Mathematics and Statistics
Rand Afrikaans University
P O Box 524
Auckland Park 2006
South Africa
Tel: +27-11-489-3080
Fax: +27-11-489-2832
2004 Jul 26
1
do.call and double-colon access
Using R 2.0.0 of July 20 2004
train, test, and cl as defined in example(knn),
we have
> search()
[1] ".GlobalEnv" "package:methods" "package:stats" "package:graphics"
[5] "package:utils" "Autoloads" "package:base"
> knn(train, test, cl, k=3)
Error: couldn't find function "knn"
>
2011 Sep 08
1
error in knn: too many ties in knn
Hello.
I found the behavior of knn(
http://stat.ethz.ch/R-manual/R-devel/library/class/html/knn.html) function
looking very strange.
Consider the toy example.
> library(class)
> train <- matrix(nrow=5000,ncol=2,data=rnorm(10000,0,1))
> test <- matrix(nrow=10,ncol=2,data=rnorm(20,0,1))
> cl <- rep(c(0,1),2500)
> knn(train,test,cl,1)
[1] 1 1 0 0 1 0 1 1 0 1
Levels: 0 1
It
2003 Jun 24
1
errorest: Error in cv.numeric()
Hi,
I am trying to get an error estimation
for a classification done using lda.
The examples work fine, however I don't get
my own code to work.
The data is in object d
> d
class hydrophobicity charge geometry
1 2 6490.0400 1434.9700 610.99902
2 2 1602.0601 400.6030 -5824.00000
3 2 969.0060 260.1360 -415.00000
4 1
2006 Jun 07
1
knn - 10 fold cross validation
Hi,
I was trying to get the optimal 'k' for the knn. To do this I was using the following function :
knn.cvk <- function(datmat, cl, k = 2:9) {
datmatT <- (datmat)
cv.err <- cl.pred <- c()
for (i in k) {
newpre <- as.vector(knn.cv(datmatT, cl, k = i))
cl.pred <- cbind(cl.pred, newpre)
cv.err <- c(cv.err, sum(cl != newpre))
}
2009 Jan 22
4
dimnames in pkg "ipred"
Hello List,
I`m trying to make prediction using a bagged tree with the package ipred. I tried to follow the manual but I`m getting an error message. Also browsing through the list-archive I didn`t find any hint.
Maybe someone can help me?
selbag <- bagging(SOIL_UNIT ~., data=traindat.bin, coob=TRUE)
Error in dimnames(X) <- list(dn[[1L]], unlist(collabs, use.names = FALSE)) :
2007 Apr 11
1
Function knn.dist from knnflex library
Hello,
I am feeling that this question can have a very simple answer, but I
can't find it.
I need to use the function knn.dist from knnflex library.
Whatever I try, I get the error:
Error in as.vector.dist(x, "character") : unused argument(s) ("character")
First example:
> a<-NULL
> a<-rbind(a,c(5.2,-8.1))
> a<-rbind(a,c(8.8,-16.1))
>
2011 Aug 31
8
!!!function to do the knn!!!
hi, r users
i have a problem with KNN.
i have 2 datasets, X0 and X1.
>dim(X0)
>1471*13
dim(X1)
>5221*13
and for every instances in the dataset X1, i want to find the nearest
neighbour(1nn) in the dataset X0.
and i dont have the true classifications of dataset X1.
but the function knn() need true classifications(cl) to do prediction.
i just curious if there are some other function
2008 Oct 29
1
Help with impute.knn
ear all,
This is my first time using this listserv and I am seeking help from the
expert. OK, here is my question, I am trying to use impute.knn function
in impute library and when I tested the sample code, I got the error as
followingt:
Here is the sample code:
library(impute)
data(khanmiss)
khan.expr <- khanmiss[-1, -(1:2)]
## ## First example
## if(exists(".Random.seed"))