Description Format Details Active bindings Methods Author(s) Examples
A Cross Validation for the CART tree.
[R6::R6Class] object.
Some mor details will follow
df_data
Returns the instance variable df_data (tibble::tibble)
label
Returns the instance variable label (character)
seed
Returns the instance variable seed (integer)
lvls
Returns the instance variable lvls (character)
k
Returns the instance variable k (integer)
ctrl
Returns the instance variable ctrl (rpart::rpart.control)
auc_roc
Returns the instance variable auc_roc (numeric)
confusion_matrix
Returns the instance variable confucion_matrix
scores
Returns the cross validation scores (tibble::tibble)
accuracy
Returns the corss validation accuracy (numeric)
verbose
Returns the corss validation verbose (logical)
new()
Creates and returns a new crossVal.rpart object.
crossVal.rpart$new( obj = "tbl_df", label = "character", ctrl = "rpart::rpart.control", k = 10, seed = 42, verbose = FALSE )
obj
The data to be analyzed. (tibble::tibble)
label
The column name of the labels within obj (character)
ctrl
The control sequence for the CART tree (rpart::rpart.control)
k
The corss validation parameter (integer)
seed
The seed for the cross validation (integer)
verbose
Makes the class print results (logical)
A new crossVal.rpart object. (pguXAI::crossVal.rpart)
train()
trains the model
crossVal.rpart$train(repeats = 1)
repeats
The repeat parameter (integer)
finalize()
Clears the heap and indicates that instance of crossVal.rpart is removed from heap.
crossVal.rpart$finalize()
print()
Prints instance variables of a crossVal.rpart object.
crossVal.rpart$print()
string
plot()
Plots the confusion matrix of the cross validation
crossVal.rpart$plot()
clone()
The objects of this class are cloneable with this method.
crossVal.rpart$clone(deep = FALSE)
deep
Whether to make a deep clone.
Sebastian Malkusch, malkusch@med.uni-frankfurt.de
1 2 3 4 5 | data("iris")
df_data = tibble::as_tibble(iris)
ctrl <- rpart::rpart.control(minsplit = 3, maxdepth = 3)
cv <- pguXAI::crossVal.rpart$new(obj = df_data, label = "Species", ctrl = ctrl, k = 10)
plot(cv)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.