Weka_control: Control Weka Options

Description Usage Arguments Details Value See Also Examples

View source: R/control.R

Description

Set control options for Weka learners.

Usage

1

Arguments

...

named arguments of control options, see the details and examples.

Details

The available options for a Weka learner, foo() say, can be queried by WOW(foo) and then conveniently set by Weka_control(). See below for an example.

One can use lists for options taking multiple arguments, see the documentation for SMO for an example.

Value

A list of class Weka_control which can be coerced to character for passing it to Weka.

See Also

WOW

Examples

1
2
3
4
5
6
7
## Query J4.8 options:
WOW("J48")
## Learn J4.8 tree on iris data with default settings:
J48(Species ~ ., data = iris)
## Learn J4.8 tree with reduced error pruning (-R) and 
## minimum number of instances set to 5 (-M 5):
J48(Species ~ ., data = iris, control = Weka_control(R = TRUE, M = 5))

Example output

OpenJDK 64-Bit Server VM warning: Can't detect initial thread stack location - find_vma failed
-U      Use unpruned tree.
-O      Do not collapse tree.
-C <pruning confidence>
        Set confidence threshold for pruning.  (default 0.25)
	Number of arguments: 1.
-M <minimum number of instances>
        Set minimum number of instances per leaf.  (default 2)
	Number of arguments: 1.
-R      Use reduced error pruning.
-N <number of folds>
        Set number of folds for reduced error pruning. One fold is used
        as pruning set.  (default 3)
	Number of arguments: 1.
-B      Use binary splits only.
-S      Do not perform subtree raising.
-L      Do not clean up after the tree has been built.
-A      Laplace smoothing for predicted probabilities.
-J      Do not use MDL correction for info gain on numeric attributes.
-Q <seed>
        Seed for random data shuffling (default 1).
	Number of arguments: 1.
-doNotMakeSplitPointActualValue
        Do not make split point actual value.
-output-debug-info
        If set, classifier is run in debug mode and may output
        additional info to the console
-do-not-check-capabilities
        If set, classifier capabilities are not checked before
        classifier is built (use with caution).
-num-decimal-places
        The number of decimal places for the output of numbers in the
        model (default 2).
	Number of arguments: 1.
-batch-size
        The desired batch size for batch prediction (default 100).
	Number of arguments: 1.
J48 pruned tree
------------------

Petal.Width <= 0.6: setosa (50.0)
Petal.Width > 0.6
|   Petal.Width <= 1.7
|   |   Petal.Length <= 4.9: versicolor (48.0/1.0)
|   |   Petal.Length > 4.9
|   |   |   Petal.Width <= 1.5: virginica (3.0)
|   |   |   Petal.Width > 1.5: versicolor (3.0/1.0)
|   Petal.Width > 1.7: virginica (46.0/1.0)

Number of Leaves  : 	5

Size of the tree : 	9

J48 pruned tree
------------------

Petal.Width <= 0.6: setosa (34.0)
Petal.Width > 0.6
|   Petal.Width <= 1.5: versicolor (32.0/1.0)
|   Petal.Width > 1.5: virginica (34.0/2.0)

Number of Leaves  : 	3

Size of the tree : 	5

Warning message:
system call failed: Cannot allocate memory 

RWeka documentation built on Feb. 3, 2020, 1:10 a.m.