Thank you for your interest in improving f1_models, an end-to-end F1 race winner prediction system built with Python, FastAPI, and modern machine learning tooling.
This document explains how to propose changes, report bugs, and add new features in a consistent way.
By participating in this project, you agree to uphold a respectful, constructive, and inclusive environment.
Be kind, stay on topic (F1 and data), and assume good intent.
If you experience or witness unacceptable behavior, please open a confidential issue or contact the maintainer directly via the email address listed on the maintainer’s GitHub profile.
Use GitHub Issues for:
- Bug reports.
- Feature requests.
- Clarifications about implementation details (API, models, data schema).
Before opening a new issue, please:
- Search existing issues to avoid duplicates.
- Include enough context: logs, error messages, operating system, Python version, and clear steps to reproduce the problem.
- Fork the repository and clone your fork.
- Create and activate a virtual environment:
python -m venv .venv && source .venv/bin/activate(Linux/macOS)python -m venv .venv && .venv\\Scripts\\activate(Windows)
- Install dependencies:
pip install -r requirements.txtorpip install -r req.txt(depending on which file is used in the repo).
- Copy
.env.exampleto.envand fill in the required values (API keys, secrets, and other configuration). - Run the API locally:
uvicorn main:app --reload
- Run tests to ensure everything passes before you make changes:
pytestorpython -m pytest(if tests are configured).
When reporting a bug, include:
- A clear, descriptive title.
- Steps to reproduce (ideally, a minimal example).
- Expected versus actual behavior.
- Logs, error messages, and screenshots if relevant.
- Environment details: operating system, Python version, and dependency versions if known.
Use the bug label if it is available.
For new ideas (models, features, visualizations, MLOps improvements), open an issue labeled enhancement and include:
- The problem or use case.
- Your proposed solution or approach.
- Any alternatives you considered.
- Potential impact on performance, complexity, or user experience.
This helps discuss and align on the design before you invest time in code.
Once an issue is approved or assigned:
- Create a feature branch from
main:git checkout -b feature/my-feature-name
- Make changes in small, focused commits with meaningful messages.
- Keep your branch up to date with
main:git fetch origin && git rebase origin/main
- Ensure:
- All tests pass.
- Linting and formatting are clean (see “Code style and standards” below).
- Push your branch and open a Pull Request (PR) against
main.
In your PR description:
- Reference related issues (for example,
Closes #12). - Describe what changed and why.
- Add screenshots, plots, or metrics for visual changes or modeling results if helpful.
To keep the codebase consistent and easy to read:
- Follow PEP 8 for Python code style.
- Use type hints wherever possible for new functions and modules.
- Prefer clear, descriptive names over abbreviations (for example,
race_results_dfinstead ofrrdf). - Keep functions focused; avoid large “god scripts”. Split logic into smaller utilities when needed.
If this project adopts linters or formatters (for example, black, isort, or ruff), run them before committing.
High-quality predictions and stable APIs are critical for this project.
- Add or update tests when you:
- Add new APIs (FastAPI endpoints).
- Change preprocessing or feature engineering logic.
- Introduce or replace models.
- Use existing test files (such as
test_main.pyandinferencetest.py) as references where applicable.
A pull request may be blocked or rejected until:
- Tests pass locally.
- Continuous integration (CI) checks (for example, GitHub Actions) pass successfully.
If you are contributing to the machine learning side (new models, features, or training scripts):
- Document:
- Data sources and assumptions.
- Target variable(s) and training/validation splits.
- Evaluation metrics (for example, accuracy, log-loss, Brier score).
- Include a short model card in the PR description or in a separate markdown file, covering:
- Strengths and limitations.
- Tracks or race conditions where the model performs poorly.
- Any known biases or caveats.
For API, infrastructure, or deployment work:
- Keep endpoints backward compatible whenever possible.
- Document breaking changes clearly in the PR.
- Update or add documentation for:
- New endpoints (path, method, request/response schema).
- Environment variables.
- Deployment configuration (for example,
render.yamland CI workflows).
Good documentation is a valuable contribution.
- Fix typos, clarify explanations, or add examples to the README and other docs.
- Ensure code snippets are runnable and consistent with the current API and project structure.
- You can open small PRs just for documentation improvements; these are welcome.
By contributing to f1_models, you agree that your contributions will be licensed under the same license as this repository (see the LICENSE file for details).
Thank you for helping make f1_models a better F1 race prediction platform for fans, analysts, and machine learning practitioners.