Learn R Programming

OptimClassifier (version 0.1.5)

Optim.GLM: Find out what is the error distribution and link function that best fits a classification generalized linear model to your data

Description

Optim.GLM is used to fit the best classification GLM to a dataset. For this purpose, we examine the variation of the precision using the root mean square error (RMSE) when different error distribution and link function was used in the model. In addition, several thresholds are applied to check which is the most optimal cut for the indicators derived from the confusion matrix (success rate, type I error and type II error) according to a given criterion.

Usage

Optim.GLM(formula, data, p, criteria = c("success_rate", "ti_error",
  "tii_error"), includedata = FALSE, seed = NULL, ...)

Arguments

formula

A formula of the form y ~ x1 + x2 + …

data

Data frame from which variables specified in formula are preferentially to be taken.

p

A percentage of training elements

criteria

This variable selects the criteria to select the best threshold. The default value is success_rate

includedata

logicals. If TRUE the training and testing datasets are returned.

seed

a single value, interpreted as an integer, or NULL. The default value is NULL, but for future checks of the model or models generated it is advisable to set a random seed to be able to reproduce it.

...

arguments passed to glm

Value

An object of class Optim. See Optim.object

Examples

Run this code
# NOT RUN {
if(interactive()){
## Load a Dataset
data(AustralianCredit)

## Create the model
creditscoring <- Optim.GLM(Y~., AustralianCredit, p = 0.7, seed=2018)

#See a ranking of the models tested
print(creditscoring)

#Access to summary of the best model
summary(creditscoring)

#not sure of like the best model, you can access to the all model, for example the 2nd model
summary(creditscoring,2)
}


# }

Run the code above in your browser using DataLab