View source: R/DSC_WebService.R
DSC_WebService | R Documentation |
Provides a DSC front-end for a clusterer running as a web service. The methods
nclusters()
, get_center()
, get_weights()
are supported. The request is
retried with httr::RETRY()
if it fails the first time.
DSC_WebService(url, verbose = FALSE, ...)
url |
endpoint URI address in the format |
verbose |
logical; display connection information. |
... |
further arguments are passed on to |
A stream::DSC object.
Other WebService:
DSD_ReadWebService()
,
publish_DSC_via_WebService()
,
publish_DSD_via_WebService()
Other dsc:
publish_DSC_via_WebService()
# find a free port
port <- httpuv::randomPort()
port
# deploy a clustering process listening for data on the port
rp1 <- publish_DSC_via_WebService("DSC_DBSTREAM(r = .05)", port = port)
rp1
# get a local DSC interface
dsc <- DSC_WebService(paste0("http://localhost", ":", port),
verbose = TRUE, config = httr::verbose(info = TRUE))
dsc
# cluster
dsd <- DSD_Gaussians(k = 3, d = 2, noise = 0.05)
update(dsc, dsd, 500)
get_centers(dsc)
get_weights(dsc)
plot(dsc)
# kill the background clustering process.
rp1$kill()
rp1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.