Re: [R] get the first character element from a list

2012-02-09 Thread Changbin Du
Thanks so much, David! I will try. On Thu, Feb 9, 2012 at 3:04 PM, David Winsemius wrote: > > On Feb 9, 2012, at 5:01 PM, Changbin Du wrote: > > test<-c("20120111_181515_001_**CCL54D_A01_S02_APL932_PL11_DL_** >> 20120111.CEL", >> "20120111_181516_002_

[R] get the first character element from a list

2012-02-09 Thread Changbin Du
test<-c("20120111_181515_001_CCL54D_A01_S02_APL932_PL11_DL_20120111.CEL", "20120111_181516_002_CCL54D_A02_S08_APL932_PL11_DL_20120111.CEL") > test [1] "20120111_181515_001_CCL54D_A01_S02_APL932_PL11_DL_20120111.CEL" [2] "20120111_181516_002_CCL54D_A02_S08_APL932_PL11_DL_20120111.CEL" fields1<-str

Re: [R] create variables through a loop

2011-09-22 Thread Changbin Du
C-7SARK 1 849467 10 10 10 10 10 > 10 > 6C-7SCGC 1 874609 10 10 10 10 10 > 10 > array07 array08 array09 array10 > 1 10 10 10 10 > 2 10 10 10 10 > 3 10 10

Re: [R] create variables through a loop

2011-09-22 Thread Changbin Du
10 10 10 10 5 10 10 10 10 6 10 10 10 10 Appreciated your great helps! On Thu, Sep 22, 2011 at 10:55 AM, Changbin Du wrote: > Thanks so much, Michael! > > > head(first) > probe_name chr_id position array1 > 1C-7S

Re: [R] create variables through a loop

2011-09-22 Thread Changbin Du
s? What > about (untested): > > for (i in 1:2) { > first <-cbind(first, result.fun[[i]]) > } > > you will then have to look at > names(first) > and change the last part of it to > paste("array",2:3,sep="") > > Hope that works! > JC &

Re: [R] create variables through a loop

2011-09-22 Thread Changbin Du
) > > first.out <- do.call("cbind", list(first, result.fun)) > print(first.out) > > which provides this output. > > x y z a b > 1 1 6 11 1 4 > 2 2 7 12 2 5 > 3 3 8 13 3 6 > > More generally, you really should read about how arguments and ass

Re: [R] create variables through a loop

2011-09-22 Thread Changbin Du
ments for a function are. > > More generally, this sort of thing may be best handled in a list rather > than an set of independent variables. > > Michael Weylandt > > On Thu, Sep 22, 2011 at 1:07 PM, Changbin Du wrote: > >> HI, Dear R community, >> >>

[R] create variables through a loop

2011-09-22 Thread Changbin Du
HI, Dear R community, I am trying to created new variables and put into a data frame through a loop. My original data set: head(first) probe_name chr_id position array1 1C-7SARK 1 849467 10 2C-4WYLN 1 854278 10 3C-3BFNY 1 854471 10 4C-7ONNE

Re: [R] how to split a data frame by two variables

2011-09-01 Thread Changbin Du
e to be > *very* large before it mattered. > > -Don > > > -- > Don MacQueen > > Lawrence Livermore National Laboratory > 7000 East Ave., L-627 > Livermore, CA 94550 > 925-423-1062 > > > > > > On 9/1/11 11:08 AM, "Changbin Du" wrote: >

Re: [R] how to split a data frame by two variables

2011-09-01 Thread Changbin Du
Thanks for the great helps from David, Jim and Liviu. It solved my problem. Appreciated! On Thu, Sep 1, 2011 at 11:01 AM, David Winsemius wrote: > > On Sep 1, 2011, at 1:53 PM, Changbin Du wrote: > > HI, Dear R community, >> >> I want to split a data frame by using

[R] how to split a data frame by two variables

2011-09-01 Thread Changbin Du
HI, Dear R community, I want to split a data frame by using two variables: let and g > x = data.frame(num = c(10,11,12,43,23,14,52,52,12,23,21,23,32,31,24,45,56,56,76,45), let = letters[1:5], g = 1:2) > x num let g 1 10 a 1 2 11 b 2 3 12 c 1 4 43 d 2 5 23 e 1 6 14 a 2 7

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
PS -- Is your data guaranteed to be an integer? If you have floating point > data, it's good practice to use something more like > > abs(x - 10) > 1e-8 > > rather than x != 0 in your code. If you need to use this formulation, just > put it inside the any() statement. >

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
ch rows to > keep > > Answer = M[rowsToKeep,] # keep only those rows > > Hope this helps, > > Michael > > > On Mon, Aug 22, 2011 at 12:56 PM, Changbin Du wrote: > >> HI, Michael, >> >> What I want to do is remove all the rows, for which array1, arr

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
n(x){any (x != 10)}) > # apply the test function row-wise to get a logical vector of which rows to > keep > > Answer = M[rowsToKeep,] # keep only those rows > > Hope this helps, > > Michael > > > On Mon, Aug 22, 2011 at 12:56 PM, Changbin Du wrote: > >> H

Re: [R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
op > based on that test? > > Michael > > On Mon, Aug 22, 2011 at 12:35 PM, Changbin Du wrote: > >> Dear R community, >> >> I have a data set like the following: >> >> probe_name chr_id position array1 array2 array3 array4 array5 array6 >> array7

[R] select columns array2 not equal to 10

2011-08-22 Thread Changbin Du
Dear R community, I have a data set like the following: probe_name chr_id position array1 array2 array3 array4 array5 array6 array7 1C-3 10 16566949 10 10 10 10 10 10 10 2C-3AAAB 17 33478940 10 10 10 10 10 10 10 3C-3AAAC

Re: [R] R on Multicore for Linux

2011-07-22 Thread Changbin Du
Nabble.com. >[[alternative HTML version deleted]] > > __ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self

Re: [R] how to replace the following string

2011-06-27 Thread Changbin Du
"W.0.N" "D.1.H" > > sub("\\.([0-9]+)\\.", "{\\1}", test) > [1] "H{1}Y" "N{0}E" "G{1}N" "E{0}P" "W{2}G" "W{4}G" "W{3}W" "W{0}N" "D{1}H" > > > > > On

[R] how to replace the following string

2011-06-27 Thread Changbin Du
HI, Dear R-community, I have one vector of the following string, > test<-c("H.1.Y", "N.0.E", "G.1.N", "E.0.P", "W.2.G", "W.4.G", "W.3.W", "W.0.N", "D.1.H") > test [1] "H.1.Y" "N.0.E" "G.1.N" "E.0.P" "W.2.G" "W.4.G" "W.3.W" "W.0.N" "D.1.H" *I want to change them into* "H{1}Y" "N{0}E" "G{1}N" "

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
#x27;sqldf' had non-zero exit status When I try to remove the */house/homedirs/c/cdu/library/00LOCK'* by rm -r 00LOCK, I got the following errors: cdu@nuuk:~/library$ rm -r 00LOCK *rm: cannot remove `00LOCK/RSQLite/libs/.nfs0001301e52e00004': Device or resource busy*

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
I will try this first. Thanks, Gabor! On Wed, Jun 22, 2011 at 3:15 PM, Gabor Grothendieck wrote: > On Wed, Jun 22, 2011 at 6:10 PM, Changbin Du wrote: > > My R is 2.12.0. > > > >> R.version.string > > [1] "R version 2.12.0 (2010-10-15)" >

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
On Wed, Jun 22, 2011 at 3:04 PM, Gabor Grothendieck wrote: > On Wed, Jun 22, 2011 at 6:01 PM, Changbin Du wrote: > > I found the following errors: > > > > > >> library(sqldf) > > Loading required package: DBI > > Loading required package: RSQLite > &

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
quot;/house/homedirs/c/cdu/operon/gh5/hypo_re.dimer", header=FALSE, sep="\t",sql="select varr from file", quote="", fill=T) *Error: could not find function "read.csv.sql"* On Wed, Jun 22, 2011 at 2:57 PM, Changbin Du wrote: > Hi, Gabor, > &g

Re: [R] question about read.columns

2011-06-22 Thread Changbin Du
Hi, Gabor, Thanks so much, I will try it and let you know the results. Appreciated! On Wed, Jun 22, 2011 at 2:54 PM, Gabor Grothendieck wrote: > On Wed, Jun 22, 2011 at 5:45 PM, Changbin Du wrote: > > HI, Dear R community, > > > > I have a large data set names dd

[R] question about read.columns

2011-06-22 Thread Changbin Du
HI, Dear R community, I have a large data set names dd.txt, the columns are: there are 2402 variables. a1, b1, ..z1, a11, b11, ...z11, a111, b111, ..z111.. IF I dont know the relative position of the columns, but I know I need the following variables: var<-c(a1, c1,a11,b11,f111) Can I use read.

Re: [R] R² for non-linear model

2011-03-16 Thread Changbin Du
list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html<http://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > -- Sincerel

Re: [R] create dummy variables by for loop

2011-02-24 Thread Changbin Du
atrix to create dummy variables: > > mydummies = model.matrix(~myfactor)[, -1] > > You'll get as many dummy variables as values you have in ack$ID - > minus 1 (for the reference level). > Dimitri > > On Thu, Feb 24, 2011 at 2:30 PM, Changbin Du wrote: > > Thanks to al

Re: [R] create dummy variables by for loop

2011-02-24 Thread Changbin Du
Thanks, David! On Thu, Feb 24, 2011 at 11:30 AM, David Winsemius wrote: > > On Feb 24, 2011, at 1:23 PM, Changbin Du wrote: > > HI, Dear R community, >> >> I try to create 100 dummy variables like the following: >> >> ack$id_1 <- (ack$ID==1)*1 >>

Re: [R] create dummy variables by for loop

2011-02-24 Thread Changbin Du
> "Is the room still a room when its empty? Does the room, > the thing itself have purpose? Or do we, what's the word... imbue it." > - Jubal Early, Firefly > > r-help-boun...@r-project.org wrote on 02/24/2011 01:23:54 PM: > > > [image removed] > &

[R] create dummy variables by for loop

2011-02-24 Thread Changbin Du
HI, Dear R community, I try to create 100 dummy variables like the following: ack$id_1 <- (ack$ID==1)*1 ack$id_2 <- (ack$ID==2)*1 .. . ack$id_100 <- (ack$ID==100)*1 I used the following codes: for(i in 1:100){ ack$id_[i] <- (ack$ID==i)*1 } But only one colum

Re: [R] can I use the output of a neural network as the fitness function of genetic algorithm?

2011-02-07 Thread Changbin Du
_ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >

Re: [R] auc function

2011-01-20 Thread Changbin Du
ttp://www.r-project.org/posting-guide.html> > and provide commented, minimal, self-contained, reproducible code. > -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927-2856 [[alternative HTML v

Re: [R] my function does not work for large data set

2010-12-16 Thread Changbin Du
Thanks Jim1 I will split the data and rum again. On Thu, Dec 16, 2010 at 2:57 PM, Jim Holtman wrote: > I think that your object exceeds the limit of 2^31 elements. > > Sent from my iPad > > On Dec 16, 2010, at 17:44, Changbin Du wrote: > > > Dear R community, > &g

[R] my function does not work for large data set

2010-12-16 Thread Changbin Du
er.nn)) * Error in unlist(X, recursive = FALSE, use.names = FALSE) : negative length vectors are not allowed* Thanks so much! -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927-2856 [[alter

[R] X11 module cannot be loaded

2010-11-16 Thread Changbin Du
HI, Dear R community, I have used the following codes this morning, but this afternoon, I got the following errors: > x <- seq(0,10, by=1) > y <- c(0.952, 0.947, 0.943, 0.941, 0.933, 0.932, 0.939, 0.932, 0.924, 0.918, 0.920) # missense > z <- c(0.068, 0.082, 0.080, 0.099, 0.108, 0.107, 0.101, 0.1

Re: [R] how to work with long vectors

2010-11-05 Thread Changbin Du
0.02 > > identical(v_3,v) > [1] TRUE > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -Original Message- > > From: r-help-boun...@r-project.org > > [mailto:r-help-boun...@r-project.org] On Behalf Of Changbin Du > > Sent: Frida

Re: [R] how to work with long vectors

2010-11-05 Thread Changbin Du
Thanks Martin! I will try it and will let your guys know how it goes. On Fri, Nov 5, 2010 at 9:42 AM, Martin Morgan wrote: > On 11/05/2010 09:13 AM, Changbin Du wrote: > > HI, Phil, > > > > I used the following codes and run it overnight for 15 hours, this > morning, &g

Re: [R] how to work with long vectors

2010-11-05 Thread Changbin Du
umeric(l) + for(i in 1:l)output[i] = sum(data >= data[i]) + 100 * output / l + } > result3<-cover_per_2(cover) On Thu, Nov 4, 2010 at 10:37 AM, Changbin Du wrote: > Thanks Phil, that is great! I WILL try this and let you know how it goes. > > > > > On Thu, N

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
pector > Statistical Computing Facility > Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > > > > >

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
Thanks Martin, I will try this. On Thu, Nov 4, 2010 at 10:06 AM, Martin Morgan wrote: > On 11/04/2010 09:45 AM, Changbin Du wrote: > > Thanks, Jim! > > > > This is not what I want, What I want is calculate the percentage of > reads > > bigger or equal to that re

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
! On Thu, Nov 4, 2010 at 9:12 AM, Henrique Dallazuanna wrote: > Try this: > > rev(100 * cumsum(matt$reads > 1) / length(matt$reads) ) > > On Thu, Nov 4, 2010 at 1:46 PM, Changbin Du wrote: > >> HI, Dear R community, >> >> I have one data set like t

Re: [R] how to work with long vectors

2010-11-04 Thread Changbin Du
647 > 5 Contig79:5 17 50.0 > 6 Contig79:620 58.82353 > 7 Contig79:725 73.52941 > 8 Contig79:827 79.41176 > 9 Contig79:932 94.11765 > 10 Contig79:1033 97.05882 > 11 Contig79:1134 100.0 > > > On Thu, Nov 4, 2010 at 1

[R] how to work with long vectors

2010-11-04 Thread Changbin Du
HI, Dear R community, I have one data set like this, What I want to do is to calculate the cumulative coverage. The following codes works for small data set (#rows = 100), but when feed the whole data set, it still running after 24 hours. Can someone give some suggestions for long vector? id

Re: [R] how to save this result in a vector

2010-11-01 Thread Changbin Du
gt; On 11/1/2010 2:24 AM, Changbin Du wrote: > > Thanks Joshua! Yes, i is not going up sequentially by 1, as i here is > the > > raw number of reads for each DNA base. Thanks so much for the great help! > > > > > > On Sun, Oct 31, 2010 at 6:03 PM, Joshua Wiley >w

Re: [R] how to save this result in a vector

2010-10-31 Thread Changbin Du
gt; for (i in min(cover):max(cover)) { > output[j] <- 100*sum(ifelse(cover >= i, 1, 0))/length(cover) >j <- j + 1 > } > return(output) > } > > Josh > -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr

Re: [R] how to save this result in a vector

2010-10-31 Thread Changbin Du
min(data):max(data)) { x<-(100*sum(ifelse(data >= i, 1, 0))/length(data)) output<-c(output, x) } return(output) } result<-cover_per(test) On Sun, Oct 31, 2010 at 5:46 PM, David Winsemius wrote: > > On Oct 31,

[R] how to save this result in a vector

2010-10-31 Thread Changbin Du
HI, Dear R community, I have the following codes to calculate the commulative coverage. I want to save the output in a vector, How to do this? test<-seq(10, 342, by=2) #cover is a vector cover_per<-function (cover) { for (i in min(cover):max(cover)) {print(100*sum(ifelse(cover >= i, 1, 0))/lengt

Re: [R] online course: SVM in R with Lutz Hamel at statistics.com

2010-10-28 Thread Changbin Du
Sorry, I was a little numb at that time. On Thu, Oct 28, 2010 at 10:45 AM, David Winsemius wrote: > In a sense you deserve what you have asked for. You have asked thousands of > people to send you a copy when you could have instead searched the archives > yourself and gotten a much quicker ans

[R] svm online course in R

2010-10-28 Thread Changbin Du
Hi, Dear Community, Several days ago, I received one email about the online svm course in R, I try to find it. Can someone forward the information to me. Thanks! -- Sincerely, Changbin -- [[alternative HTML version deleted]] __ R-help@r-pro

Re: [R] help with adding lines to current plot

2010-10-25 Thread Changbin Du
red", yaxt="n", lty=3, xlab="", > ylab="", ylim = c(min(c(y, z)), max(c(y, z > > # add x vs. fp > lines(x, z, type="b", pch=22, col="blue", lty=2) > > > Cheers, > > Josh > > On Mon, Oct 25, 2010 at 2:38 PM,

[R] help with adding lines to current plot

2010-10-25 Thread Changbin Du
HI, Dear R community, I am using the following codes to plot, however, the lines code works. But the line was not drawn on the previous plot and did not shown up. How comes? # specify the data for missense simulation x <- seq(0,10, by=1) y <- c(0.952, 0.947, 0.943, 0.941, 0.933, 0.932, 0.939, 0

Re: [R] Random Forest AUC

2010-10-23 Thread Changbin Du
I think you should use 10 fold cross validation to judge your performance on the validation parts. What you did will be overfitted for sure, you test on the same training set used for your model buliding. On Sat, Oct 23, 2010 at 6:39 AM, mxkuhn wrote: > I think the issue is that you really can'

Re: [R] need help with nnet

2010-10-12 Thread Changbin Du
Thanks, Claudia! On Tue, Oct 12, 2010 at 9:54 AM, Claudia Beleites wrote: > I'm not sure how much fun it is to fit > 7000 weights with 1800 samples, > but you can tell nnet to allow more weights with MaxNWts, see ?nnet > > > > On 10/12/2010 06:45 PM, Changbin Du wrote:

[R] need help with nnet

2010-10-12 Thread Changbin Du
HI, Dear R community, My data set has 2409 variables, the last one is response variable. I have used the nnet after feature selection and works. But this time, I am using nnet to fit a model without feature selection. I got the following error information: > dim(train) [1] 1827 2409 nnet.fit<

Re: [R] How to read this file into R.

2010-09-24 Thread Changbin Du
quot; > > Hope this helps. >- Phil Spector > Statistical Computing Facility > Department of Statistics > UC Berkeley >

[R] How to read this file into R.

2010-09-24 Thread Changbin Du
Dear community, I have one file named ca_boost_feature.txt, Feature selection (Boosting:0.0025,5)! H.2.C C.1.D C.3.R E.0.N C.2.S C.0.G H.3.G log file: ep If I want to use the second line of this file, how to read it into R? varr<-read.table("/home/cdu/operon/carbonic/ca_boost_feature.txt", sep

Re: [R] change the for loops with lapply

2010-09-07 Thread Changbin Du
Thanks so much, David! The following codes works! result.fun <- lapply(1:2, function(i) cv.fold(i, 3, 0.3)) On Tue, Sep 7, 2010 at 3:35 PM, David Winsemius wrote: > > On Sep 7, 2010, at 5:43 PM, Changbin Du wrote: > > cv.fold<-function(i, size=3, rang=0.3){ >>

[R] change the for loops with lapply

2010-09-07 Thread Changbin Du
cv.fold<-function(i, size=3, rang=0.3){ cat('Fold ', i, '\n') out.fold.c <-((i-1)*c.each.part +1):(i*c.each.part) out.fold.n <-((i-1)*n.each.part +1):(i*n.each.part) train.cv <- n.cc[-out.fold.c, c(2:2401, 2417)] train.nv <- n.nn[-out.fold.n, c(2:2401, 2417)]

Re: [R] help with predict.lda

2010-07-06 Thread Changbin Du
Thanks all so much for your help! I went out for 2 days vacation and could not reply your guys email. Yes, the CV=False works. Thanks again! On Sun, Jul 4, 2010 at 2:47 AM, Peter Ehlers wrote: > On 2010-07-03 21:33, Changbin Du wrote: > >> HI, Dear community, >> >&g

[R] help with predict.lda

2010-07-03 Thread Changbin Du
HI, Dear community, I am using the linear discriminant analysis to build model and make new predictions: > dim(train) #training data [1] 1272 22 > dim(valid) # validation data [1] 140 22 lda.fit <- lda(out ~ ., data=train, na.action="na.omit", CV=TRUE) # model fitting of linear discriminan

[R] strange data set output

2010-07-02 Thread Changbin Du
Hi, Dear Community, My data set logit.pred contains 2 columns and 1400 rows. When I want to use the first column, it is very strange. Where the $ come out? Thanks so much! > dim(logit.pred) [1] 14002 > head(logit.pred) tree.pred valid.out 754 0.6550606 1 1080 0.6353524

[R] help with the xtable package

2010-07-01 Thread Changbin Du
HI, Dear R community, I am using the xtable to create the table, but how can I see the table? The following is the codes I used: > data(tli) > tli.table <- xtable(tli[1:10, ]) > digits(tli.table)[c(2, 6)] <- 0 > print(tli.table, floating = FALSE) % latex table generated in R 2.11.0 by xtable

Re: [R] ROC curve in R

2010-07-01 Thread Changbin Du
posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927-2856 [[alternative HTML version deleted]] _

[R] how to distinguish bi-mode distribution from mono-mode distribution

2010-06-29 Thread Changbin Du
HI, Dear community, How to distinguish bi-mode distribution from mono-mode distribution? I have only the histograms of 3500 data set. Thanks! -- Sincerely, Changbin -- [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] help in SVM

2010-06-24 Thread Changbin Du
HI, GUYS, I used the following codes to run SVM and get prediction on new data set hh. dim(all_h) [1] 2034 24 dim(hh)# it contains all the variables besides the variables in all_h data set. [1] 640 415 require(e1071) svm.tune<-tune(svm, as.factor(out) ~ ., data=all_h, ranges=list(gamma

[R] question about boosting(Adaboosting. M1)

2010-06-19 Thread Changbin Du
HI, Guys, I am trying to use the AdaBoosting. M.1 algorithm to integrate three models. I found the sum of weights for each model is not equal to one. How to deal with this? Thanks, any response or suggestions are appreciated! -- Sincerely, Changbin -- [[alternative HTML version del

[R] help with nnet

2010-06-17 Thread Changbin Du
> nnet.fit<-nnet(as.factor(out) ~ ., data=all_h, size=5, rang=0.3, decay=5e-4, maxit=500) # model fitting > summary(nnet.fit) a 23-5-1 network with 126 weights options were - entropy fitting decay=5e-04 HI, Guys, I can not find the manual to describe how the model is built, is there a more

[R] help with neural network nnet package

2010-06-17 Thread Changbin Du
HI, Dear R community, I am using the nnet to fit a neural network model to do classification on binary target variable (0, 1). I am using the following codes: nnet.fit<-nnet(as.factor(out) ~ ., data=train, size=5, rang=0.3, decay=5e-4, maxit=500) I want to know what is the activation function f

[R] nnet

2010-06-17 Thread Changbin Du
HI, Dear R community, I am using the nnet to fit a neural network model to do classification on binary target variable (0, 1). I am using the following codes: nnet.fit<-nnet(as.factor(out) ~ ., data=train, size=5, rang=0.3, decay=5e-4, maxit=500) I want to know what is the activation function f

[R] output from the gbm package

2010-06-15 Thread Changbin Du
at least once? IF SOME obs are not selected, how to calculate the training error? Thanks? -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927-2856 [[alternative HTML version deleted

Re: [R] why the dim gave me different results

2010-06-02 Thread Changbin Du
Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > > On Wed, 2 Jun 2010, Changbin Du wrote: > > dim(tmp) >>> >> [1] 576 12 >> >

[R] why the dim gave me different results

2010-06-02 Thread Changbin Du
> dim(tmp) [1] 576 12 > tmp 1 10 11 12 13 2 3 4 5 6 7 9 10 0 0 0 0 0 0 12 0 0 0 0 20 0 0 0 0 0 0 15 0 0 0 0 30 0 0 0 0 0 0 11 0 0 0 0 40 0 0 0 0 0 0 11 0 0 0 0 50 0 0 0 0 0 0 12 0 0 0 0 60 0 0 0

Re: [R] how to label the som notes by the majority vote

2010-06-02 Thread Changbin Du
as.factor(temp.predict))], > main="Mapping plot",labels=label) > > It does not calculate the majority vote itself, it just assigns a label to > the category based on the predicted labels. Which is equivalent in this > case. > > Cheers > Joris > > >

Re: [R] how to label the som notes by the majority vote

2010-06-01 Thread Changbin Du
ar Changbin, > > Please provide a self-contained, minimal example, meaning the whole code > should run and create the plot as it is now, without having to load your > dataset (which we don't have). Otherwise it's impossible to see what's going > on and help you. >

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
Thanks to all! Yes, LETTERS[outcome.predict] works! I appreciated your guys help! On Tue, Jun 1, 2010 at 1:53 PM, Henrique Dallazuanna wrote: > use "[" not "(" > > > On Tue, Jun 1, 2010 at 5:50 PM, Changbin Du wrote: > >> It does no

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
label<-intToChar(as.integer(outcome.predict)) ?outcome.label<-LETTERS(outcome.predict) plot(final.xyf, type="property", property=outcome.predict, labels=outcome.label, palette.name =rainbow, main="Supervised:Prediction ") Thanks so much! On Tue, Jun 1, 2010 at 1:50 PM, Eri

Re: [R] problem with intToChar

2010-06-01 Thread Changbin Du
It does not work. > outcome.label<-LETTERS(outcome.predict) Error: could not find function "LETTERS" On Tue, Jun 1, 2010 at 1:48 PM, Henrique Dallazuanna wrote: > Try this: > > LETTERS[outcome.predict] > > On Tue, Jun 1, 2010 at 5:43 PM, Changbin Du wr

[R] problem with intToChar

2010-06-01 Thread Changbin Du
Hi, Dear R- community, I am use the intToChar function to convert the integers to letters. But the output is mess. Can you guys give some suggestions? Thanks! > outcome.predict [1] 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 4 7 4 4 4 4 4 4 4 4 [26] 4 4 4 4 4 4 4 4 4 4 4

Re: [R] how to Store loop output from a function

2010-05-26 Thread Changbin Du
ent to the global environment rather than the > function's environment. In general this seems risky though as your > function could be overwriting data in your main workspace without you > knowing it. > > HTH, > > Josh > > > > On Wed, May 26, 2010 at 9:26 AM, Changb

[R] how to Store loop output from a function

2010-05-26 Thread Changbin Du
valid.out 987 Fold 8 Dim of tree.pred 1128 2 length of valid.out 1128 Fold 9 Dim of tree.pred 1269 2 length of valid.out 1269 Fold 10 Dim of tree.pred 1410 2 length of valid.out 1410 Minsplit 5 Minbucket 5 10-cross validation is done! if use return, it will print on the screen, you still can no

Re: [R] R eat my data

2010-05-25 Thread Changbin Du
t.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnu

Re: [R] R eat my data

2010-05-25 Thread Changbin Du
> your search (the first place I'll look for is the line where R stop reading. > See if any thing strange there.) > > Also, changing "read.table" to "read.delim" often works. > > ...Tao > > > > > > - Original Message > > From

Re: [R] R eat my data

2010-05-25 Thread Changbin Du
ggest). I encounter this all the time. So try to be very thorough about > your search (the first place I'll look for is the line where R stop reading. > See if any thing strange there.) > > Also, changing "read.table" to "read.delim" often works. > &

Re: [R] R eat my data

2010-05-25 Thread Changbin Du
o > > tail(gene)_name, 2) > > Come on, man, show some initiative. > > On May 25, 2010, at 12:12 PM, Changbin Du wrote: > > 644727344ABC-2 type transporterABC-2 type transporter > 644727345conserved hypothetical proteinconserved hypothetical > protein &g

Re: [R] R eat my data

2010-05-25 Thread Changbin Du
c...@nuuk:~/operon$ grep '^#' id_name_gh5.txt c...@nuuk:~/operon$ no lines starts with # On Tue, May 25, 2010 at 9:11 AM, Barry Rowlingson < b.rowling...@lancaster.ac.uk> wrote: > On Tue, May 25, 2010 at 4:42 PM, Changbin Du wrote: > > HI, Dear R community, > >

Re: [R] R eat my data

2010-05-25 Thread Changbin Du
:42 AM, Changbin Du wrote: > > HI, Dear R community, >> >> My original file has 1932 lines, but when I read into R, it changed to >> 1068 >> lines, how comes? >> > > We are being asked to investigate this quest, how? > > Have you looked at the last line to see

Re: [R] R eat my data

2010-05-25 Thread Changbin Du
ount.fields("id_name_gh5.txt")) > Regards Mohamed > > > > > Changbin Du a écrit : > > HI, Dear R community, >> >> My original file has 1932 lines, but when I read into R, it changed to >> 1068 >> lines, how comes? >> >> >>

[R] R eat my data

2010-05-25 Thread Changbin Du
F, fill=T) > dim(gene_name) [1] 10683 -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927-2856 [[alternative HTML version deleted]] __ R-help@r-p

[R] ROC curve

2010-05-23 Thread Changbin Du
HI, Dear R community, I want to know how to select the optimal decision threshold from the ROC curve? At what threshold will give the highest accuracy? Thanks! -- Sincerely, Changbin -- [[alternative HTML version deleted]] __ R-help@r-projec

Re: [R] col allocation is not right

2010-05-19 Thread Changbin Du
- Phil Spector > Statistical Computing Facility > Department of Statistics > UC Berkeley > spec...@stat.berkeley.edu > > > > On Wed, 19 May

[R] col allocation is not right

2010-05-19 Thread Changbin Du
plot(svm.auc, col=2, main="ROC curves comparing classification performance\n of six machine learning models") legend(0.5, 0.6, c(ns, nb, nr, nt, nl,ne), 2:6, 9) # Draw a legend. plot(bo.auc, col=3, add=T) # add=TRUE draws on the existing chart plot(rf.auc, col=4, add=T) plot(tree.auc, col=5, add=T

Re: [R] get the row sums

2010-05-18 Thread Changbin Du
Thanks, David! Yes, I found it just as you said. It works now after change to numeric. On Tue, May 18, 2010 at 1:53 PM, David Winsemius wrote: > > On May 18, 2010, at 4:32 PM, Changbin Du wrote: > > head(en.id.pr) >>> >>valid.gene_id b.pred rf.pred svm.pred &

[R] get the row sums

2010-05-18 Thread Changbin Du
gave me errors. CAN someone help me with this? -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927-2856 [[alternative HTML version deleted]] __ R-help@r-proje

Re: [R] "rpart": how to use each variable only once?

2010-05-14 Thread Changbin Du
is this random decision tree, I dont know is there any package can run it. If you know, please let me know. On Fri, May 14, 2010 at 10:23 AM, Shi, Tao wrote: > Hi list, > > Is there a way in "rpart" to force the variables only used once when doing > the splits? > > This is how the question cam

Re: [R] exact the variables used in tree construction

2010-05-12 Thread Changbin Du
Thanks so much, David! On Wed, May 12, 2010 at 2:52 PM, David Winsemius wrote: > > On May 12, 2010, at 5:31 PM, Changbin Du wrote: > > fit.dimer <- rpart(as.factor(out) ~ ., method="class", data=p_df) >>> >>> fit.dimer$frame[, "var"] >&

[R] exact the variables used in tree construction

2010-05-12 Thread Changbin Du
> fit.dimer <- rpart(as.factor(out) ~ ., method="class", data=p_df) > > fit.dimer$frame[, "var"] [1] NE WC TA WG WD WW WC [11]CT FC YG QT [21] NW DP DY SK [31] 401 Levels: AA AC AD AE AF AG AH AI AK AL AM AN AP AQ AR AS AT A

[R] how to extract the variables used in decision tree

2010-05-11 Thread Changbin Du
HI, Dear R community, How to extract the variables actually used in tree construction? I want to extract these variables and combine other variable as my features in next step model building. > printcp(fit.dimer) Classification tree: rpart(formula = outcome ~ ., data = p_df, method = "class") V

Re: [R] probabilities in svm output in e1071 package

2010-05-05 Thread Changbin Du
Thanks, Steve and David! svm.fit<-svm(as.factor(out) ~ ., data=all_h, method="C-classification", kernel="radial", cost=bestc, gamma=bestg, cross=10, probability=TRUE) It works this time! On Wed, May 5, 2010 at 6:24 PM, Changbin Du wrote: > Thanks Steve! > >

Re: [R] probabilities in svm output in e1071 package

2010-05-05 Thread Changbin Du
Thanks Steve! I will try and let you know how it comes. On Wed, May 5, 2010 at 6:07 PM, Steve Lianoglou < mailinglist.honey...@gmail.com> wrote: > Hi Changbin, > > On Wed, May 5, 2010 at 6:46 PM, Changbin Du wrote: > > svm.fit<-svm(as.factor(out) ~ ., data=all_h,

[R] probabilities in svm output in e1071 package

2010-05-05 Thread Changbin Du
variable. I trained the model svm.fit in training data. And want to predict the out in the new data set hh. WHy the probabilities are both 0 in 1 and 0 class? -- Sincerely, Changbin -- Changbin Du DOE Joint Genome Institute Bldg 400 Rm 457 2800 Mitchell Dr Walnut Creet, CA 94598 Phone: 925-927

  1   2   >