bins.optimize {binr}R Documentation

Algorithms minimizing the binning error function bins.merr.

Description

bins.move - Compute the best move of a value from one bin to its neighbor

bins.split - Split a bin into two bins optimally.

bins.merge - Merges the two bins yielding the largest gain in error reduction.

bins.move.iter - Apply bins.move until there's no change. Can only reduce the error.

bins.split.iter Iterate to repeatedly apply bins.split.

bins.merge.iter Iterate to repeatedly apply bins.merge.

Usage

bins.move(xval, xtbl, binlo, binhi, binct, target.bins, verbose = F)

bins.split(xval, xtbl, binlo, binhi, binct, target.bins, force = F,
  verbose = F)

bins.merge(xval, xtbl, binlo, binhi, binct, target.bins, force = F,
  verbose = F)

bins.move.iter(lst, target.bins, verbose = F)

bins.split.iter(lst, target.bins, exact.groups = F, verbose = F)

bins.merge.iter(lst, target.bins, exact.groups = F, verbose = F)

Arguments

xval

Sorted unique values of the data set x. This should be the numeric version of names(xtbl).

xtbl

Result of a call to table(x).

binlo

The "low" value falling into the bin.

binhi

The "high" value falling into the bin.

binct

The number of points falling into the bin.

target.bins

Number of bins desired; this is also the max number of bins.

verbose

When TRUE, prints resulting binct.

force

When TRUE, splits or merges bins regardless of whether the best gain is positive.

lst

List containing xval, xtbl, binlo, binhi, binct.

exact.groups

If FALSE, run until either the target.bins is reached or there's no more splits or merges that reduce the error. Otherwise (TRUE), run until the target.bins is reached, even if that increases the error.

Value

A list containing the following items (not all of them may be present):

See Also

bins, binr, bins.greedy, bins.quantiles


[Package binr version 1.1.1 Index]