Displaying 20 results from an estimated 300 matches similar to: "lm on matrix data"
2017 Aug 23
1
cross validation in random forest using rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package
2017 Aug 23
2
cross validation in random forest rfcv functin
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I don't know how to build trianx and trainy for my data set, and I could not understand the way trainx is built in the package
2017 Aug 23
0
cross validation in random forest using rfcv functin
Any responds?!
On Wednesday, August 23, 2017 5:50 AM, Elahe chalabi via R-help <r-help at r-project.org> wrote:
Hi all,
I would like to do cross validation in random forest using rfcv function. As the documentation for this package says:
rfcv(trainx, trainy, cv.fold=5, scale="log", step=0.5, mtry=function(p) max(1, floor(sqrt(p))), recursive=FALSE, ...)
however I
2013 Apr 15
1
Imputation with SOM using kohonen package
I have a data set with 10 variables, and about 8000 instances (or
objects/rows/samples). In addition I have one more ('class') variable that
I have about 10 instances for, but for which I wish to impute values for.
I am a little confused how to go about doing this, mostly as I'm not
well-versed in it. Do I train the SOM with a data object that contains just
the first 10 variables
2010 Mar 30
1
predict.kohonen for SOM returns NA?
All,
The kohonen predict function is returning NA for SOM predictions
regardless of data used... even the package example for a SOM using
wine data is returning NA's
Does anyone have a working example SOM. Also, what is the purpose of
trainY, what would be the dependent data for an unsupervised SOM?
As may be apparent to you by my questions, I am very new to kohonen
maps and am very grateful
2012 May 16
1
survival survfit with newdata
Dear all,
I am confused with the behaviour of survfit with newdata option.
I am using the latest version R-2-15-0. In the simple example below I am building a coxph model on 90 patients and trying to predict 10 patients. Unfortunately the survival curve at the end is for 90 patients. Could somebody please from the survival package confirm that this behaviour is as expected or not - because I
2010 Nov 30
5
how to know if a file exists on a remote server?
Hi,
I'd like to download some data files from a remote server, the problem
here is that some of the files actually don't exist, which I don't
know before try. Just wondering if a function in R could tell me if a
file exists on a remote server? I searched this mailing list and after
read severals mails, still clueless. Any help will be highly
appreciated.
B.C.
2007 Mar 22
3
"digits" doesn't work in format function
Dear All,
I was trying to format a numeric vector (100*1) by using
outd <- format(x=m, sci=F, digits=2)
> outd[1:10]
[1] " 0.01787758" "-0.14760306" "-0.45806041" "-0.67858525" "-0.64591748"
[6] "-0.05918100" "-0.25632276" "-0.15980138" "-0.08359873" "-0.37866688"
>m[1:10]
[1]
2011 Jun 02
1
aucRoc in caret package [SEC=UNCLASSIFIED]
Hi all,
I used the following code and data to get auc values for two sets of predictions:
library(caret)
> table(predicted1, trainy)
trainy
hard soft
1 27 0
2 11 99
> aucRoc(roc(predicted1, trainy))
[1] 0.5
> table(predicted2, trainy)
trainy
hard soft
1 27 2
2 11 97
> aucRoc(roc(predicted2, trainy))
[1] 0.8451621
predicted1:
1 1 2
2011 May 16
2
about spearman and kendal correlation coefficient calculation in "cor"
Hi,
I have the following two measurements stored in mat:
> print(mat)
[,1] [,2]
[1,] -14.80976 -265.786
[2,] -14.92417 -54.724
[3,] -13.92087 -58.912
[4,] -9.11503 -115.580
[5,] -17.05970 -278.749
[6,] -25.23313 -219.513
[7,] -19.62465 -497.873
[8,] -13.92087 -659.486
[9,] -14.24629 -131.680
[10,] -20.81758 -604.961
[11,] -15.32194 -18.735
To calculate the ranking
2012 Nov 27
2
in par(mfrow=c(1, 2)), how to keep one half plot static and the other half changing
Hi,
I'm trying to plot something in the following way and would like if
you could help:
I'd like in a same plot window, two plots are shown, the left one is a
bird-view plot of the whole data, the right half keep changing, i.e.,
different plots will be shown up on request, so that when I
select/click on some where in the left plot, the right plot will be
the corresponding plot.
What I
2012 Mar 08
2
Regarding randomForest regression
Sir,
This query is related to randomForest regression using R.
I have a dataset called qsar.arff which I use as my training set and
then I run the following function -
rf=randomForest(x=train,y=trainy,xtest=train,ytest=trainy,ntree=500)
where train is a matrix of predictors without the column to be
predicted(the target column), trainy is the target column.I feed the same
data
2011 Jan 24
5
Train error:: subscript out of bonds
Hi,
I am trying to construct a svmpoly model using the "caret" package (please
see code below). Using the same data, without changing any setting, I am
just changing the seed value. Sometimes it constructs the model
successfully, and sometimes I get an ?Error in indexes[[j]] : subscript out
of bounds?.
For example when I set seed to 357 following code produced result only for 8
Please help me!!!! Error in `[.data.frame`(x, , retained, drop = FALSE) : undefined columns selected
2010 Jan 02
1
Please help me!!!! Error in `[.data.frame`(x, , retained, drop = FALSE) : undefined columns selected
I am learning the package "caret", after I do the "rfe" function, I get the
error ,as follows:
Error in `[.data.frame`(x, , retained, drop = FALSE) :
undefined columns selected
In addition: Warning message:
In predict.lm(object, x) :
prediction from a rank-deficient fit may be misleading
I try to that manual example, that is good, my data is wrong. I do not know
what
2010 Dec 06
1
use pcls to solve least square fitting with constraints
Hi,
I have a least square fitting problem with linear inequality
constraints. pcls seems capable of solving it so I tried it,
unfortunately, it is stuck with the following error:
> M <- list()
> M$y = Dmat[,1]
> M$X = Cmat
> M$Ain = as.matrix(Amat)
> M$bin = rep(0, dim(Amat)[1])
> M$p=qr.solve(as.matrix(Cmat), Dmat[,1])
> M$w = rep(1, length(M$y))
> M$C = matrix(0,0,0)
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,
2003 Oct 31
2
Summing elements in a list
Hi,
Suppose that I have a list where each component is a list of two
matrices. I also have a vector of weights. How can I collapse my
list of lists into a single list of two matrices where each matrix
in the result is the weighted sum of the corresponding matrices.
I could use a loop but this is a nested calculation so I was hoping
there is a more efficient way to do this. To help clarify,
2006 Mar 29
6
which function to use to do classification
Dear All,
I have a data, suppose it is an N*M matrix data. All I want is to classify it into, let see, 3 classes. Which method(s) do you think is(are) appropriate for this purpose? Any reference will be welcome! Thanks!
Best,
Baoqiang Cao
2005 Jun 01
7
Which variable exist after random
Dear R-helper,
How could I count only some variable was exist after running sample
(random) function.
For example,
> testx <- factor(c("Game","Paper","Internet","Time","Money"))
> for(i in 1:2) {
+ x <- sample(testx,replace=TRUE)
+ print(x)
+ }
[1] Money Money Time Internet Time
Levels: Game Internet
2011 Sep 02
2
How to keep the same class?
Hello
Please see the example below
> class(testX)
[1] "matrix"
> class(testX[1,])
[1] "numeric"
Why not matrix? What am I missing here? Is there a way to keep the same
class?
The reason for the question is that I want to implement a k-step ahead
prediction for my own routines and R wrecks does not seem to like [1,] as
shown below.
>