Re: [R] Problem Creating Partial Dependence Plot

2014-05-30 Thread Stephen Milborrow
Jane Shevtsov wrote: I am trying to use the plotmo package to generate a partial dependence plot for a CART model created with rpart. When running plotmo, I get "Error: get.plotmo.y returned the wrong length (got 204938 expected 205000)". The rpart predict function does indeed return 204938 res

Re: [R] inverse for formula transformations on LHS

2013-05-18 Thread Stephen Milborrow
Paul Johnson wrote: m1 <- lm(log(y) ~ log(x), data = dat) termplot shows log(y) on the vertical. What if I want y on the vertical? plotmo in the plotmo package has an inverse.func argument, so something like the following might work for you? library(MASS) library(plotmo) log.brain <- log(An

Re: [R] substitute games with randomForest::partialPlot

2011-09-16 Thread Stephen Milborrow
Johann Hibschman wrote: I'm having trouble calling randomForest::partialPlot programmatically. It tries to use name of the (R) variable as the data column name. You may want to consider looking at plotmo (in the plotmo package) which doesn't have the above issue. library(randomForest) library

Re: [R] rpart/tree issue

2011-09-08 Thread Stephen Milborrow
"Brian Jensvold" het geskryf I am trying to create a classification tree using either tree or rpart but when it comes to plotting the results the formatting I get is different than what I see in all the tutorials. What I would like to see is the XX/XX format but all I get is a weird decimal val

Re: [R] rpart: apply tree to new data to get "counts"

2011-08-30 Thread Stephen Milborrow
Jay het geskryf When I have made a decision tree with rpart, is it possible to "apply" this tree to a new set of data in order to find out the distribution of observations? Ideally I would like to plot my original tree, with the counts (at each node) of the new data. Sadly, neither plot.rpart

Re: [R] rpart: plot without scientific notation

2011-08-26 Thread Stephen Milborrow
Jay wrote: While I'm very pleased with the results I get with rpart and rpart.plot, I would like to change the scientific notation of the dependent variable in the plots into integers. Right now all my 5 or more digit numbers are displayed using scientific notation. One way of getting rpart.pl

[R] Error: bad index in plotmo functions for MARS model (package earth)

2011-07-22 Thread Stephen Milborrow
On 2011-07-28 12:14:32, Cleber N.Borges wrote: I am tring make a simple surface plot ( 2 by 2 terms of a MARS model (with earth package) but I get the follow error message: > library( earth ) > data( gasoline, package='pls' ) > nir <- gasoline$NIR > class( nir ) [1] "AsIs" > oct <- gasol

Re: [R] selection of hinge function with restrictions, machine learning, earth package,

2011-03-14 Thread Stephen Milborrow
On 2011-01-27 14:22, Rasti Matus wrote: I have a few questions regarding machine learning packages in R, e.g. earth package ... 1) How could I force the algorithm to generate knots only with values < 90 for variable doy? Not possible in the current implementation. In principle it would be po

Re: [R] Problems with mars in R in the case of nonlinear functions

2008-06-13 Thread Stephen Milborrow
| I'm trying to use mars function in R to interpolate nonlinear | multivariate functions. | However, it seems that mars gives me a fit which uses only very few | basis function and it underfits very badly. Try the "earth" package which extends the mars function in the mda package. Your example be