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 |
xtbl |
Result of a call to |
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 |
force |
When |
lst |
List containing |
exact.groups |
If |
Value
A list containing the following items (not all of them may be present):
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.
xtbl - The result of a call to
table(x)
.xval - The sorted unique values of the data points x. Essentially, a numeric version of
names(xtbl)
.changed - Flag indicating whether the bins have been modified by the function.
err - Mean square root error between the resulting counts and ideal bins.
imax - For the move, merge and split operations, the index of the bin with the maximum gain.
iside - For the move operation, the side of the move: 0 = left, 1 = right.
gain - Error gain obtained as the result of the function call.
See Also
bins
, binr
, bins.greedy
, bins.quantiles