Description Usage Arguments Details Value References See Also Examples
Classification using the moving window and kernel classification rules.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | kda(x, ...)
## S3 method for class 'formula'
kda(formula, data, ..., subset, na.action)
## S3 method for class 'data.frame'
kda(x, ...)
## S3 method for class 'matrix'
kda(x, grouping, ..., subset, na.action = na.fail)
## Default S3 method:
kda(x, grouping, wf = c("biweight", "cauchy", "cosine",
"epanechnikov", "exponential", "gaussian", "optcosine", "rectangular",
"triangular"), bw, k, nn.only = TRUE, ...)
|
x |
(Required if no |
formula |
A formula of the form |
data |
A |
subset |
An index vector specifying the cases to be used in the training sample. (NOTE: If given, this argument must be named.) |
na.action |
A function to specify the action to be taken if NAs are found. The default action is first
the |
grouping |
(Required if no |
wf |
A window function which is used to calculate weights that are introduced into
the fitting process. Either a character string or a function, e.g. |
bw |
(Required only if |
k |
(Required only if |
nn.only |
(Required only if |
... |
Further arguments. Currently unused. |
The kernel clasification rule is given as
hat g = arg max_g sum_{n:y_n=g} wf((x-x_n)/bw).
In the case that wf is the rectangular kernel it is also called moving window rule.
The name of the window function (wf
) can be specified as a character string.
In this case the window function is generated internally in predict.kda
. Currently
supported are "biweight"
, "cauchy"
, "cosine"
, "epanechnikov"
,
"exponential"
, "gaussian"
, "optcosine"
, "rectangular"
and
"triangular"
.
Moreover, it is possible to generate the window functions mentioned above in advance
(see wfs
) and pass them to kda
.
Any other function implementing a window function can also be used as wf
argument.
This allows the user to try own window functions.
See help on wfs
for details.
If the predictor variables include factors, the formula interface must be used in order to get a correct model matrix.
An object of class "kda"
, a list
containing the following components:
x |
A |
grouping |
A |
counts |
The number of observations per class. |
lev |
The class labels (levels of |
N |
The number of observations. |
wf |
The window function used. Always a function, even if the input was a string. |
bw |
(Only if |
k |
(Only if |
nn.only |
(Logical. Only if |
adaptive |
(Logical.) |
variant |
(Only if |
call |
The (matched) function call. |
Devroye, L., Gyoerfi, L. and Lugosi, A. (1996), A Probabilistic Theory of Pattern Recognition. Springer, New York.
Other observation_specific majority: predict.kda
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.