]> Piment Noir Git Repositories - freqai-strategies.git/commit
refactor!: reorganize label selection with distance, cluster and density methods...
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 1 Jan 2026 23:01:19 +0000 (00:01 +0100)
committerGitHub <noreply@github.com>
Thu, 1 Jan 2026 23:01:19 +0000 (00:01 +0100)
commitfef729aa2d9f75aa968444b06b9eaeb76f664b83
tree678dfffb3aa1a30429cb75cc6bbd8a9feb58e7da
parentf6e4a54753170099b47de272aa9f24bc82f26b11
refactor!: reorganize label selection with distance, cluster and density methods (#29)

* refactor: reorganize label selection with distance, cluster and density methods

* refactor: import lru_cache directly instead of functools module

* chore: remove unused imports in Utils.py

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor: cleanup n_neighbors adjustment in QuickAdapterRegressorV3

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* fix: use unbounded cache for constant-returning helper methods

Replace @lru_cache(maxsize=1) with @lru_cache(maxsize=None) for all
static methods that return constant sets. Using maxsize=None is more
idiomatic and efficient for parameterless functions that always return
the same value.

* refactor: add _prepare_distance_kwargs to centralize distance kwargs preparation

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor: cleanup extrema weighting API

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor: cleanup extrema smoothing API

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor: align namespace

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor: add more tunables validations

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor: simplify cluster-based label selection

- Remove ClusterSelectionMethod type and related constants
- Unify selection methods to use DistanceMethod for both cluster and trial selection
- Add separate trial_selection_method parameter for within-cluster selection
- Change power_mean default from 2.0 to 1.0 for internal consistency
- Add validation for selection_method and trial_selection_method parameters

* fix: add missing validations for label_distance_metric and label_density_aggregation_param

- Add validation for label_distance_metric parameter at configuration time
- Add early validation for label_density_aggregation_param (quantile and power_mean)
- Ensures invalid configuration values fail fast with clear error messages
- Harmonizes error messages with existing validation patterns in the codebase

* fix: add validation for label_cluster_metric and custom metrics support in topsis

- Add validation that label_cluster_metric is in _distance_metrics_set()
- Implement custom metrics support in _topsis_scores (hellinger, shellinger,
  harmonic/geometric/arithmetic/quadratic/cubic/power_mean, weighted_sum)
  matching _compromise_programming_scores implementation

* docs: update README.md with refactored label selection methods

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* docs: fix config parameter and bump to v3.9.0

- Fix config-template.json: label_metric -> label_method
- Bump version from 3.8.5 to 3.9.0 in model and strategy

Parameter names now match QuickAdapterRegressorV3.py implementation.

* docs: refine README label selection methods descriptions

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
* refactor: refine error message

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
---------

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
README.md
quickadapter/user_data/config-template.json
quickadapter/user_data/freqaimodels/QuickAdapterRegressorV3.py
quickadapter/user_data/strategies/QuickAdapterV3.py
quickadapter/user_data/strategies/Utils.py