Skip to content

Solving part of pending TODOs#68

Merged
lacava merged 17 commits into
masterfrom
TODOs
Apr 27, 2026
Merged

Solving part of pending TODOs#68
lacava merged 17 commits into
masterfrom
TODOs

Conversation

@gAldeia
Copy link
Copy Markdown
Collaborator

@gAldeia gAldeia commented Apr 27, 2026

This pull request introduces several improvements and cleanups across the codebase, focusing on enforcing correct usage of the bandit interface, improving template instantiation and linkage, cleaning up unnecessary includes, and refining dataset splitting and evaluation logic.

Other minor changes include code cleanup, removal of outdated TODOs, and improved naming for clarity.

Bandit Interface and Error Handling

  • Added a bandit_set flag and ensure_bandit_set() method to the Bandit class to enforce that the bandit operator is initialized before use, raising a clear error otherwise.

Template Instantiation and Linkage

  • Added explicit template instantiations and extern template declarations for Engine and Evaluation classes for all supported ProgramTypes, improving build reliability and reducing potential linker errors.

Include Cleanup and Build Hygiene

  • Removed unnecessary and problematic .cpp includes from header files in the bindings

Dataset Splitting and Data Handling

  • Refined stratified split logic in Dataset::init() so that, for small classes, training and validation sets never overlap; if a class is too small for validation, it is used only for training. Also removed a redundant condition and cleaned up shuffle logic.

Evaluation Metrics and Numerical Stability

  • Improved numerical stability and correctness in average_precision_score by tightening the epsilon threshold, using fabs for floating-point comparison, and correcting the type of unique_probas to set<float>. Also fixed the loop bound in PR curve integration.

@lacava lacava merged commit 603a814 into master Apr 27, 2026
5 of 6 checks passed
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.

2 participants