tsp.gbm: Fits generalized boosted logistic regression models based on...

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/LDCA.R

Description

Fits generalized boosted logistic regression models based on Top Scoring Pairs.

Usage

1
tsp.gbm(x, y, offset = NULL, misc = NULL, distribution = "bernoulli", w = NULL, var.monotone = NULL, n.trees = 100, interaction.depth = 1, n.minobsinnode = 10, shrinkage = 0.001, bag.fraction = 0.5, train.fraction = 1, keep.data = TRUE, verbose = TRUE)

Arguments

x

input matrix, of dimension nobs x nvars; each row is an observation vector.

y

response variable.

offset

a vector of values for the offset

misc

is an R object that is simply passed on to the gbm engine. (refer to "gbm.fit" function in the "gbm" package)

distribution

A character string specifying the name of the distribution to use or a list with a component. The default value is "bernoulli" for logistic regression.

w

w is a vector of weights of the same length as the y.

var.monotone

an optional vector, the same length as the number of predictors, indicating which variables have a monotone increasing (+1), decreasing (-1), or arbitrary (0) relationship with the outcome.

n.trees

the total number of trees to fit. This is equivalent to the number of iterations and the number of basis functions in the additive expansion.

interaction.depth

The maximum depth of variable interactions. 1 implies an additive model, 2 implies a model with up to 2-way interactions, etc.

n.minobsinnode

minimum number of observations in the trees terminal nodes. Note that this is the actual number of observations not the total weight.

shrinkage

a shrinkage parameter applied to each tree in the expansion. Also known as the learning rate or step-size reduction.

bag.fraction

the fraction of the training set observations randomly selected to propose the next tree in the expansion.

train.fraction

The first train.fraction * nrows(data) observations are used to fit the gbm and the remainder are used for computing out-of-sample estimates of the loss function.

keep.data

a logical variable indicating whether to keep the data and an index of the data stored with the object.

verbose

If TRUE, tsp.gbm will print out progress and performance indicators.

Value

See "gbm" package for returned values

Author(s)

Xiaolin Yang, Han Liu

References

See references for the "gbm" package.

See Also

predict.tsp.gbm

Examples

1
2
3
4
5
library(gbm)
x=matrix(rnorm(100*20),100,20)
y=rbinom(100,1,0.5)
fit=tsp.gbm(x,y)
predict(fit,x[1:10,],n.trees=5)

Example output

Loading required package: glmnet
Loading required package: Matrix
Loading required package: foreach
Loaded glmnet 2.0-16

Loading required package: tree
Loading required package: randomForest
randomForest 4.6-14
Type rfNews() to see new features/changes/bug fixes.
Loading required package: gbm
Loaded gbm 2.1.4
Iter   TrainDeviance   ValidDeviance   StepSize   Improve
     1        1.3858            -nan     0.0010   -0.0001
     2        1.3857            -nan     0.0010   -0.0000
     3        1.3855            -nan     0.0010   -0.0000
     4        1.3853            -nan     0.0010    0.0001
     5        1.3852            -nan     0.0010    0.0000
     6        1.3850            -nan     0.0010    0.0001
     7        1.3849            -nan     0.0010   -0.0002
     8        1.3848            -nan     0.0010   -0.0000
     9        1.3846            -nan     0.0010   -0.0000
    10        1.3844            -nan     0.0010    0.0001
    20        1.3827            -nan     0.0010   -0.0001
    40        1.3793            -nan     0.0010   -0.0001
    60        1.3762            -nan     0.0010    0.0001
    80        1.3734            -nan     0.0010    0.0000
   100        1.3707            -nan     0.0010   -0.0000

Warning message:
In gbm.fit(newx, y, offset = offset, misc = misc, distribution = distribution,  :
  Parameter `train.fraction` is deprecated, please specify `nTrain` instead.
 [1] -0.04041397 -0.03872335 -0.03734438 -0.04012260 -0.04018410 -0.04035668
 [7] -0.04313489 -0.03874362 -0.04054532 -0.03878486

BigTSP documentation built on May 2, 2019, 6:09 a.m.

Related to tsp.gbm in BigTSP...