robyn_clusters {Robyn} | R Documentation |
Clustering to Reduce Number of Models based on ROI and Errors
Description
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.
Usage
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,
...
)
Arguments
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 |
Value
List. Clustering results as labeled data.frames and plots.
Author(s)
Bernardo Lares (bernardolares@meta.com)
Examples
## 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)