Adds on to an existing metric set and checks values are formatted correctly.

kf_add_metric(metric_set, name, value, format)

Arguments

metric_set

Metric set from kf_init_metrics() or a previious call of this function.

name

Name of metric.

value

Value of metric. Must be numeric.

format

Format to display metric in Kubeflow. Must be either RAW or PERCENTAGE.

Value

Metric set

Details

You can repeatedly chain this function to iteratively build up a pipeline metrics output.

Examples

# Create ROC AUC and PR AUC output kf_init_metrics() %>% kf_add_metric("roc-auc", .75, "RAW") %>% kf_add_metric("pr-auc", .45, "RAW")
#> { #> "metrics": [ #> { #> "name": "roc-auc", #> "numberValue": 0.75, #> "format": "RAW" #> }, #> { #> "name": "pr-auc", #> "numberValue": 0.45, #> "format": "RAW" #> } #> ] #> }