search for: cptable

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

Did you mean: mptable
2011 Dec 31
1
Cross-validation error with tune and with rpart
...I'm trying to generate classifiers for a certain task using several methods, one of them being decision trees. The doubts come when I want to estimate the cross-validation error of the generated tree: tree <- rpart(y~., data=data.frame(xsel, y), cp=0.00001) ptree <- prune(tree, cp=tree$cptable[which.min(tree$cptable[,"xerror"]),"CP"]) ptree$cptable CP nsplit rel error xerror xstd 1 0.33120000 0 1.0000 1.0000 0.02856022 2 0.08640000 1 0.6688 0.6704 0.02683544 3 0.02986667 2 0.5824 0.5856 0.02584564 4 0.02880000 5 0...
2011 Sep 26
1
compute probabilities on a Bayesian Network
Deal R Users, I'm trying to find out how can I compute probabilities on a Bayesian Network using R. The Bayesian Network I modelled is shown at http://www.dsr.inpe.br/~mello/1727/BNgrapmodel.png and I'd like to know how can I proceed (commands on R) to answer questions like: (1) what is the probability of S=T given C=T, L=T, R=F, H=F and D=F; or (2) what is the probability of S=T
2011 Sep 28
1
how to solve a simple discrete Bayesian Belief Network?
Can somebody save-me? Thanks in advance! #R script: #trying to find out how solve a discrete Bayesian Belief Network. #option: using 'catnet' package #BEGIN library(catnet) cnet <- cnNew(nodes = c("a", "b", "c"), cats = list(c("1", "2"), c("1", "2"), c("1", "2")), parents = list(NULL, c(1), c(1,
2008 Oct 17
1
Possible problems with the git repository.
...st did a git clone for the latest syslinux and when I entered the make command the build ended with an error. I also had to back level my git installation because "git clone url" doesn't seem to want to work any more yet it's what was on the web page. Regards, George... perl cptable.pl UnicodeData iso8859-8.txt iso8859-8.txt iso8859-8.cp perl cptable.pl UnicodeData iso8859-9.txt iso8859-9.txt iso8859-9.cp make[1]: Leaving directory `/tools/pxelinux/pxelinux/codepage' make[1]: Entering directory `/tools/pxelinux/pxelinux/core' .depend:1: *** multiple target patterns. S...
2004 Jun 17
2
using "= matrix (...)" in .C calls
...er(nsplit), as.integer(nodes), as.integer(ncat), as.integer(cats *!isord), as.integer(max(cats)), as.integer(xval), which = integer(nobs), cptable = matrix(double(numcp*cpcol), nrow=cpcol), dsplit = matrix(double(1), nsplit,3), isplit = matrix(integer(1), nsplit,3), csplit = catmat, dnode = matrix(double(1), nodes, 3+numresp),...
2008 May 28
1
calling C function from R
...? I am confused because rpart.c only returns an integer, not an object. The following is the rpart.c function: int rpart(int n,&nbsp; int nvarx, Sint *ncat, int method,&nbsp; int&nbsp; maxpri,&nbsp; double *parms,&nbsp; double *ymat,&nbsp; FLOAT *xmat, Sint *missmat, struct cptable *cptable, struct node **tree,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; char **error,&nbsp;&nbsp; int *which, int xvals,&nbsp;&nbsp;&nbsp;&nbsp; Sint *x_grp,&nbsp;&nbsp;&nbsp; double *wt,&nbs...
2009 Jun 11
1
Error compiling Wine on Fedora 11
...-n -e '$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $version | cmp -s - version.c) || echo $version >version.c || (rm -f version.c && exit 1) gcc -shared -Wl,-soname,libwine.so.1 -Wl,--version-script=./wine.map casemap.o collation.o compose.o config.o cptable.o debug.o fold.o ldt.o loader.o mbtowc.o mmap.o port.o sortkey.o string.o utf8.o wctomb.o wctype.o c_037.o c_424.o c_437.o c_500.o c_737.o c_775.o c_850.o c_852.o c_855.o c_856.o c_857.o c_860.o c_861.o c_862.o c_863.o c_864.o c_865.o c_866.o c_869.o c_874.o c_875.o c_878.o c_932.o c_936.o c_949.o...
2010 Oct 12
2
repeating an analysis
Hi All, I have to say upfront that I am a complete neophyte when it comes to programming. Nevertheless I enjoy the challenge of using R because of its incredible statistical resources. My problem is this .........I am running a regression tree analysis using "rpart" and I need to run the calculation repeatedly (say n=50 times) to obtain a distribution of results from which I will pick
2004 Mar 19
2
How to collect trees grown by rpart
...The kind of thing I hope to do is: > > resmat=array(NA, 100) > for (run in 1:100) resmat[run]=rpart(y~., data=train[run]) > > So that, later, I can do: > for (run in 1:100) pred[run]=predict(resmat[run], newdat) > > But, resmat[run] does not work, even though it saves the cptables. > > Thanks, in advance, > > Jonathan Williams > OPTIMA > Radcliffe Infirmary > Woodstock Road > OXFORD OX2 6HE > Tel +1865 (2)24356 > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz....
2010 May 26
1
how to Store loop output from a function
...ng set valid<-valid[myvar] control<-rpart.control(xval=10, cp=0.01, minsplit=5, minbucket=5) #control the size of the initial tree tree.fit <- rpart(out ~ ., method="class", data=train, control=control) # model fitting p.tree<- prune(tree.fit, cp=tree.fit$cptable[which.min(tree.fit$cptable[,"xerror"]),"CP"]) # prune the tree #get the prediction for the valid data set. tree.pred.r <-predict(p.tree, newdata=valid, type="prob") valid.r<-valid$out tree.pred <-rbind(tree.pred, tree.pred.r) valid.out<-c(valid.out, vali...
2008 Sep 16
1
1-SE rule in mvpart
Hello, I'm using mvpart option xv="1se" to compute a regression tree of good size with the 1-SE rule. To better understand 1-SE rule, I took a look on its coding in mvpart, which is : Let z be a rpart object , xerror <- z$cptable[, 4] xstd <- z$cptable[, 5] splt <- min(seq(along = xerror)[xerror <= min(xerror) + xvse * xstd]) I interprete this as following: the simplest tree with xerror under min(xerror) + its own xstd Neverthless, in some article I read the following rule: the simplest tree with xerror under mi...
2010 Mar 24
0
how to solve error in precict( ) while using with rpart?
...function but geting some error in prediction. the same code works fine with iris dataset. but applying other dataset it doesn't work. sample code is given for reference. > acc_model<-rpart(V1~V2+V3+V4+V5+V6+V7+V8, data=accEx.train) > plotcp(acc_model) > acc_find_cp<-(acc_model$cptable)[,"CP"][which.min(acc_model$cptable[,"xerror"])] > acc_prune_model<-prune(acc_model,acc_find_cp) > acc_predict_tree<-predict(acc_prune_model,newdata=accEx.test, type="class") Error in predict.rpart(acc_prune_model, newdata = accEx.test, type = "class&q...
2010 Jun 06
1
I need help in analyzing
...test$y) blond braz czarne rude blond 2 1 1 0 braz 2 3 2 1 czarne 0 2 2 0 rude 1 1 1 1 model=rpart(y~.,dane,method="class",control=rpart.control(xval=3,cp=0)) > plot(model) > text(model) model$cptable CP nsplit rel error xerror xstd 1 0.05691057 0 1.0000000 1.097561 0.08180737 2 0.02439024 3 0.8292683 1.219512 0.07040857 3 0.00000000 4 0.8048780 1.195122 0.07310295 npt=which.min(model$table[,4]) > npt integer(0) I need to describe this subject, but i don...
2008 Jul 03
1
cross-validation in rpart
...ions for rpart (init, split and eval) then rpart no longer cross-validates the resulting tree to return errors. A simple test is to use the usersplits.R function to get a simple, custom rpart function, and then change fit1 and fit2 so that the both have xvals of 10. The problem occurs in that the cptable for fit1 doesn't have xerror or xstd, despite the fact that the cross-validation is set to 10-fold. I guess I just need conformation that cross-validation doesn't work with custom functions, and if someone could explain to me why that is the case it would be greatly appreciated. Thanks, S...
2002 Apr 25
1
understanding and resolving seg faults
...ble **deltaI, int id) rpmatrix is called by "s_to_rp.c" where ddeltaI is a pointer from an ALLOC call: void s_to_rp2(Sint *n, Sint *nsplit, Sint *nnode, Sint *ncat, Sint *numcat, Sint *maxcat, Sint *xvals, Sint *which, double *cptable, double *dsplit, Sint *isplit, Sint *csplit, double *dnode, double *deltaI, Sint *inode) double **ddeltaI; /* declaration of ddeltaI */ ddeltaI = (double **) ALLOC(rp.num_y * rp.num_resp, sizeof(double )); rpmatrix(tree, nnode, nsplit, ncat, numcat,...
2011 Feb 10
2
R 2.12.1 Windows 32bit and 64bit - are numerical differences expected?
...f code to replicate the differences (but had to stay with the weather dataset from rattle since could not replicate on standard datasets yet). library(rpart) library(rattle) set.seed(41) model <- rpart(RainTomorrow ~ ., data=weather[-c(1, 2, 23)], control=rpart.control(minbucket=0)) print(model$cptable) Final row on 32bit: 9 0.01000000 23 0.1515152 1.1060606 0.1158273 Final row on 64bit: 9 0.01000000 23 0.1515152 1.0909091 0.1152273 Pretty minor, but different. I've not found any seed other than 41 (only tried a few) that results in a difference. library(ada) # using rpart undernea...
2008 Feb 03
2
use classificators learned in R in "real-life", e.g. C
Hi there, I am interested in using R for machine learning (supervised classification). Currently, I have been investigating especially the rpart, tree, and randomForest package, and have achieved first results. are there any experiences, how the learned classificators could be used in e.g. C ? in other words, I want to "transfer" the learned predictor from R to C-code. for e.g. rpart,
2008 Feb 04
0
SOLVED: use classificators learned in R in "real-life", e.g. C
...; in other words, I want to "transfer" the learned predictor from R >> to C-code. > >You could use dput to write the representation to a file, and read it >from >C. Parsing could be nasty, though, so I would prefer to extract the >relevant information (e.g. fit$cptable and fit$splits in the rpart >example), >and write it to a database in numeric form with additional information >if >required. Another option could be XML (package XML), and using one of >the >many XML libraries in C(++). > thanks for your answer. actually, taking a c...
2008 Oct 01
0
xpred.rpart() in library(mvpart)
...) { # library(mvpart) xx1 <- c(1,2,3,4,5,6,7,8,9,10) xx2 <- c(5,2,1,4,3,6,2,8,2,2) xx3 <- c(9,8,3,7,2,3,1,9,1,6) yy <- c(1,8,2,7,4,3,1,2,2,8) data1 <- data.frame(x1=xx1, x2=xx2, x3=xx3, y=yy) set.seed(345) rpart.out1 <- rpart(y~., data=data1) re1 <- rpart.out1$cptable[,"rel error"] print("re1") print(re1) xmat <- xpred.rpart(rpart.out1) xerr <- (xmat - yy)^2 re2 <- apply(xerr, 2, sum)/var(yy) print("re2") print(re2) } The result is: "re1" 1 2 3 1.00000000 0.08891993 0.032...
2010 Aug 03
1
R: classification tree model!
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?... Nom : non disponible URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100803/9fb28807/attachment.pl>