bc_estimate: Wrapper for Binary Classification Estimation

Description Usage Arguments Details Value Examples

Description

Fits different types of models for binary classification to a training subset of data, and then computes fit metrics over a test subset.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
bc_estimate(type, dat, control = NULL)

is.bc_estimate(x)

## S3 method for class 'bc_estimate'
coef(x, int = FALSE, sig = T)

## S3 method for class 'bc_estimate'
subset(x, train = F, metric = "AUC")

## S3 method for class 'bc_estimate'
levels(x)

## S3 method for class 'bc_estimate'
dimnames(x)

## S3 method for class 'bc_estimate'
print(x, digits = 2, metric = "AUC")

## S3 method for class 'bc_estimate'
features(x)

Arguments

type

The type of fitting algorithm. Options include glm and glmnet.

dat

An R object of class train_test.

control

An optional list of additional estimation parameters.

Details

The control argument is a list that can supply any of the following components:

The method subset can extract the specified fit metric for either the training (train = TRUE) or test subsets. The features method extracts the labels for the predictors deemed significant.

Value

An R object of class 'bc_estimate'.

Examples

1
2
3
4
5
6
7
# Simulate data
sim = bc_simulate( 300, 8, 4 )
# Create training and test data
index = cv_index( 3, 300 )
dat = train_test( 3, index, sim$y, sim$X )
fit = bc_estimate( 'glm', dat )
fit_2 = bc_estimate( 'glmnet', dat )

rettopnivek/binclass documentation built on May 13, 2019, 4:46 p.m.