# 005. Product ABC inventory priorities

**Question:** How many product codes account for the first 80% of invoiced product value?

## Result

The largest computed metric is 0.8001 for A; the smallest is 0.04999 for C. Metric: sales_share (Share).

Include the boundary-crossing code in the earlier class. Source product codes can include charges.

![Product ABC inventory priorities](outputs/chart.png)

| class | product_codes | gross_gbp | sales_share |
| --- | --- | --- | --- |
| A | 804 | 8.534e+06 | 0.8001 |
| B | 983 | 1.599e+06 | 0.1499 |
| C | 2135 | 5.332e+05 | 0.04999 |

The chart shows 3 of 3 result rows; the table previews the first 3 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Cumulative revenue ranking with 80% and 95% ABC boundaries.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Prioritize review effort across the assortment; stock levels and holding costs are needed for an inventory policy.

Historical invoice lines; credits are not reliably matched to original sales. Gross purchases are not profit. Unidentified customers cannot support customer-level conclusions. Exact repeated lines remain unless the study explicitly compares removal. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/005-product-abc-inventory-priorities/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Online Retail](https://archive.ics.uci.edu/dataset/352/online+retail), Chen (2015). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/retail.json) and [prepared-data audit](../../data/provenance/retail_prepared.json) record the downloaded files, field coverage and hashes.
