API Reference

This is the class and function reference of ddop.

ddop.newsvendor: Newsvendor decision making

The ddop.newsvendor module contains different newsvendor approaches for decision making.

Sample Average Approximation (SAA)

Weighted SAA (wSAA)

Empirical Risk Minimization (ERM)


ddop.metrics: Evaluation metrics

The ddop.metrics module includes different performance metrics that can be used for model selection and evaluation.

total_costs(y_true, y_pred, cu, co[, ...])

Compute total costs based on the the difference between y_true and y_pred and the given underage and overage costs.

average_costs(y_true, y_pred, cu, co[, ...])

Compute average costs based on the the difference between y_true and y_pred and the given underage and overage costs.

prescriptiveness_score(y_true, y_pred, ...)

Compute the coefficient of prescriptiveness that is defined as (1 - u/v), where u are the average costs between the true and predicted values (y_true,y_pred), and v are the average costs between the true values and the predictions obtained by SAA (y_pred_saa, y_pred).

All performance metrics can also be used with scikit-learn model selection tools. However, therefore a proper scoring object has to be generated by using the make_scorer function.

make_scorer(score_func[, greater_is_better])

Make a scorer from a performance metric or loss function.

Moreover, the module contains a function to calculate the pairwise costs.

pairwise_costs(y_true, y_pred, cu, co)

Compute pairwise costs based on the the difference between y_true and y_pred and the given underage and overage costs.


ddop.datasets: Datasets

ddop comes with a few default datasets that can be loaded using the ddop.datasets module.

Loaders

load_yaz([include_date, one_hot_encoding, ...])

Load and return the YAZ dataset

load_bakery([include_date, ...])

Load and return the bakery dataset

load_SID([include_date, one_hot_encoding, ...])

Load and return the store item demand dataset.

These datasets are useful to quickly illustrate the behavior of the various algorithms implemented in ddop.