risk: Methods to Extract and Plot the (Minimal) Risk

Description Usage Arguments Details Value See Also Examples

View source: R/risk.R

Description

Methods to extract the risk from models fitted via cfboost and to print and show the results.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## S3 method for class 'cfboost'
risk(object, ...)
## S3 method for class 'oobag'
plot(x, xlab = "iteration",
     ylab = "risk (= - log likelihood) in validation sample",
     type = "l", mstop = TRUE, xlim = NULL, ...)
## S3 method for class 'inbag'
plot(x, xlab = "iteration",
     ylab = "risk (= - log likelihood) in learning sample",
     type = "l", mstop = TRUE, xlim = NULL, ...)
## S3 method for class 'oobag'
print(x, print = TRUE, ...)
## S3 method for class 'inbag'
print(x, print = TRUE, ...)

Arguments

object

an object of class cfboost.

x

an object of either class oobag or inbag.

xlab

A title for the x axis.

ylab

A title for the y axis.

type

type of plot to be drawn. See plot for more details.

mstop

logic. If mstop = TRUE the optimal stopping iteration is given in the x axis and a vertical line is added to the plot.

xlim

the limits of the x axis, see plot.default. Note: reversed axis are not allowed.

print

logic. If print = TRUE the result is written to the screen. Otherwise the results are only returned invisible.

...

further arguments to be pased on.

Details

The function risk allows to extract the risk (vector) from an object (of class cfboost).

Depending on the type of risk (oobag or inbag) different plotting facilities exist. Note however, that plot.inbag is just a wrapper for plot.oobag with different defaults.

In the same manner a print method is defined for oobag and inbag risk.

Value

risk returns the empirical inbag or out-of-bag risk from a cfboost object.

print returns the given object invvisble.

See Also

for other methods for cfboost objects see methods. See cv for cross-validated risk.

Examples

1
2
## see for example ?CoxFlexBoost-package
## for the usage of risk() and plot(risk()) etc.

CoxFlexBoost documentation built on May 2, 2019, 6:53 p.m.