exp_eval_common

Description

Common utility functions for modifying experiment data.

Functions

auc(x, y[, add_boundaries, skip_na])

Calculate the area under curve for the given x and y values.

cache_at(save_as[, common_settings])

Return decorator that will cache the returned list of dicts in the JSON file save_as.

constrain_pd(df, constraints)

Given a dict of {col_name: constraint_value} return the dataframe row subset fulfilling all constraints.

do_for(func[, allow_looping, verbose_looping])

Apply func to all combinations of elements in the allow_looping list of kwargs-keys.

f_beta(precision, recall[, beta])

Calculate F1_beta score (cf.

flatten_cols(df, columns[, keep_columns])

If items in an dataframe are iterables, flatten these.

show_and_save_plot([fig, save_as, show_fig, ...])

Save a plot with proper default timestamped filename.

to_fig_for(func[, allow_looping, fig_args, ...])

Apply func to all combinations of elements in the allow_looping list of kwargs-keys and gather results into image.

update_dict(d, update)

Return a dict that is a recursive update of d with values in update.