View source: R/get_assignment.R
get_assignment | R Documentation |
Deprecation Notice: use predict()
for a more general interface to apply
a data stream model to new data. get_assignment()
is deprecated.
get_assignment(
dsc,
points,
type = c("auto", "micro", "macro"),
method = "auto",
...
)
## S3 method for class 'DSC'
get_assignment(
dsc,
points,
type = c("auto", "micro", "macro"),
method = c("auto", "nn", "model"),
...
)
dsc |
The DSC object with the clusters for assignment. |
points |
The points to be assigned as a data.frame. |
type |
Use micro- or macro-clusters in DSC for assignment. |
method |
assignment method
|
... |
Additional arguments are passed on. |
Get the assignment of data points to clusters in a DSC
using the
model's assignment rules or nearest neighbor assignment. The clustering is
not modified.
Each data point is assigned either using the original model's assignment rule or Euclidean nearest neighbor assignment. If the user specifies the model's assignment strategy, but is not available, then nearest neighbor assignment is used and a warning is produced.
A vector containing the assignment of each point. NA
means
that a data point was not assigned to a cluster.
Michael Hahsler
Other DSC:
DSC()
,
DSC_Macro()
,
DSC_Micro()
,
DSC_R()
,
DSC_SlidingWindow()
,
DSC_Static()
,
DSC_TwoStage()
,
animate_cluster()
,
evaluate.DSC
,
plot.DSC()
,
predict()
,
prune_clusters()
,
read_saveDSC
,
recluster()
stream <- DSD_Gaussians(k = 3, d = 2, noise = .05)
dbstream <- DSC_DBSTREAM(r = .1)
update(dbstream, stream, n = 100)
# find the assignment for the next 100 points to
# micro-clusters in dsc. This uses the model's assignment function
points <- get_points(stream, n = 100)
a <- predict(dbstream, points)
head(a)
# show the MC assignment areas. Assigned points as blue circles and
# the unassigned points as red dots
plot(dbstream, stream, assignment = TRUE, type = "none")
points(points[!is.na(a[, ".class"]),], col = "blue")
points(points[is.na(a[, ".class"]),], col = "red", pch = 20)
# use nearest neighbor assignment instead
a <- predict(dbstream, points, method = "nn")
head(a)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.