C5.0(x, ...)## S3 method for class 'default':
C5.0(x, y, trials = 1, rules= FALSE,
weights = NULL,
control = C5.0Control(),
costs = NULL, ...)
## S3 method for class 'formula':
C5.0(formula, data, weights, subset,
na.action = na.pass, ...)
C5.0ControlNAs. The default is to include missing values since the model can accommodate them.C5.0 with elements:C5.0ControlRequested (an echo of the function call) and Actual (how many the model used)When using the formula method, factors and other classes are preserved (i.e. dummy variables are not automatically created). This particular model handles non-numeric data of some types (such as character, factor and ordered data).
The cost matrix should by CxC, where C is the number of
classes. Diagonal elements are ignored. Columns should correspond to
the true classes and rows are the predicted classes. For example, if C
= 3 with classes Red, Blue and Green (in that order), a value of 5 in
the (2,3) element of the matrix would indicate that the cost of
predicting a Green sample as Blue is five times the usual value (of
one). Note that when costs are used, class probabilities cannot be
generated using predict.C5.0.
Internally, the code will attempt to halt boosting if it appears to be
ineffective. For this reason, the value of trials may be
different from what the model actually produced. There is an option to
turn this off in C5.0Control.
C5.0Control, summary.C5.0, predict.C5.0, C5impdata(churn)
treeModel <- C5.0(x = churnTrain[, -20], y = churnTrain$churn)
treeModel
summary(treeModel)
ruleModel <- C5.0(churn ~ ., data = churnTrain, rules = TRUE)
ruleModel
summary(ruleModel)Run the code above in your browser using DataLab