I've got a PhD student starting this year. She'll be working on data mining. She has asked for a reading list while she's still in her home country, which is a really good sign. Her cosupervisor and I don't (think we) have any problem with choosing things that are specifically about data mining, but there are some statistical ideas (sampling, exploratory-vs-confirmatory, clustering) where I have things on my shelves I can recommend but wouldn't mind advice. But above all, I would like her to use R whenever it's appropriate. We have MASS and Dalgaard's introductory book in the library here, I'm aware of "S Poetry", but what do you think would be the best start for someone learning R in order to use it for doing data mining?
Hi,> -----Original Message----- > But above all, I would like her to use R whenever it's appropriate. > We have MASS and Dalgaard's introductory book in the library here, I'm > aware of "S Poetry", but what do you think would be the best start for > someone learning R in order to use it for doing data mining?Not specifically for R, but a must-have for anyone going into data mining area is "The Elements of Statistical Learning: Data Mining, Inference, and Prediction", by Hastie et. al. Kevin -------------------------------------------- Ko-Kang Kevin Wang, MSc(Hon) SLC Stats Workshops Co-ordinator The University of Auckland New Zealand
> From: Ko-Kang Kevin Wang > > Hi, > > > -----Original Message----- > > But above all, I would like her to use R whenever it's appropriate. > > We have MASS and Dalgaard's introductory book in the > library here, I'm > > aware of "S Poetry", but what do you think would be the > best start for > > someone learning R in order to use it for doing data mining? > > Not specifically for R, but a must-have for anyone going into > data mining > area is "The Elements of Statistical Learning: Data Mining, > Inference, and Prediction", by Hastie et. al.I would add BDR's 1996 Pattern Recognition and Neural Networks, and FEH's 2002 Regression Modeling Strategies. Even though Prof. Harrell's book is not strictly about data mining, it has lots of things that dataminers need to know about, or at least be aware of, IMHO. Andy> Kevin > > -------------------------------------------- > Ko-Kang Kevin Wang, MSc(Hon) > SLC Stats Workshops Co-ordinator > The University of Auckland > New Zealand > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html > >------------------------------------------------------------------------------ Notice: This e-mail message, together with any attachments,...{{dropped}}
vtas@uosis.mif.vu.lt
2004-Feb-09 14:34 UTC
[R] PhD student reading list, suggestions wanted
Hi, maybe "Data Data Mining with R: learning by case studies" by Luis Torgo (http://www.liacc.up.pt/~ltorgo/DataMiningWithR/) will be usefull. Vytautas Maniusis, Vilnius University, Lithuania
Hello, I have a program with this section: .. for(i in 1:20){ lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) beta[i] <- lo$m$getPars()[4] } .. If the fit works this is OK but if the fit fails, the whole program fails so: .. for(i in 1:20){ try(lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) beta[i] <- lo$m$getPars()[4] } .. but the try catches the error in nls and beta[i] gets assigned beta[i-1] from the previous loop. This is bad but no so bad as it can be checked, Now in some cases the error is in i=1 and the program stops!! is there a way to set lo$m$getPars() to zero before the call? I tried to understand the use of tryCatch() but frankly it is above me. Sorry Thanks for any help Heberto Ghezzo Meakins-Christie Labs
r.ghezzo wrote:> Hello, I have a program with this section: > .. > for(i in 1:20){ > lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) > beta[i] <- lo$m$getPars()[4] > } > .. > If the fit works this is OK but if the fit fails, the whole program > fails so: > .. > for(i in 1:20){ > try(lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) > beta[i] <- lo$m$getPars()[4] > } > .. > but the try catches the error in nls and beta[i] gets assigned beta[i-1] > from the previous loop. This is bad but no so bad as it can be checked, > Now in some cases the error is in i=1 and the program stops!! > is there a way to set lo$m$getPars() to zero before the call? > I tried to understand the use of tryCatch() but frankly it is above me. > Sorry > Thanks for any help > Heberto Ghezzo > Meakins-Christie Labs >How about: beta[i] <- if(data.class(lo) == "Error") 0 else lo$m$getPars()[4] -sundar
Dear Heberto, beta is a vector? Then something like lo <- try(nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) beta[i] <- if (class(lo) == "try-error") NA else lo$m$getPars()[4] might do what you want. John On Mon, 09 Feb 2004 14:30:07 -0500 "r.ghezzo" <heberto.ghezzo at mcgill.ca> wrote:> Hello, I have a program with this section: > .. > for(i in 1:20){ > lo <- > nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) > beta[i] <- lo$m$getPars()[4] > } > .. > If the fit works this is OK but if the fit fails, the whole program > fails so: > .. > for(i in 1:20){ > try(lo <- > nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) > beta[i] <- lo$m$getPars()[4] > } > .. > but the try catches the error in nls and beta[i] gets assigned > beta[i-1] from the previous loop. This is bad but no so bad as it can > be checked, > Now in some cases the error is in i=1 and the program stops!! > is there a way to set lo$m$getPars() to zero before the call? > I tried to understand the use of tryCatch() but frankly it is above > me. Sorry > Thanks for any help > Heberto Ghezzo > Meakins-Christie Labs > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
On Mon, 9 Feb 2004, r.ghezzo wrote:> Hello, I have a program with this section: > .. > for(i in 1:20){ > lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) > beta[i] <- lo$m$getPars()[4] > } > .. > If the fit works this is OK but if the fit fails, the whole program > fails so: > .. > for(i in 1:20){ > try(lo <- > nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) > beta[i] <- lo$m$getPars()[4] > } > .. > but the try catches the error in nls and beta[i] gets assigned beta[i-1] > from the previous loop. This is bad but no so bad as it can be checked,You want either both assignments inside the try() try({ lo<-nls(....) beta[i]<-lo$m$getPars(4) }) or both outside lo<- try(nls(....)) if (inherits(lo,"try-error")) beta[i]<-NA else beta[i]<-lo$m$getPars()[4] -thomas
Just check the class() of the lo. You could try something like this... for(i in 1:20){ lo <- try(nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) if (class(lo)=="try-error") beta[i]=NA else beta[i] <- lo$m$getPars()[4] } Hth Andrej _________ Andrej Kveder, M.A. researcher Institute of Medical Sciences SRS SASA; Novi trg 2, SI-1000 Ljubljana, Slovenia phone: +386 1 47 06 440 fax: +386 1 42 61 493 -----Original Message----- From: r-help-bounces at stat.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of r.ghezzo Sent: Monday, February 09, 2004 8:30 PM To: r-help at stat.math.ethz.ch Subject: [R] how to use try() Hello, I have a program with this section: .. for(i in 1:20){ lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) beta[i] <- lo$m$getPars()[4] } .. If the fit works this is OK but if the fit fails, the whole program fails so: .. for(i in 1:20){ try(lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) beta[i] <- lo$m$getPars()[4] } .. but the try catches the error in nls and beta[i] gets assigned beta[i-1] from the previous loop. This is bad but no so bad as it can be checked, Now in some cases the error is in i=1 and the program stops!! is there a way to set lo$m$getPars() to zero before the call? I tried to understand the use of tryCatch() but frankly it is above me. Sorry Thanks for any help Heberto Ghezzo Meakins-Christie Labs ______________________________________________ R-help at stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
You could also put both statements inside the try block: for(i in 1:20){ try({ lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) beta[i] <- lo$m$getPars()[4] }) } Now beta[i] will only be assigned if nls runs without error. Hadley r.ghezzo wrote:> Hello, I have a program with this section: > .. > for(i in 1:20){ > lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) > beta[i] <- lo$m$getPars()[4] > } > .. > If the fit works this is OK but if the fit fails, the whole program > fails so: > .. > for(i in 1:20){ > try(lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) > beta[i] <- lo$m$getPars()[4] > } > .. > but the try catches the error in nls and beta[i] gets assigned beta[i-1] > from the previous loop. This is bad but no so bad as it can be checked, > Now in some cases the error is in i=1 and the program stops!! > is there a way to set lo$m$getPars() to zero before the call? > I tried to understand the use of tryCatch() but frankly it is above me. > Sorry > Thanks for any help > Heberto Ghezzo > Meakins-Christie Labs > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! > http://www.R-project.org/posting-guide.html
Check the function nlsList in package nlme. It does something very like what you want to do. "r.ghezzo" <heberto.ghezzo at mcgill.ca> writes:> Hello, I have a program with this section: > .. > for(i in 1:20){ > lo <- nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1)) > beta[i] <- lo$m$getPars()[4] > } > .. > If the fit works this is OK but if the fit fails, the whole program > fails so: > > .. > for(i in 1:20){ > try(lo <- > > nls(y~y0+a/(1+(x/x0)^b),start=list(y0=0.1,a=a0,x0=x00,b=-8.1))) > beta[i] <- lo$m$getPars()[4] > }It is not a good idea to use lo$m$getPars() directly. It is better to use the generic function, which in this case is coef(), as in coef(lo)[4]