Contributing¶
We welcome contributions to scikit-feature! This document provides guidelines for
contributing.
Development setup¶
# Clone the repository
git clone https://github.com/NoRaincheck/scikit-feature.git
cd scikit-feature
# Install dependencies and the package in editable mode
uv sync --group dev
uv pip install -e .
Code style¶
We use Ruff for linting and formatting and ty for type checking:
Testing¶
Tests are located in the tests/ directory, one file per algorithm. Run them with pytest:
Adding a new algorithm¶
- Create your algorithm file under the appropriate category in
skfeature/function/<category>/ - Follow the existing pattern for the scoring function signature so it stays compatible
with
sklearn.feature_selection.SelectKBest - Add comprehensive docstrings with inputs, outputs, and references
- Write unit tests in the corresponding test file under
tests/ - Update this documentation (see below)
Documentation¶
The documentation is built with Material for MkDocs.
Navigation lives in mkdocs.yml and the pages live under docs/.
# Install the docs dependencies
uv sync --group docs
# Serve the docs locally with live reload
make serve-docs
# open http://localhost:8000
# Build the static site
make build-docs
When adding an algorithm:
- Add a reference page under
docs/api/<category>/ - Link it in the category table in
docs/api/algorithms-overview.md - Register it in the
navsection ofmkdocs.yml
Pull request process¶
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-feature) - Make your changes with tests and documentation
- Run linting, formatting, type checking, and tests
(
make format && make lint && make typecheck && make test) - Commit your changes with clear messages
- Push to your fork and open a Pull Request
License¶
By contributing, you agree that your contributions will be licensed under the GNU General Public License v2.0.