Label Uniqueness
Calculate the concurrency and the average uniqueness of labels: how many labels span each date and how much of its span each label shares with others.
Labels that span several periods overlap: the triple-barrier labels of two consecutive days share most of their prices, so they are not independent observations. The concurrency of a date is the number of labels whose span includes it, and the average uniqueness of a label is the mean of one over the concurrency across its span: 1 for a label that overlaps no other and 1/10 for a label sharing its whole span with nine others. López de Prado uses it to weigh the labels, to bootstrap them in proportion to their uniqueness (sequential bootstrap) and to set the number of samples a bagging classifier draws.
The formula is as follows:
\[c_{t} = \sum_{i} 1\left[t_{0}_{i} \leq t \leq t_{1}_{i}\right],\;\; t_{1,i} \text{ the date Holding Period periods after } t_{0,i}\] \[u_{i} = \frac{\text{mean of} \;1}{c_{t}} \;\text{over}\; t_{0}_{i} \leq t \leq t_{1}_{i}\]Both look forward by construction, as the spans of the labels do: the uniqueness of a label depends on the labels after it.
Also known as: label concurrency, number of concurrent events, average uniqueness, sample uniqueness, overlapping labels.
Example · AAPL, MSFT · 2024 to 2025
Install the Finance Toolkit with pip install financetoolkit -U, then call get_label_uniqueness:
from financetoolkit import Toolkit
toolkit = Toolkit(
["AAPL", "MSFT"],
api_key="FINANCIAL_MODELING_PREP_KEY",
start_date="2024-01-01",
end_date="2025-12-31",
)
uniqueness = toolkit.technicals.get_label_uniqueness()
uniqueness.xs("AAPL", level=1, axis="columns").dropna()
Which returns:
| Date | Concurrency | Average Uniqueness |
|---|---|---|
| 2024-01-02 | 1 | 0.6111 |
| 2024-01-03 | 2 | 0.4167 |
| 2024-01-04 | 3 | 0.3889 |
| 2024-01-05 | 2 | 0.4167 |
| 2024-01-08 | 3 | 0.2833 |
| 2024-01-09 | 2 | 0.2750 |
| 2024-01-10 | 3 | 0.2375 |
| 2024-01-11 | 4 | 0.2042 |
| 2024-01-12 | 5 | 0.1833 |
| 2024-01-16 | 6 | 0.2333 |
| 2024-01-17 | 5 | 0.2667 |
| 2024-01-18 | 3 | 0.4167 |
| 2024-01-19 | 2 | 0.4444 |
| 2024-01-22 | 2 | 0.2952 |
| 2024-01-23 | 3 | 0.2792 |
| 2024-01-24 | 3 | 0.2458 |
| 2024-01-25 | 4 | 0.2167 |
| 2024-01-26 | 5 | 0.2167 |
| 2024-01-29 | 5 | 0.2250 |
| 2024-01-30 | 4 | 0.3750 |
| 2024-01-31 | 2 | 0.5000 |
| 2024-02-01 | 2 | 0.3958 |
| 2024-02-02 | 2 | 0.3611 |
| 2024-02-05 | 3 | 0.2395 |
| 2024-02-06 | 4 | 0.2238 |
| 2024-02-07 | 3 | 0.2186 |
| 2024-02-08 | 4 | 0.1899 |
| 2024-02-09 | 5 | 0.1698 |
| 2024-02-12 | 6 | 0.2143 |
| 2024-02-13 | 7 | 0.2649 |
| 2024-02-14 | 3 | 0.2917 |
| 2024-02-15 | 3 | 0.2778 |
| 2024-02-16 | 4 | 0.2168 |
| 2024-02-20 | 4 | 0.2778 |
| 2024-02-21 | 3 | 0.2085 |
| 2024-02-22 | 4 | 0.2333 |
| 2024-02-23 | 4 | 0.1808 |
| 2024-02-26 | 5 | 0.1724 |
| 2024-02-27 | 5 | 0.1586 |
| 2024-02-28 | 6 | 0.1586 |
| 2024-02-29 | 7 | 0.1560 |
| 2024-03-01 | 8 | 0.1625 |
| 2024-03-04 | 5 | 0.3500 |
| 2024-03-05 | 2 | 0.3567 |
| 2024-03-06 | 2 | 0.3208 |
| 2024-03-07 | 3 | 0.2611 |
| 2024-03-08 | 4 | 0.2250 |
| 2024-03-11 | 5 | 0.2881 |
| 2024-03-12 | 2 | 0.4167 |
| 2024-03-13 | 3 | 0.2792 |
| 2024-03-14 | 3 | 0.2458 |
| 2024-03-15 | 4 | 0.2167 |
| 2024-03-18 | 5 | 0.2000 |
| 2024-03-19 | 5 | 0.3500 |
| 2024-03-20 | 2 | 0.5000 |
| 2024-03-21 | 2 | 0.3333 |
| 2024-03-22 | 2 | 0.3611 |
| 2024-03-25 | 3 | 0.2778 |
| 2024-03-26 | 4 | 0.2500 |
| 2024-03-27 | 4 | 0.2778 |
| 2024-03-28 | 3 | 0.2778 |
| 2024-04-01 | 4 | 0.2147 |
| 2024-04-02 | 4 | 0.1991 |
| 2024-04-03 | 3 | 0.1918 |
| 2024-04-04 | 4 | 0.1683 |
| 2024-04-05 | 5 | 0.1519 |
| 2024-04-08 | 6 | 0.1399 |
| 2024-04-09 | 7 | 0.1310 |
| 2024-04-10 | 8 | 0.1250 |
| 2024-04-11 | 8 | 0.3229 |
| 2024-04-12 | 2 | 0.4167 |
| 2024-04-15 | 3 | 0.3333 |
| 2024-04-16 | 3 | 0.3889 |
| 2024-04-17 | 2 | 0.3889 |
| 2024-04-18 | 3 | 0.2833 |
| 2024-04-19 | 3 | 0.2792 |
| 2024-04-22 | 3 | 0.2611 |
| 2024-04-23 | 4 | 0.2333 |
| 2024-04-24 | 5 | 0.2583 |
| 2024-04-25 | 4 | 0.2778 |
| 2024-04-26 | 3 | 0.2917 |
| 2024-04-29 | 4 | 0.3750 |
| 2024-04-30 | 2 | 0.4444 |
| 2024-05-01 | 2 | 0.4167 |
| 2024-05-02 | 3 | 0.4167 |
| 2024-05-03 | 2 | 0.2990 |
| 2024-05-06 | 2 | 0.2655 |
| 2024-05-07 | 3 | 0.2186 |
| 2024-05-08 | 4 | 0.1899 |
| 2024-05-09 | 5 | 0.2107 |
| 2024-05-10 | 6 | 0.1548 |
| 2024-05-13 | 7 | 0.2698 |
| 2024-05-14 | 3 | 0.2900 |
| 2024-05-15 | 3 | 0.2494 |
| 2024-05-16 | 3 | 0.2155 |
| 2024-05-17 | 4 | 0.1919 |
| 2024-05-20 | 5 | 0.1774 |
| 2024-05-21 | 5 | 0.1698 |
| 2024-05-22 | 6 | 0.1548 |
| 2024-05-23 | 7 | 0.2381 |
| 2024-05-24 | 3 | 0.2472 |
| 2024-05-28 | 3 | 0.2300 |
| 2024-05-29 | 4 | 0.2042 |
| 2024-05-30 | 5 | 0.1889 |
| 2024-05-31 | 5 | 0.2375 |
| 2024-06-03 | 6 | 0.2400 |
| 2024-06-04 | 3 | 0.2472 |
| 2024-06-05 | 4 | 0.2250 |
| 2024-06-06 | 4 | 0.2250 |
| 2024-06-07 | 5 | 0.2000 |
| 2024-06-10 | 5 | 0.2250 |
| 2024-06-11 | 4 | 0.3750 |
| 2024-06-12 | 2 | 0.3381 |
| 2024-06-13 | 2 | 0.3067 |
| 2024-06-14 | 3 | 0.2917 |
| 2024-06-17 | 4 | 0.2333 |
| 2024-06-18 | 4 | 0.2250 |
| 2024-06-20 | 5 | 0.2633 |
| 2024-06-21 | 3 | 0.2792 |
| 2024-06-24 | 3 | 0.2611 |
| 2024-06-25 | 4 | 0.2250 |
| 2024-06-26 | 5 | 0.3067 |
| 2024-06-27 | 2 | 0.3333 |
| 2024-06-28 | 3 | 0.2917 |
| 2024-07-01 | 4 | 0.2778 |
| 2024-07-02 | 4 | 0.3056 |
| 2024-07-03 | 3 | 0.3333 |
| 2024-07-05 | 3 | 0.3542 |
| 2024-07-08 | 2 | 0.3611 |
| 2024-07-09 | 3 | 0.2917 |
| 2024-07-10 | 4 | 0.3750 |
| 2024-07-11 | 2 | 0.4444 |
| 2024-07-12 | 2 | 0.4167 |
| 2024-07-15 | 3 | 0.3889 |
| 2024-07-16 | 2 | 0.4167 |
| 2024-07-17 | 3 | 0.4167 |
| 2024-07-18 | 2 | 0.3567 |
| 2024-07-19 | 2 | 0.3208 |
| 2024-07-22 | 3 | 0.2611 |
| 2024-07-23 | 4 | 0.2250 |
| 2024-07-24 | 5 | 0.2611 |
| 2024-07-25 | 2 | 0.2900 |
| 2024-07-26 | 3 | 0.2375 |
| 2024-07-29 | 4 | 0.2056 |
| 2024-07-30 | 5 | 0.2133 |
| 2024-07-31 | 6 | 0.2083 |
| 2024-08-01 | 4 | 0.2333 |
| 2024-08-02 | 4 | 0.2250 |
| 2024-08-05 | 5 | 0.3208 |
| 2024-08-06 | 2 | 0.3611 |
| 2024-08-07 | 3 | 0.3056 |
| 2024-08-08 | 4 | 0.3056 |
| 2024-08-09 | 3 | 0.3333 |
| 2024-08-12 | 3 | 0.3333 |
| 2024-08-13 | 3 | 0.3542 |
| 2024-08-14 | 2 | 0.3611 |
| 2024-08-15 | 3 | 0.1912 |
| 2024-08-16 | 4 | 0.1770 |
| 2024-08-19 | 3 | 0.1689 |
| 2024-08-20 | 4 | 0.1423 |
| 2024-08-21 | 5 | 0.1303 |
| 2024-08-22 | 6 | 0.1228 |
| 2024-08-23 | 7 | 0.1151 |
| 2024-08-26 | 8 | 0.1105 |
| 2024-08-27 | 9 | 0.1076 |
| 2024-08-28 | 10 | 0.1068 |
| 2024-08-29 | 11 | 0.1090 |
| 2024-08-30 | 8 | 0.1181 |
| 2024-09-03 | 9 | 0.2040 |
| 2024-09-04 | 2 | 0.2143 |
| 2024-09-05 | 3 | 0.1786 |
| 2024-09-06 | 4 | 0.1565 |
| 2024-09-09 | 5 | 0.1409 |
| 2024-09-10 | 6 | 0.1291 |
| 2024-09-11 | 7 | 0.1197 |
| 2024-09-12 | 8 | 0.1120 |
| 2024-09-13 | 9 | 0.1056 |
| 2024-09-16 | 10 | 0.3111 |
| 2024-09-17 | 2 | 0.4167 |
| 2024-09-18 | 3 | 0.4167 |
| 2024-09-19 | 2 | 0.2772 |
| 2024-09-20 | 2 | 0.2454 |
| 2024-09-23 | 3 | 0.2030 |
| 2024-09-24 | 4 | 0.1769 |
| 2024-09-25 | 5 | 0.1586 |
| 2024-09-26 | 6 | 0.1448 |
| 2024-09-27 | 7 | 0.1339 |
| 2024-09-30 | 8 | 0.3125 |
| 2024-10-01 | 2 | 0.3567 |
| 2024-10-02 | 2 | 0.3208 |
| 2024-10-03 | 3 | 0.2611 |
| 2024-10-04 | 4 | 0.2250 |
| 2024-10-07 | 5 | 0.3500 |
| 2024-10-08 | 2 | 0.5000 |
| 2024-10-09 | 2 | 0.3667 |
| 2024-10-10 | 2 | 0.3333 |
| 2024-10-11 | 3 | 0.2917 |
| 2024-10-14 | 4 | 0.2567 |
| 2024-10-15 | 4 | 0.2394 |
| 2024-10-16 | 3 | 0.2458 |
| 2024-10-17 | 4 | 0.2167 |
| 2024-10-18 | 5 | 0.2125 |
| 2024-10-21 | 5 | 0.2167 |
| 2024-10-22 | 4 | 0.2250 |
| 2024-10-23 | 5 | 0.2119 |
| 2024-10-24 | 3 | 0.2139 |
| 2024-10-25 | 4 | 0.1900 |
| 2024-10-28 | 5 | 0.1750 |
| 2024-10-29 | 6 | 0.1667 |
| 2024-10-30 | 6 | 0.1667 |
| 2024-10-31 | 6 | 0.3333 |
| 2024-11-01 | 2 | 0.3233 |
| 2024-11-04 | 3 | 0.2792 |
| 2024-11-05 | 3 | 0.2611 |
| 2024-11-06 | 4 | 0.2250 |
| 2024-11-07 | 5 | 0.2470 |
| 2024-11-08 | 2 | 0.2439 |
| 2024-11-11 | 3 | 0.2375 |
| 2024-11-12 | 4 | 0.2056 |
| 2024-11-13 | 5 | 0.1833 |
| 2024-11-14 | 6 | 0.2083 |
| 2024-11-15 | 4 | 0.2333 |
| 2024-11-18 | 4 | 0.1917 |
| 2024-11-19 | 5 | 0.1800 |
| 2024-11-20 | 5 | 0.1750 |
| 2024-11-21 | 6 | 0.1667 |
| 2024-11-22 | 6 | 0.2222 |
| 2024-11-25 | 6 | 0.2708 |
| 2024-11-26 | 3 | 0.2917 |
| 2024-11-27 | 3 | 0.2778 |
| 2024-11-29 | 4 | 0.2778 |
| 2024-12-02 | 4 | 0.2917 |
| 2024-12-03 | 3 | 0.3233 |
| 2024-12-04 | 2 | 0.3208 |
| 2024-12-05 | 3 | 0.2611 |
| 2024-12-06 | 4 | 0.2250 |
| 2024-12-09 | 5 | 0.2750 |
| 2024-12-10 | 2 | 0.2900 |
| 2024-12-11 | 3 | 0.2375 |
| 2024-12-12 | 4 | 0.2056 |
| 2024-12-13 | 5 | 0.2333 |
| 2024-12-16 | 6 | 0.2778 |
| 2024-12-17 | 3 | 0.3333 |
| 2024-12-18 | 3 | 0.3889 |
| 2024-12-19 | 2 | 0.4167 |
| 2024-12-20 | 3 | 0.3889 |
| 2024-12-23 | 2 | 0.3889 |
| 2024-12-24 | 3 | 0.3333 |
| 2024-12-26 | 3 | 0.3333 |
| 2024-12-27 | 3 | 0.3333 |
| 2024-12-30 | 3 | 0.3889 |
| 2024-12-31 | 2 | 0.4167 |
| 2025-01-02 | 3 | 0.2972 |
| 2025-01-03 | 2 | 0.2900 |
| 2025-01-06 | 3 | 0.2375 |
| 2025-01-07 | 4 | 0.2056 |
| 2025-01-08 | 5 | 0.1833 |
| 2025-01-10 | 6 | 0.3333 |
| 2025-01-13 | 2 | 0.3889 |
| 2025-01-14 | 3 | 0.3333 |
| 2025-01-15 | 3 | 0.4167 |
| 2025-01-16 | 2 | 0.4444 |
| 2025-01-17 | 2 | 0.4167 |
| 2025-01-21 | 3 | 0.3233 |
| 2025-01-22 | 2 | 0.3208 |
| 2025-01-23 | 3 | 0.2611 |
| 2025-01-24 | 4 | 0.2250 |
| 2025-01-27 | 5 | 0.3500 |
| 2025-01-28 | 2 | 0.3567 |
| 2025-01-29 | 2 | 0.3208 |
| 2025-01-30 | 3 | 0.2611 |
| 2025-01-31 | 4 | 0.2250 |
| 2025-02-03 | 5 | 0.3500 |
| 2025-02-04 | 2 | 0.3958 |
| 2025-02-05 | 2 | 0.3611 |
| 2025-02-06 | 3 | 0.2917 |
| 2025-02-07 | 4 | 0.3611 |
| 2025-02-10 | 2 | 0.4167 |
| 2025-02-11 | 3 | 0.4167 |
| 2025-02-12 | 2 | 0.5000 |
| 2025-02-13 | 2 | 0.3567 |
| 2025-02-14 | 2 | 0.2397 |
| 2025-02-18 | 3 | 0.2026 |
| 2025-02-19 | 4 | 0.1808 |
| 2025-02-20 | 5 | 0.1669 |
| 2025-02-21 | 5 | 0.1586 |
| 2025-02-24 | 6 | 0.1448 |
| 2025-02-25 | 7 | 0.1339 |
| 2025-02-26 | 8 | 0.3250 |
| 2025-02-27 | 2 | 0.4167 |
| 2025-02-28 | 3 | 0.3333 |
| 2025-03-03 | 3 | 0.2750 |
| 2025-03-04 | 3 | 0.2633 |
| 2025-03-05 | 3 | 0.2458 |
| 2025-03-06 | 4 | 0.2250 |
| 2025-03-07 | 5 | 0.2000 |
| 2025-03-10 | 5 | 0.3500 |
| 2025-03-11 | 2 | 0.5000 |
| 2025-03-12 | 2 | 0.5000 |
| 2025-03-13 | 2 | 0.5000 |
| 2025-03-14 | 2 | 0.3250 |
| 2025-03-17 | 2 | 0.2900 |
| 2025-03-18 | 3 | 0.2375 |
| 2025-03-19 | 4 | 0.2375 |
| 2025-03-20 | 5 | 0.1833 |
| 2025-03-21 | 6 | 0.2778 |
| 2025-03-24 | 3 | 0.2852 |
| 2025-03-25 | 3 | 0.2792 |
| 2025-03-26 | 3 | 0.2611 |
| 2025-03-27 | 4 | 0.2250 |
| 2025-03-28 | 5 | 0.2667 |
| 2025-03-31 | 3 | 0.2792 |
| 2025-04-01 | 3 | 0.2611 |
| 2025-04-02 | 4 | 0.2250 |
| 2025-04-03 | 5 | 0.3500 |
| 2025-04-04 | 2 | 0.5000 |
| 2025-04-07 | 2 | 0.5000 |
| 2025-04-08 | 2 | 0.5000 |
| 2025-04-09 | 2 | 0.5000 |
| 2025-04-10 | 2 | 0.5000 |
| 2025-04-11 | 2 | 0.3130 |
| 2025-04-14 | 2 | 0.3611 |
| 2025-04-15 | 3 | 0.2917 |
| 2025-04-16 | 4 | 0.2467 |
| 2025-04-17 | 3 | 0.2458 |
| 2025-04-21 | 4 | 0.2250 |
| 2025-04-22 | 5 | 0.2167 |
| 2025-04-23 | 5 | 0.2467 |
| 2025-04-24 | 4 | 0.2137 |
| 2025-04-25 | 3 | 0.2085 |
| 2025-04-28 | 4 | 0.1877 |
| 2025-04-29 | 5 | 0.1752 |
| 2025-04-30 | 5 | 0.1698 |
| 2025-05-01 | 6 | 0.1548 |
| 2025-05-02 | 7 | 0.1548 |
| 2025-05-05 | 6 | 0.2694 |
| 2025-05-06 | 2 | 0.2900 |
| 2025-05-07 | 3 | 0.2375 |
| 2025-05-08 | 4 | 0.2056 |
| 2025-05-09 | 5 | 0.1833 |
| 2025-05-12 | 6 | 0.2356 |
| 2025-05-13 | 2 | 0.2454 |
| 2025-05-14 | 3 | 0.2030 |
| 2025-05-15 | 4 | 0.1769 |
| 2025-05-16 | 5 | 0.1586 |
| 2025-05-19 | 6 | 0.1448 |
| 2025-05-20 | 7 | 0.2128 |
| 2025-05-21 | 8 | 0.2361 |
| 2025-05-22 | 3 | 0.2917 |
| 2025-05-23 | 4 | 0.3067 |
| 2025-05-27 | 2 | 0.2018 |
| 2025-05-28 | 3 | 0.1646 |
| 2025-05-29 | 4 | 0.1426 |
| 2025-05-30 | 5 | 0.1281 |
| 2025-06-02 | 5 | 0.1229 |
| 2025-06-03 | 6 | 0.1121 |
| 2025-06-04 | 7 | 0.1053 |
| 2025-06-05 | 8 | 0.1139 |
| 2025-06-06 | 9 | 0.0958 |
| 2025-06-09 | 10 | 0.1071 |
| 2025-06-10 | 11 | 0.0909 |
| 2025-06-11 | 11 | 0.1276 |
| 2025-06-12 | 11 | 0.1307 |
| 2025-06-13 | 11 | 0.1312 |
| 2025-06-16 | 7 | 0.1381 |
| 2025-06-17 | 7 | 0.1369 |
| 2025-06-18 | 7 | 0.1369 |
| 2025-06-20 | 8 | 0.1369 |
| 2025-06-23 | 7 | 0.1386 |
| 2025-06-24 | 6 | 0.1369 |
| 2025-06-25 | 7 | 0.1321 |
| 2025-06-26 | 8 | 0.1295 |
| 2025-06-27 | 8 | 0.1310 |
| 2025-06-30 | 8 | 0.2004 |
| 2025-07-01 | 7 | 0.2698 |
| 2025-07-02 | 3 | 0.2019 |
| 2025-07-03 | 3 | 0.2216 |
| 2025-07-07 | 3 | 0.1586 |
| 2025-07-08 | 4 | 0.1366 |
| 2025-07-09 | 5 | 0.1240 |
| 2025-07-10 | 6 | 0.1159 |
| 2025-07-11 | 7 | 0.1108 |
| 2025-07-14 | 8 | 0.1061 |
| 2025-07-15 | 8 | 0.1030 |
| 2025-07-16 | 9 | 0.1026 |
| 2025-07-17 | 10 | 0.1076 |
| 2025-07-18 | 10 | 0.1167 |
| 2025-07-21 | 11 | 0.1093 |
| 2025-07-22 | 11 | 0.1038 |
| 2025-07-23 | 9 | 0.1059 |
| 2025-07-24 | 9 | 0.1048 |
| 2025-07-25 | 9 | 0.1033 |
| 2025-07-28 | 9 | 0.1007 |
| 2025-07-29 | 10 | 0.1394 |
| 2025-07-30 | 11 | 0.1525 |
| 2025-07-31 | 6 | 0.1833 |
| 2025-08-01 | 5 | 0.3208 |
| 2025-08-04 | 2 | 0.3611 |
| 2025-08-05 | 3 | 0.2917 |
| 2025-08-06 | 4 | 0.3750 |
| 2025-08-07 | 2 | 0.5000 |
| 2025-08-08 | 2 | 0.2607 |
| 2025-08-11 | 2 | 0.3611 |
| 2025-08-12 | 3 | 0.2031 |
| 2025-08-13 | 4 | 0.1891 |
| 2025-08-14 | 4 | 0.1769 |
| 2025-08-15 | 5 | 0.1586 |
| 2025-08-18 | 6 | 0.1448 |
| 2025-08-19 | 7 | 0.1560 |
| 2025-08-20 | 8 | 0.1750 |
| 2025-08-21 | 5 | 0.1867 |
| 2025-08-22 | 5 | 0.1800 |
| 2025-08-25 | 5 | 0.1750 |
| 2025-08-26 | 6 | 0.1861 |
| 2025-08-27 | 6 | 0.1900 |
| 2025-08-28 | 6 | 0.1958 |
| 2025-08-29 | 4 | 0.2056 |
| 2025-09-02 | 5 | 0.1833 |
| 2025-09-03 | 6 | 0.2833 |
| 2025-09-04 | 2 | 0.3208 |
| 2025-09-05 | 3 | 0.2611 |
| 2025-09-08 | 4 | 0.2333 |
| 2025-09-09 | 5 | 0.2250 |
| 2025-09-10 | 4 | 0.3611 |
| 2025-09-11 | 2 | 0.3889 |
| 2025-09-12 | 3 | 0.3125 |
| 2025-09-15 | 3 | 0.2733 |
| 2025-09-16 | 3 | 0.2583 |
| 2025-09-17 | 4 | 0.2333 |
| 2025-09-18 | 4 | 0.2250 |
| 2025-09-19 | 5 | 0.3500 |
| 2025-09-22 | 2 | 0.2309 |
| 2025-09-23 | 2 | 0.1946 |
| 2025-09-24 | 3 | 0.1899 |
| 2025-09-25 | 4 | 0.1362 |
| 2025-09-26 | 5 | 0.1217 |
| 2025-09-29 | 6 | 0.1139 |
| 2025-09-30 | 7 | 0.1080 |
| 2025-10-01 | 8 | 0.1036 |
| 2025-10-02 | 9 | 0.1006 |
| 2025-10-03 | 9 | 0.0988 |
| 2025-10-06 | 10 | 0.0964 |
| 2025-10-07 | 10 | 0.0955 |
| 2025-10-08 | 10 | 0.0939 |
| 2025-10-09 | 11 | 0.0909 |
| 2025-10-10 | 11 | 0.2568 |
| 2025-10-13 | 2 | 0.2900 |
| 2025-10-14 | 3 | 0.2375 |
| 2025-10-15 | 4 | 0.2375 |
| 2025-10-16 | 5 | 0.1833 |
| 2025-10-17 | 6 | 0.2500 |
| 2025-10-20 | 3 | 0.2972 |
| 2025-10-21 | 2 | 0.2900 |
| 2025-10-22 | 3 | 0.2375 |
| 2025-10-23 | 4 | 0.2056 |
| 2025-10-24 | 5 | 0.1833 |
| 2025-10-27 | 6 | 0.1988 |
| 2025-10-28 | 2 | 0.1919 |
| 2025-10-29 | 3 | 0.1611 |
| 2025-10-30 | 4 | 0.1692 |
| 2025-10-31 | 5 | 0.1284 |
| 2025-11-03 | 6 | 0.1182 |
| 2025-11-04 | 7 | 0.1101 |
| 2025-11-05 | 8 | 0.1036 |
| 2025-11-06 | 9 | 0.0982 |
| 2025-11-07 | 10 | 0.0939 |
| 2025-11-10 | 11 | 0.0909 |
| 2025-11-11 | 11 | 0.2248 |
| 2025-11-12 | 3 | 0.2583 |
| 2025-11-13 | 4 | 0.2333 |
| 2025-11-14 | 4 | 0.2250 |
| 2025-11-17 | 5 | 0.2806 |
| 2025-11-18 | 2 | 0.2967 |
| 2025-11-19 | 3 | 0.2458 |
| 2025-11-20 | 4 | 0.2250 |
| 2025-11-21 | 5 | 0.2000 |
| 2025-11-24 | 5 | 0.2967 |
| 2025-11-25 | 2 | 0.3208 |
| 2025-11-26 | 3 | 0.2611 |
| 2025-11-28 | 4 | 0.2250 |
| 2025-12-01 | 5 | 0.3067 |
| 2025-12-02 | 2 | 0.3611 |
| 2025-12-03 | 3 | 0.2778 |
| 2025-12-04 | 4 | 0.2147 |
| 2025-12-05 | 4 | 0.2097 |
| 2025-12-08 | 3 | 0.2022 |
| 2025-12-09 | 4 | 0.1835 |
| 2025-12-10 | 5 | 0.1586 |
| 2025-12-11 | 6 | 0.1669 |
| 2025-12-12 | 7 | 0.1339 |
| 2025-12-15 | 8 | 0.4114 |
| 2025-12-16 | 5 | 0.4909 |
492 rows
Parameters
get_label_uniqueness accepts the following parameters.
| Parameter | Type | Description | Example |
|---|---|---|---|
labels | pd.DataFrame | None | Labels with a Holding Period per date and ticker, such as the result of get_triple_barrier_labels, get_fixed_horizon_labels or get_trend_scanning_labels. Defaults to None, which uses the triple-barrier labels with their defaults. | None, which uses the triple-barrier labels with their defaults |
period | str | The time period of the labels. Options are: “intraday” (intraday prices), “daily” (daily prices), “weekly” (weekly prices), “monthly” (monthly prices), “quarterly” (quarterly prices), “yearly” (yearly prices). Defaults to “daily”. | "weekly" |
close_column | str | The column name for closing prices in the historical data. Defaults to “Adj Close”. | "Close" |
rounding | int | None | The number of decimals to round the results to. Defaults to None, which uses the rounding of the Toolkit (4 unless set otherwise). | 2 |
show_columns | str | list[str] | None | The columns to keep, a name or a list of names, matched on every column level, or the rows when no column has those names (such as the line items of a financial statement). Names that do not exist are logged, and when none exist the result is returned in full. Defaults to None, which keeps every column. | None, which keeps every column |
References
- Paper López de Prado, M. (2018). “Advances in Financial Machine Learning.” Wiley, sections 4.3 and 4.4 (Snippets 4.1 and 4.2).
- Library Referenced against RiskLabAI’s calculate_average_uniqueness