robyn_clusters | R Documentation |
robyn_clusters()
uses output from robyn_run()
,
to reduce the number of models and create bootstrapped confidence
interval and help the user pick up the best (lowest combined error)
of the most different kinds (clusters) of models.
robyn_clusters(
input,
dep_var_type,
cluster_by = "hyperparameters",
all_media = NULL,
k = "auto",
wss_var = 0.06,
max_clusters = 10,
limit = 1,
weights = rep(1, 3),
dim_red = "PCA",
quiet = FALSE,
export = FALSE,
seed = 123,
...
)
input |
|
dep_var_type |
Character. For dep_var_type 'revenue', ROI is used for clustering. For conversion', CPA is used for clustering. |
cluster_by |
Character. Any of: "performance" or "hyperparameters". |
all_media |
Character vector. Default to |
k |
Integer. Number of clusters |
wss_var |
Numeric. Used to pick automatic |
max_clusters |
Integer. Maximum number of clusters. |
limit |
Integer. Top N results per cluster. If kept in "auto", will select k as the cluster in which the WSS variance was less than 5%. |
weights |
Vector, size 3. How much should each error weight? Order: nrmse, decomp.rssd, mape. The highest the value, the closer it will be scaled to origin. Each value will be normalized so they all sum 1. |
dim_red |
Character. Select dimensionality reduction technique.
Pass any of: |
quiet |
Boolean. Keep quiet? If not, print messages. |
export |
Export plots into local files? |
seed |
Numeric. Seed for reproducibility |
... |
Additional parameters passed to |
List. Clustering results as labeled data.frames and plots.
Bernardo Lares (bernardolares@meta.com)
## Not run:
# Having InputCollect and OutputCollect results
cls <- robyn_clusters(
input = OutputCollect,
all_media = InputCollect$all_media,
k = 3, limit = 2,
weights = c(1, 1, 1.5)
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.