CART tree via rpart::rpart, returning the root split structure
and feature importances.
Value
Named list: estimate, train_accuracy, root_feature, root_threshold, root_impurity, n_leaves, feature_importances, criterion, n, method.
Examples
morie_decision_tree_split(x = rnorm(50), y = rnorm(50))
#> $estimate
#> [1] 1
#>
#> $train_accuracy
#> [1] 1
#>
#> $root_feature
#> [1] 0
#>
#> $root_threshold
#> [1] 0.09396981
#>
#> $root_impurity
#> [1] 0.98
#>
#> $n_leaves
#> [1] 50
#>
#> $feature_importances
#> [1] 1
#>
#> $criterion
#> [1] "gini"
#>
#> $n
#> [1] 50
#>
#> $method
#> [1] "Decision tree (CART, gini)"
#>