Skip to content

feat: add Observable.weight and weighted_sum_filter#96

Merged
jc-macdonald merged 1 commit intomainfrom
feat/weighted-objectives
Apr 17, 2026
Merged

feat: add Observable.weight and weighted_sum_filter#96
jc-macdonald merged 1 commit intomainfrom
feat/weighted-objectives

Conversation

@jc-macdonald
Copy link
Copy Markdown
Contributor

Summary

Adds weighted multi-objective support via two complementary features:

Observable.weight (#90)

  • New weight: float = 1.0 field on Observable (backward-compatible default)
  • Propagated through all Pareto functions: extract_front, pareto_rank, hypervolume, igd_plus
  • Propagated through Study.front(), Study.front_hypervolume(), Study.summary(), top_k_pareto_filter
  • Propagated into run_adaptive() (scales optuna objective values)
  • Weights scale the objective space before non-dominated sorting, preserving multi-objective structure while reflecting user preferences

weighted_sum_filter (#91)

  • New weighted_sum_filter(weights, k) returning a Phase.filter_fn-compatible callable
  • Direction-aware: flips MAXIMIZE objectives before normalisation
  • Min-max normalises scores before weighting to handle different scales
  • Handles edge cases (constant columns, subset of objectives)
  • Exported from trade_study.__init__

Tests

  • 13 new tests (5 in test_pareto.py, 8 in test_study.py)
  • 221 total tests passing, 99.63% coverage

Closes #90, closes #91

- Add weight: float = 1.0 to Observable (backward-compatible)
- Propagate weights through extract_front, pareto_rank, hypervolume,
  igd_plus via new _normalize_objectives helper
- Propagate weights through Study.front, Study.front_hypervolume,
  Study.summary, top_k_pareto_filter, and run_adaptive
- Add weighted_sum_filter: scalarised ranking filter with min-max
  normalisation, direction-aware, compatible with Phase.filter_fn
- Export weighted_sum_filter from trade_study.__init__
- 13 new tests covering weighted Pareto and weighted_sum_filter

Closes #90, closes #91
@jc-macdonald jc-macdonald merged commit af4cd86 into main Apr 17, 2026
4 checks passed
@jc-macdonald jc-macdonald deleted the feat/weighted-objectives branch April 17, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add weighted_sum_filter for single-objective scalarized ranking Add weight field to Observable for weighted Pareto analysis

1 participant