Contributing
Contributions are welcome. Please follow these guidelines.
Code Style
- C++23. Use modern features (concepts,
[[nodiscard]], structured bindings) where they add clarity. - No raw loops over matrix elements. Use Eigen expression templates.
- No
virtual. Use CRTP for polymorphism. - Warning-free under
-Wall -Wextra -Wpedantic.
Adding a New Estimator
- Create the internal header at
Skigen/src/Module/Name.h. - Inherit from the appropriate CRTP base (
TransformerorPredictor). - Implement
fit_impl,transform_impl/predict_impl, and accessors. - Add the header to the module file (e.g.
Skigen/Preprocessing). - Write tests in
tests/test_name.cpp. - Add a parity script in
tests/parity/. - Document in
doc/website/docs/guide/.
Testing
Every estimator must have:
- Unit tests for correctness.
- A Python parity script that generates reference data from scikit-learn.
- C++ parity tests that compare Skigen output against the reference.
Tolerance: 1e-12 for double, 1e-5 for float.
Pull Requests
- Keep changes focused — one estimator or feature per PR.
- Ensure all tests pass before submitting.
- Include benchmark results if the change affects performance.