Interacting with metrics

This is the main class that you will use in Python recipes and the iPython notebook.

For starting code samples, please see Python recipes.

class dataiku.ComputedMetrics(raw)

Handle to the metrics of a DSS object and their last computed value

get_all_ids()

Get the identifiers of all metrics defined in this object

get_first_partition_data(metric_id)

Get a value point of a given metric, or throws. The first value encountered is returned.

Parameters:metric_id – unique identifier of the metric
get_global_data(metric_id)

Get the global value point of a given metric, or throws.

For a partitioned dataset, the global value is the value of the metric computed on the whole dataset (coded as partition ‘ALL’).

Parameters:metric_id – unique identifier of the metric
get_global_value(metric_id)

Get the global value of a given metric, or throws.

For a partitioned dataset, the global value is the value of the metric computed on the whole dataset (coded as partition ‘ALL’).

Parameters:metric_id – unique identifier of the metric
get_metric_by_id(metric_id)

Retrive the info for a given metric

Parameters:metric_id – unique identifier of the metric
get_partition_data(metric_id, partition)

Get the value point of a given metric for a given partition, or throws.

Parameters:
  • metric_id – unique identifier of the metric
  • partition – partition identifier
get_partition_value(metric_id, partition)

Get the value of a given metric for a given partition, or throws.

Parameters:
  • metric_id – unique identifier of the metric
  • partition – partition identifier
static get_value_from_data(data)

Retrieves the value from a metric point, cast in the appropriate type (str, int or float).

For other types, the value is not cast and left as a string.

Parameters:data – a value point for a metric, retrieved with dataiku.ComputedMetrics.get_global_data() or dataiku.ComputedMetrics.get_partition_data()