search for: iris3

Displaying 20 results from an estimated 27 matches for "iris3".

Did you mean: iris
2002 Mar 17
3
apply problem
> data(iris) # iris3 is first 3 rows of iris > iris3 <- iris[1:3,] # z compares row 1 to each row of iris3 and is correctly computed > z <- c(F,F,F) > for(i in seq(z)) z[i] <- identical(iris3[1,],iris3[i,]) > z [1] TRUE FALSE FALSE # this should do the same but is incorrect > apply(iris3,1,f...
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], iris3[-tr,,2], iris3[-tr,,3]); cl <- factor(c(rep("s",25), rep("c",25), rep("v",25))); z <- lda(train, cl); predict(z, test)$class; data.fra...
2000 Mar 08
3
Reading data for discriminant analysis
Dear R users, I want to do discriminant analysis on my data. I have successfully followed the discriminant analysis in V & R on the iris data: > ir <- rbind (iris3[,,1],iris3[,,2],iris3[,,3]) > ir.species <- c(rep("s",50),rep("c",50),rep("v",50)) > a <- lda(log(ir),ir.species) > a$svd^2/sum(a$svd^2) [1] 0.996498601 0.003501399 > a.x <- predict(a,log(ir),dimen=2)$x > eqscplot (a.x,type="n",xlab=&q...
2004 Nov 02
2
lda
Hi !! I am trying to analyze some of my data using linear discriminant analysis. I worked out the following example code in Venables and Ripley It does not seem to be happy with it. ============================ library(MASS) library(stats) data(iris3) ir<-rbind(iris3[,,1],iris3[,,2],iris3[,,3]) ir.species<-factor(c(rep("s",50),rep("c",50),rep("v",50))) ir.lda<-lda(log(ir),ir.species) ir.ld<-predict(ir.lda,dimen=2)$x eqscplot(ir.ld, type="n", xlab = "First linear discriminant", ylab =...
2009 Nov 02
1
modifying predict.nnet() to function with errorest()
...(). 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 experiencing. Any ideas on how to get around it or will it simply not work with nnet()? > library(MASS) > library(nnet) > library(ipred) > data(iris3) > set.seed(191) > > samp <- c(sample(1:50,25), sample(51:100,25), sample(101:150,25)) > ird <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), + species = factor(c(rep("s",50), rep("c", 50), rep("v", 50)))) > errorest(species ~., d...
2004 Mar 29
1
Interpreting knn Results
...the winning class, etc. Andy > From: Ko-Kang Kevin Wang > > Hi, > > [I'm posting this on behalf of a colleague -- as I don't know > knn myself...] > > How to interpret the knn() results? > > Tried the example codes in the documentation: > data(iris3) > train <- rbind(iris3[1:25,,1], iris3[1:25,,2], iris3[1:25,,3]) > test <- rbind(iris3[26:50,,1], iris3[26:50,,2], iris3[26:50,,3]) > cl <- factor(c(rep("s",25), rep("c",25), rep("v",25))) > knn(train, test, cl, k = 3, prob=TRU...
2005 Jul 27
1
how to get actual value from predict in nnet?
...set, I used "N" and "P" to label the two. My question is, how do I get the predicted numerical value for each sample? Not just give me the label(either "N" or "P")? Thanks! FYI: The nnet example I followed from help document is, ird <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), species = c(rep("s",50), rep("c", 50), rep("v", 50))) ir.nn2 <- nnet(species ~ ., data = ird, subset = samp, size = 2, rang = 0.1, decay = 5e-4, maxit = 200) table(ird$species[-samp], predict(...
2007 Apr 20
3
Hi
Please add me to mailing list. regards Astha ************************************** See what's free at http://www.aol.com. [[alternative HTML version deleted]]
2006 Apr 13
3
What does "rbind(iris[,,1], iris[,,2], iris[,,3])" do?
It's in the Venables & Ripley MASS (ed 3) book in the section on principal components. The context is as follows > ir <- rbind(iris[,,1], iris[,,2], iris[,,3]) > ir.species <- factor(c(rep("s",50),rep("c",50),rep("v",50))) (then they use brush(ir) which I guess is not an R function) and then > princomp(log(ir[1:4]),cor=T) (there is no [1:4]
2009 Nov 17
1
Error running lda example: Session Info
> > library(MASS) > Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), + Sp = rep(c("s","c","v"), rep(50,3))) > train <- sample(1:150, 75) > table(Iris$Sp[train]) c s v 22 23 30 > z <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train) Error in if (targetlist[i] == st...
2009 May 30
0
what is 'class.ind' here?
...est.cl(targets[-samp], predict(crsNNET1, crsNNET1[-samp])) I get: Error in as.vector(data) : (list) object cannot be coerced to type 'double' By the way, my samp vector is: samp <- c(sample(1:250,125), sample(251:500,125), sample(500:920,300)) Here is the example from nnet: data(iris3) # use half the iris data ir <- rbind(iris3[,,1],iris3[,,2],iris3[,,3]) targets <- class.ind( c(rep("s", 50), rep("c", 50), rep("v", 50)) ) samp <- c(sample(1:50,25), sample(51:100,25), sample(101:150,25)) ir1 <- nnet(ir[samp,], targets[samp,], size = 2, ra...
2006 May 30
1
when dimensionality is larger than the number of observations?
Hi, there: Can anyone here kindly point some good reference or links on this topic? Esp. some solutions from BioConductor or R, when dealing with microarray-like, "fat" data? thanks, -- Weiwei Shi, Ph.D "Did you always know?" "No, I did not. But I believed..." ---Matrix III [[alternative HTML version deleted]]
2013 May 20
0
Neural network: Amore adaptative vs batch why the results are so different?
...mbers very large, I still found all the iris expected class=2 being classified as class=3. In addition, all those records in the outcomes (y) are the three digits, 0, 0.4677313, and 0.5111955. The script is as below. Please help to understand this behavior. library('AMORE') ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) targets <- matrix(c(rep(c(1,0,0),50), rep(c(0,1,0),50), rep(c(0,0,1),50)), 150, 3, byrow=TRUE) samp <- c(sample(1:50,25), sample(51:100,25), sample(101:150,25)) net <- newff(n.neurons=c(4, 2, 3), # number of units per layer learning.rate.global=1e...
2009 Oct 14
1
plot discriminant analysis
I'm confused on how is the right way to plot a discriminant analysis made by lda function (MASS package). (I had attached my data fro reproduction). When I plot a lda object : X <- read.table("data", header=T) lda_analysis <- lda(formula(X), data=X) plot(lda_analysis) #the above plot is completely different to: plot(predict(lda_analysis)$x,
2011 Jun 14
1
color specific(!) lines in different color with in parcoord plots
Dear Madame or Sir, in my current project, I have so far used a lot of very different plots. I am now trying to gain informatin with the help of parallel coordinate plots. Therefore, I use the function "parcoord" of the MASS package. What I would like to do, is to color let's say the points according to the first half of rows of a specific matrix/dataframe in a color different from
2006 Apr 13
5
Questions on formula in princomp
I hope this time I'm using the "iris" dataset correctly: ir <- rbind(iris3[,,1], iris3[,,2], iris3[,,3]) lir <- data.frame(log(ir)) names(lir) <- c("a","b","c","d") I'm trying to understand the meaning of expressions like "~ a+b+c+d", used with princomp, e.g. princomp(~ a+b+c+d, data=lir, cor=T) By inspection,...
2011 Dec 08
1
lda output missing
Hello everyone, I am working on a linear discriminant analysis and am having issues finding the full output of my lda. Specifically, there is no reporting of the Proportion of Trace that is a normal output of the procedure. I'm using a csv file and everything is reading in correctly. I've looked and looked and can't figure out why my output is not complete. Is it something simple that
2009 Nov 15
3
Error running lda example from Help File (MASS library )
Hello all, I'm trying to run lda() from the MASS library but the Help example generates the following error: #Code from example in lda Help file # Resulting Error >Error in if (targetlist[i] == stringname) { : argument is of length zero My Current R Installation: MacOSX: 10.5.8 R: 2.10.0 -- Gregory Riddick, PhD. CRTA Research Fellow National Institutes of Health National
2007 Apr 19
1
Do you have any idea what could be the problem with this script?
...not there at all (try to do the same in the browser). Any suggestions? require ''rubygems'' require ''mechanize'' agent = WWW::Mechanize.new agent.user_agent_alias = ''Mac Safari'' page = agent.get("http://www.sbstransit.com.sg/iris3/bus_serviceopt.aspx") search_form = page.forms.with.name("Form1").first search_form.txtsvcno = "014" search_form.txtbusstop = ''92129'' search_results = agent.submit(search_form) open(''output.html'',''w'') {|f|...
2007 Apr 20
2
Running script does not return the correct page
...not there at all (try to do the same in the browser). Any suggestions? require ''rubygems'' require ''mechanize'' agent = WWW::Mechanize.new agent.user_agent_alias = ''Mac Safari'' page = agent.get("http://www.sbstransit.com.sg/iris3/bus_serviceopt.aspx") search_form = page.forms.with.name("Form1").first search_form.txtsvcno = "014" search_form.txtbusstop = ''92129'' search_results = agent.submit(search_form) open(''output.html'',''w'') {|f|...