Displaying 20 results from an estimated 200 matches similar to: "User-defined functions in rpart"
2011 Nov 07
2
help with programming
>
>
Dear moderators,
Please help me encode the program instructed by follows.
Thank u!
Apply the methods introduced in Sections 4.2.1 and 4.2.2, say the
> rank-based variable selection and BIC criterions, to the Boston housing
> data.
>
The Boston housing data contains 506 observations, and is publicly
available in the R package mlbench (dataset “BostonHousing”).
The
2008 Sep 18
1
caret package: arguments passed to the classification or regression routine
Hi,
I am having problems passing arguments to method="gbm" using the train()
function.
I would like to train gbm using the laplace distribution or the quantile
distribution.
here is the code I used and the error:
gbm.test <- train(x.enet, y.matrix[,7],
method="gbm",
distribution=list(name="quantile",alpha=0.5), verbose=FALSE,
2012 Mar 05
1
Forward stepwise regression using lmStepAIC in Caret
I'm looking for guidance on how to implement forward stepwise regression
using lmStepAIC in Caret.
The stepwise "direction" appears to default to "backward". When I try to
use "scope" to provide a lower and upper model, Caret still seems to
default to "backward".
Any thoughts on how I can make this work?
Here is what I tried:
itemonly <-
2010 Sep 20
2
how to seperate " "? or how to do regression on each variable when I have multiple variables?
Dear All,
I have data which contains 14 variables. And I have to regress one of
variables on each variable (simple 13 linear regressions)
I try to make a loop and store only R-squared
colnames(boston)
[1] "CRIM" "ZN" "INDUS" "CHAS" "NOX" "RM" "AGE"
[8] "DIS" "RAD"
2002 Feb 21
0
plot.hclust: strange behaviour with "manufactured"
This worked for me with your example:
source("dumpdata.R")
storage.mode(x.hc$merge) <- "integer"
plot(x.hc)
(R-1.4.1 compiled from source on WinNT4.)
Andy
> -----Original Message-----
> From: Hugh Chipman [mailto:hachipma at icarus.math.uwaterloo.ca]
> Sent: Wednesday, February 20, 2002 5:32 PM
> To: andy_liaw at merck.com
> Cc: r-help at stat.math.ethz.ch
2002 Feb 20
1
plot.hclust: strange behaviour with "manufactured" hclust object
I've been trying to get plot.hclust to work with a hclust object I
created and have not had much success. It seems that there is some
"hidden" characteristic of a hclust object that I can't see. This is
most easily seen in the following example, where plot.hclust works on
one object, but when this object is "dumped" and then re-read,
plot.hclust no longer works. Is
2009 Jul 06
1
mlbench dataset question
Dear R-users,
Recently, I am facing some problems when converting mlbench data into matrix
format.
library(mlbench)
data(BostonHousing)
X<- BostonHousing[,1:13]
y<-BostonHousing[,14]
I want to convert X and y into matrix form. I am getting these obvious
errors...
> t(X)%*%y
Error in t(X) %*% y : requires numeric/complex matrix/vector arguments
> t(as.matrix(X))%*%(as.matrix(y))
2003 Mar 24
2
Problem with the step() function
Dear all,
I'm having some problems with using the step() function inside another
function. I think it is an environment problem but I do not know how to
overcome it. Any suggestions are appreciated.
I've prepared a simple example to illustrate my problem:
> library(MASS)
> data(Boston)
> my.fun <- function(dataset) {
+ l <- lm(medv ~ .,data=dataset)
+ final.l <-
2009 Nov 17
2
SVM Param Tuning with using SNOW package
Hello,
Is the first time I am using SNOW package and I am trying to tune the cost
parameter for a linear SVM, where the cost (variable cost1) takes 10 values
between 0.5 and 30.
I have a large dataset and a pc which is not very powerful, so I need to
tune the parameters using both CPUs of the pc.
Somehow I cannot manage to do it. It seems that both CPUs are fitting the
model for the same values
2008 Mar 03
2
Constrained regression
Dear list members,
I am trying to get information on how to fit a linear regression with
constrained parameters. Specifically, I have 8 predictors , their
coeffiecients should all be non-negative and add up to 1. I understand it is
a quadratic programming problem but I have no experience in the subject. I
searched the archives but the results were inconclusive.
Could someone provide suggestions
2011 Jul 29
3
help with plot.rpart
? data=read.table("http://statcourse.com/research/boston.csv", , sep=",",
header = TRUE)
? library(rpart)
? fit=rpart (MV~ CRIM+ZN+INDUS+CHAS+NOX+RM+AGE+DIS+RAD+TAX+ PT+B+LSTAT)
Please: Show me the tree.
Mark
-------- Original Message --------
Subject: Re: [R] help with rpart
From: "Stephen Milborrow" <[1]milbo at sonic.net>
2023 May 25
4
environments: functions within functions
Hi,
I ran into a problem with S3 method dispatch and scoping while trying
to use functions from the mixR package within my own functions. I know
enough to find the problem (I think!), but not enough to fix it
myself. The problem isn't really a package-specific problem, so I'm
starting here, and will file an issue with the maintainer once I have
a solution.
Detailed explanation below, but
2007 Aug 16
3
multiple colors within same line of text
Hi, I'm interested in using mtext(), but with the option of having multiple
colors in the same line of text.
For example, creating a line of text where:
Red is red and blue is blue
How do you create a text argument that lets you do this within mtext()?
Thanks,
Andrew
MGH Cancer Center
[[alternative HTML version deleted]]
2000 Nov 29
1
Step function
I am having problem using the step function for a linear regression model. I've created an initial model containing only the intercept. Then using the step function, I've selected three variables to be considered for the model.
> x0.lm<- lm(MEDV~1, data = x)
>
> anova(x0.lm)
Analysis of Variance Table
Response: MEDV
Df Sum Sq Mean Sq F value Pr(>F)
2005 Feb 25
0
Problem using stepAIC/addterm (MASS package)
Hello,
I'm currently dealing with a rather strange problem when using the
function "stepAIC" ("MASS" package). The setting is the following: From
model learning data sets ("learndata"), I want to be able to build
prediction functions (in order to save them in a file for further use).
This is done by the function "pred.function" (see below). Therein,
2003 Jun 18
3
update.default bugfix (PR#3288)
According to the man page for formula, "a formula object has an associated
environment". However, update.default doesn't use this environment, which
creates problems like the following:
make.model <- function(x) { lm(medv~.,x) }
library(MASS)
data(Boston)
fit = make.model(Boston)
fit = update(fit,".~.-crim")
# Object "x" not found
Here is a
2010 Oct 31
2
Constrained Regression
Hello everyone,
I have 3 variables Y, X1 and X2. Each variables lies between 0 and 1. I want
to do a constrained regression such that a>0 and (1-a) >0
for the model:
Y = a*X1 + (1-a)*X2
I tried the help on the constrained regression in R but I concede that it
was not helpful.
Any help is greatly appreciated
--
Thanks,
Jim.
[[alternative HTML version deleted]]
2011 Apr 27
0
Rule-based regression models: Cubist
Cubist is a rule-based machine learning model for regression. Parts of the
Cubist model are described in:
Quinlan. Learning with continuous classes. Proceedings
of the 5th Australian Joint Conference On Artificial
Intelligence (1992) pp. 343-348
Quinlan. Combining instance-based and model-based
learning. Proceedings of the Tenth International Conference
on Machine Learning
2011 Apr 27
0
Rule-based regression models: Cubist
Cubist is a rule-based machine learning model for regression. Parts of the
Cubist model are described in:
Quinlan. Learning with continuous classes. Proceedings
of the 5th Australian Joint Conference On Artificial
Intelligence (1992) pp. 343-348
Quinlan. Combining instance-based and model-based
learning. Proceedings of the Tenth International Conference
on Machine Learning
2006 Mar 28
1
hybridHclust (new package)
I'd like to announce the availability of a new library for hybrid
hierarchical clustering, "hybridHclust". The library has been uploaded
to CRAN and is now available.
The library implements a hybrid of top-down and bottom-up hierarchical
clustering. Along the way, the idea of a "mutual cluster" is developed.
A mutual cluster is a set of observations whose largest