discrNumeric | R Documentation |
Can discretize both predictor columns in data frame – using supervised algorithm MDLP (Fayyad & Irani, 1993) – and the target class – using unsupervised algorithm (k-Means). This R file contains fragments of code from the GPL-licensed R discretization package by HyunJi Kim.
discrNumeric(
df,
classatt,
min_distinct_values = 3,
unsupervised_bins = 3,
discretize_class = FALSE
)
df |
a data frame with data. |
classatt |
name the class attribute in df |
min_distinct_values |
the minimum number of unique values a column needs to have to be subject to supervised discretization. |
unsupervised_bins |
number of target bins for discretizing the class attribute. Ignored when the class attribute is not numeric or when |
discretize_class |
logical value indicating whether the class attribute should be discretized. Ignored when the class attribute is not numeric. |
list with two slots: $cutp
with cutpoints and $Disc.data
with discretization results
Fayyad, U. M. and Irani, K. B. (1993). Multi-interval discretization of continuous-valued attributes for classification learning, Artificial intelligence 13, 1022–1027
discrNumeric(datasets::iris, "Species")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.