Classify the rows of a data matrix using the Rock classifier.
Usage
## S3 method for class 'rock':
predict(object, x, drop = 1, ...)
## S3 method for class 'rock':
fitted(object, ...)
Arguments
object
an object of class rock.
x
a data matrix containing test or new samples.
drop
cluster size threshold.
...
further (unused) arguments.
Value
A list with the following components:
cla factor of cluster memberships of the samples.
sizea vector of cluster sizes.
Details
Provides a wrapper function to the Rock classifier: cluster memberships
of the (row) samples are determined by majority vote using the size (of
the cluster) weighted number of links.
The classifier uses random tie-breaking and assigns samples with zero link
counts to NA. This allows for detection of possible outliers, or
interesting patterns.
In the case a drop value greater than zero is specified, all
clusters with size equal or less than this value are removed from the
classifier. Especially, fitted uses a threshold of one because
for singleton clusters the neighborhood is empty.
Note that for the training data the predicted memberships need not
necessarily be the same as those obtained from the cluster algorithm.
See Also
rockCluster for obtaining a rock classifier and
gknn for k-nearest neighbor classification.