Description Usage Arguments Details Value Methods (by class) Author(s) References See Also Examples
Builds a model according to the One Rule (OneR) machine learning classification algorithm.
1 2 3 4 5 6 7 8 9 |
x |
data frame with the last column containing the target variable. |
... |
arguments passed to or from other methods. |
formula |
formula, additionally the argument |
data |
data frame which contains the data, only needed when using the formula interface. |
ties.method |
character string specifying how ties are treated, see 'Details'; can be abbreviated. |
verbose |
if |
All numerical data is automatically converted into five categorical bins of equal length. Instances with missing values are removed.
This is done by internally calling the default version of bin
before starting the OneR algorithm.
To finetune this behaviour data preprocessing with the bin
or optbin
functions should be performed.
If data contains unused factor levels (e.g. due to subsetting) these are ignored and a warning is given.
When there is more than one attribute with best performance either the first (from left to right) is being chosen (method "first"
) or
the one with the lowest p-value of a chi-squared test (method "chisq"
).
Returns an object of class "OneR". Internally this is a list consisting of the function call with the specified arguments, the names of the target and feature variables, a list of the rules, the number of correctly classified and total instances and the contingency table of the best predictor vs. the target variable.
formula
: method for formulas.
data.frame
: method for data frames.
Holger von Jouanne-Diedrich
bin
, optbin
, eval_model
, maxlevels
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | data <- optbin(iris)
model <- OneR(data, verbose = TRUE)
summary(model)
plot(model)
prediction <- predict(model, data)
eval_model(prediction, data)
## The same with the formula interface:
data <- optbin(iris)
model <- OneR(Species ~., data = data, verbose = TRUE)
summary(model)
plot(model)
prediction <- predict(model, data)
eval_model(prediction, data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.