Description Usage Arguments Details Value See Also Examples
Specifiy the number of starting clusters, and activate the DP nodes to be
included in the posterior sampling process (hdp_posterior
).
When initialised, the DP nodes are 'heldout' (not available for posterior sampling).
1 | dp_activate(hdp, dpindex, initcc, seed = sample(1:10^7, 1))
|
hdp |
A hdpState object |
dpindex |
Indices of the DPs to activate (include all parent DPs) |
initcc |
Number of data clusters to start with (every data item is randomly assigned to a cluster to start with) |
seed |
The (integer) seed that can be set to reproduce output. Default is a random seed from 1 – 10^7, reported in the output. |
Note that this step can be slow and memory-intensive for very large datasets.
A hdpState object with activated DPs and an initial random cluster allocation for each data item. See hdpState-class
hdp_init
, hdp_addconparam
, hdp_adddp
,
hdp_setdata
, hdp_posterior
1 2 3 4 5 6 | my_hdp <- hdp_init(ppindex=0, cpindex=1, hh=rep(1, 6), alphaa=rep(1, 3), alphab=rep(2, 3))
my_hdp <- hdp_adddp(my_hdp, 2, 1, 2)
my_hdp <- hdp_adddp(my_hdp, 10, c(rep(2, 5), rep(3, 5)), 3)
my_hdp <- hdp_setdata(my_hdp, 4:13, example_data_hdp)
# active all DPs and start with two data clusters
my_hdp <- dp_activate(my_hdp, 1:13, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.