fit_classification_tree: Fit classification tree to 'klassets_response_xy' object

View source: R/response_xy.R

fit_classification_treeR Documentation

Fit classification tree to klassets_response_xy object

Description

Fit classification tree to klassets_response_xy object

Usage

fit_classification_tree(df, type = "prob", maxdepth = Inf, alpha = 0.05, ...)

Arguments

df

A object from sim_response_xy.

type

Type of prediction, one of prob, response, node.

maxdepth

Max depth of the tree. Same used in partykit::ctree_control.

alpha

Alpha value, same used in partykit::ctree_control

...

Options for partykit::ctree_control.

Examples


set.seed(123)

df <- sim_response_xy(n = 1000, relationship = function(x, y) x**2 > sin(y))

plot(df)

# default type = "prob"
df_tree_prob <- fit_classification_tree(df)
df_tree_prob

df_tree_resp <- fit_classification_tree(df, type = "response")
df_tree_resp

df_tree_node <- fit_classification_tree(df, type = "node")
df_tree_node

plot(df_tree_prob)
plot(df_tree_resp)
plot(df_tree_node)


jbkunst/klassets documentation built on Dec. 7, 2022, 9:18 p.m.