print.logreg: Prints Logic Regression Output

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

View source: R/LogicReg.R

Description

Prints formulas for objects fitted by logreg.

Usage

1
2
## S3 method for class 'logreg'
print(x, nms, notnms, pstyle, ...)

Arguments

x

object of class logreg, typically the result of the function logreg.

nms

names of variables. If nms is provided variable names will be printted, otherwise x$binnames will be used. If that does not exist indices will be used.

notnms

names of complements of the variables. If notnms is not provided “not” will be added before the variable names.

pstyle

parenthesis style. If pstyle = 1 (the default) rules are more compact than if pstyle = 2.

...

other options are ignored

Value

If x$select equals 1 or 2 the fitted logic rule(s) are generated as a text string. Scores, and if x$select equals 2 or 6 modelsizes, are also provided. If x$select equals 4 or 5 a summary of the permutation test(s) is printed. If x$select equals 3 a summary of the cross validation is printed. If x$select is equal to 7 an error message is generated.

Author(s)

Ingo Ruczinski [email protected] and Charles Kooperberg [email protected].

References

Ruczinski I, Kooperberg C, LeBlanc ML (2003). Logic Regression, Journal of Computational and Graphical Statistics, 12, 475-511.

Ruczinski I, Kooperberg C, LeBlanc ML (2002). Logic Regression - methods and software. Proceedings of the MSRI workshop on Nonlinear Estimation and Classification (Eds: D. Denison, M. Hansen, C. Holmes, B. Mallick, B. Yu), Springer: New York, 333-344.

See Also

logreg, print.logregmodel, print.logregtree, logreg.testdat

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
data(logreg.savefit1,logreg.savefit2,logreg.savefit3,logreg.savefit4,
     logreg.savefit5,logreg.savefit6)
#
# fit a single model
# myanneal <- logreg.anneal.control(start = -1, end = -4, iter = 25000, update = 1000)
# logreg.savefit1 <- logreg(resp = logreg.testdat[,1], bin=logreg.testdat[, 2:21],
#                type = 2, select = 1, ntrees = 2, anneal.control = myanneal)
# the best score should be in the 0.96-0.98 range
print(logreg.savefit1)
#
# fit multiple models
# myanneal2 <- logreg.anneal.control(start = -1, end = -4, iter = 25000, update = 0)
# logreg.savefit2 <- logreg(select = 2, ntrees = c(1,2), nleaves =c(1,7),
#                oldfit = logreg.savefit1, anneal.control = myanneal2)
print(logreg.savefit2)
# After an initial steep decline, the scores only get slightly better
# for models with more than four leaves and two trees.
#
# cross validation
# logreg.savefit3 <- logreg(select = 3, oldfit = logreg.savefit2)
print(logreg.savefit3)
# 4 leaves, 2 trees should give the best test set score
#
# null model test
# logreg.savefit4 <- logreg(select = 4, anneal.control = myanneal2, oldfit = logreg.savefit1)
print(logreg.savefit4)
# A summary of the permutation test
#
# Permutation tests
# logreg.savefit5 <- logreg(select = 5, oldfit = logreg.savefit2)
print(logreg.savefit5)
# A table summarizing the permutation tests
#
# a greedy sequence
# logreg.savefit6 <- logreg(select = 6, ntrees = 2, nleaves =c(1,12), oldfit = logreg.savefit1)
print(logreg.savefit6)

LogicReg documentation built on June 15, 2018, 1:04 a.m.