predict: Make a Prediction for a Data Stream Mining Task

predictR Documentation

Make a Prediction for a Data Stream Mining Task

Description

predict() for data stream mining tasks DST.

Usage

## S3 method for class 'DST'
predict(object, newdata, ...)

## S3 method for class 'DSC'
predict(
  object,
  newdata,
  type = c("auto", "micro", "macro"),
  method = "auto",
  ...
)

Arguments

object

The DST object.

newdata

The points to make predictions for as a data.frame.

...

Additional arguments are passed on.

type

Use micro- or macro-clusters in DSC for assignment.

method

assignment method

  • "model" uses the assignment method of the underlying algorithm (unassigned points return NA). Not all algorithms implement this option.

  • "nn" performs nearest neighbor assignment using Euclidean distance.

  • "auto" uses the model assignment method. If this method is not implemented/available then method "nn" is used instead.

Value

A data.frame with columns containing the predictions. The columns depend on the type of the data stream mining task.

Author(s)

Michael Hahsler

See Also

Other DST: DSAggregate(), DSC(), DSClassifier(), DSOutlier(), DSRegressor(), DST(), DST_SlidingWindow(), DST_WriteStream(), evaluate, stream_pipeline, update()

Other DSC: DSC(), DSC_Macro(), DSC_Micro(), DSC_R(), DSC_SlidingWindow(), DSC_Static(), DSC_TwoStage(), animate_cluster(), evaluate.DSC, get_assignment(), plot.DSC(), prune_clusters(), read_saveDSC, recluster()

Examples

set.seed(1500)
stream <- DSD_Gaussians(k = 3, d = 2, noise = .1)

dbstream <- DSC_DBSTREAM(r = .1)
update(dbstream, stream, n = 100)
plot(dbstream, stream, type = "both")

# 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 = 10)
points

pr <- predict(dbstream, points, type = "macro")
pr

# Note that the clusters are labeled in arbitrary order. Check the
# agreement.
agreement(pr[,".class"], points[,".class"])

stream documentation built on May 29, 2024, 9:43 a.m.