AutoHestia¶
AutoHestia automatically sweeps all combinations of partitioning algorithms and
similarity metrics on your dataset, evaluates each combination with a k-nearest
neighbours probe, and applies guardrails to select the best-performing splits.
Automatic benchmarking and selection of dataset partitioning strategies.
Sweeps all combinations of built-in (or custom) partitioning algorithms and pre-computed similarity metrics, evaluates each combination using a k-nearest neighbours probe across similarity thresholds from 0.1 to 1.0, and ranks them by monotonicity and mean performance. A guardrail filter then retains only experiments that meet minimum test-size and dynamic-range requirements, returning the top-ranked partitions ready for model training.
Initialise AutoHestia.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
df
|
DataFrame
|
DataFrame containing the dataset entities. |
required |
field_name
|
str
|
Column name in |
required |
x
|
ndarray
|
Pre-computed feature matrix of shape |
required |
y
|
ndarray
|
Label array of shape |
required |
sim_dfs
|
Dict[str, DataFrame]
|
Mapping of metric name → pre-computed pairwise similarity
Polars DataFrame (as returned by the |
required |
verbose_level
|
str
|
Logging verbosity. One of |
'debug'
|
best_guardrailed_splits(part_algs=None, custom_algs=None, top_k_parts=3, top_l_sims=3, min_test_size=0.185, min_dynamic_range=0.4, overwrite=False, save_dir='tmp')
¶
Run the full guardrailed partitioning sweep and return the best splits.
For every (partitioning algorithm, similarity metric) pair, partitions are generated at thresholds 0.1–1.0. Each partition is evaluated with a KNN probe (MCC for classification, Spearman CC for regression). Results are then filtered and ranked:
- Dynamic-range filter – combinations whose threshold range spans
less than
min_dynamic_rangeare discarded. - Top-k algorithms – the
top_k_partsalgorithms with the highest worst-case mean performance are retained. - Top-l similarities – for each retained algorithm, the
top_l_simssimilarity metrics with the best mean performance are kept.
Intermediate results are written to <save_dir>/ as CSV files and
partition pickle files.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
part_algs
|
Optional[List[str]]
|
List of algorithm names to include. Must be keys of
|
None
|
custom_algs
|
Optional[Dict[str, Callable]]
|
Optional mapping of name → callable for
user-supplied partitioning functions. The callable must accept the
same keyword arguments as the built-in partition functions
( |
None
|
top_k_parts
|
int
|
Number of top-performing partitioning algorithms to
retain after the guardrail filter. Defaults to |
3
|
top_l_sims
|
int
|
Number of similarity metrics to retain per algorithm.
Defaults to |
3
|
min_test_size
|
float
|
Minimum fraction of the dataset that must fall in
the test split for a threshold to be included. Defaults to |
0.185
|
min_dynamic_range
|
float
|
Minimum required span of valid thresholds for
an algorithm–metric combination to pass the guardrail. Defaults to
|
0.4
|
overwrite
|
bool
|
If |
False
|
save_dir
|
str
|
Root output directory. Defaults to |
'tmp'
|
Returns:
| Type | Description |
|---|---|
dict
|
Dictionary with the following keys:
|
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
plot_good_curves(save_dir='tmp', overwrite=False)
¶
Plot GOOD curves for all evaluated algorithm–metric combinations.
Saves a good.png figure under <save_dir>/figures/ and returns
the Matplotlib figure object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
save_dir
|
str
|
Root directory where the |
'tmp'
|
overwrite
|
bool
|
If |
False
|
Returns:
| Type | Description |
|---|---|
matplotlib.figure.Figure
|
Matplotlib Figure with one line per algorithm–metric combination. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If called before :meth: |