a data frame or a matrix of predictors, or a formula describing the model to be fitted
y
A response vector. If omitted, tsp.randomForest will run in unsupervised mode.
xtest
a data frame or matrix (like x) containing predictors for the test set.
ytest
response for the test set.
ntree
Number of trees to grow.
type
turn on the ”classification" mode in ”randomForest".
mtry
Number of top scoring pairs randomly sampled as candidates at each split.
replace
Should sampling of cases be done with or without replacement?
classwt
Priors of the classes. Need not add up to one. Ignored for regression.
cutoff
(Classification only) A vector of length equal to number of classes. The 'winning' class for an observation is the one with the maximum ratio of proportion of votes to cutoff. Default is 1/k where k is the number of classes (i.e., majority vote wins).
strata
A (factor) variable that is used for stratified sampling.
sampsize
Size(s) of sample to draw. For classification, if sampsize is a vector of the length the number of strata, then sampling is stratified by strata, and the elements of sampsize indicate the numbers to be drawn from the strata.
nodesize
Minimum size of terminal nodes. Setting this number larger causes smaller trees to be grown (and thus take less time).
maxnodes
Maximum number of terminal nodes trees in the forest can have.
importance
Should importance of top scoring pairs be assessed?
localImp
Should casewise importance measure be computed?
nPerm
Number of times the OOB data are permuted per tree for assessing top scoring pair importance.
proximity
Should proximity measure among the rows be calculated?
oob.prox
Should proximity be calculated only on ”out-of-bag" data?
norm.votes
If TRUE (default), the final result of votes are expressed as fractions. If FALSE, raw vote counts are returned (useful for combining results from different runs). Ignored for regression.
do.trace
If set to TRUE, give a more verbose output as randomForest is run. If set to some integer, then running output is printed for every do.trace trees.
keep.forest
If set to FALSE, the forest will not be retained in the output object. If xtest is given, defaults to FALSE.
keep.inbag
Should an n by ntree matrix be returned that keeps track of which samples are ”in-bag" in which trees (but not how many times, if sampling with replacement)
...
Additional arguments.
Value
call
the original call to randomForest
type
one of regression, classification, or
unsupervised.
predicted
the predicted values of the input data based on
out-of-bag samples.
importance
a matrix with nclass + 2 (for classification)
or two (for regression) columns. For classification, the first
nclass columns are the class-specific measures computed as
mean descrease in accuracy. The nclass + 1st column is the
mean descrease in accuracy over all classes. The last column is the
mean decrease in Gini index. For Regression, the first column is
the mean decrease in accuracy and the second the mean decrease in MSE.
If importance=FALSE, the last measure is still returned as a
vector.
importanceSD
The “standard errors” of the permutation-based
importance measure. For classification, a p by nclass
+ 1 matrix corresponding to the first nclass + 1 columns
of the importance matrix. For regression, a length p vector.
localImp
a p by n matrix containing the casewise importance
measures, the [i,j] element of which is the importance of i-th
variable on the j-th case. NULL if localImp=FALSE.
ntree
number of trees grown.
mtry
number of predictors sampled for spliting at each node.
forest
(a list that contains the entire forest; NULL if
randomForest is run in unsupervised mode or if
keep.forest=FALSE.
err.rate
(classification only) vector error rates of the
prediction on the input data, the i-th element being the (OOB) error rate
for all trees up to the i-th.
confusion
(classification only) the confusion matrix of the
prediction (based on OOB data).
votes
(classification only) a matrix with one row for each
input data point and one column for each class, giving the fraction
or number of (OOB) ‘votes’ from the random forest.
oob.times
number of times cases are ‘out-of-bag’ (and thus used
in computing OOB error estimate)
proximity
if proximity=TRUE when
randomForest is called, a matrix of proximity measures among
the input (based on the frequency that pairs of data points are in
the same terminal nodes).
mse
(regression only) vector of mean square errors: sum of squared
residuals divided by n.
if test set is given (through the xtest or additionally
ytest arguments), this component is a list which contains the
corresponding predicted, err.rate, confusion,
votes (for classification) or predicted, mse and
rsq (for regression) for the test set. If
proximity=TRUE, there is also a component, proximity,
which contains the proximity among the test set as well as proximity
between test and training data.
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(BigTSP)
Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-5
Loading required package: tree
Loading required package: randomForest
randomForest 4.6-12
Type rfNews() to see new features/changes/bug fixes.
Loading required package: gbm
Loading required package: survival
Loading required package: lattice
Loading required package: splines
Loading required package: parallel
Loaded gbm 2.1.1
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BigTSP/tsp.randomForest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: tsp.randomForest
> ### Title: Classification with Random Forest based on Top Scoring Pairs
> ### Aliases: tsp.randomForest
> ### Keywords: ~kwd1 ~kwd2
>
> ### ** Examples
>
> library(randomForest)
> x=matrix(rnorm(100*20),100,20)
> y=rbinom(100,1,0.5)
> y=as.factor(y)
> fit=tsp.randomForest(x,y)
> predict(fit,x[1:10,])
1 2 3 4 5 6 7 8 9 10
1 0 1 0 1 0 1 1 1 0
Levels: 0 1
> plot(fit)
>
>
>
>
>
> dev.off()
null device
1
>