Contributing Guidelines
Relevant source files
The following files were used as context for generating this wiki page:
The AlphaPy project provides a structured framework for speculators and data scientists to build machine learning pipelines using scikit-learn, Keras, and various gradient boosting libraries. Contributing to this project involves adhering to community standards, understanding the core pipeline architecture, and following specific protocols for issue reporting and project development.
Contributors are expected to maintain a harassment-free environment as defined in the project's pledge to inclusivity. This ensures that participation is welcoming for everyone regardless of experience level or background.
Sources: CODE_OF_CONDUCT.md:1-12, README.rst:1-15
Code of Conduct and Community Standards
AlphaPy follows the Contributor Covenant to ensure a positive environment. Contributors must adhere to behavioral standards that prioritize respectful language, empathy, and the acceptance of constructive criticism.
Acceptable and Unacceptable Behavior
| Behavior Type | Examples |
|---|---|
| Positive | Inclusive language, respecting viewpoints, focusing on community best interests. |
| Unacceptable | Sexualized imagery/attention, trolling, personal/political attacks, publishing private info. |
Maintainers have the authority to remove or reject contributions that do not align with these standards and may ban participants for inappropriate conduct. Instances of abusive behavior can be reported to scottfree.analytics@scottfreellc.com.
Sources: CODE_OF_CONDUCT.md:14-41, CODE_OF_CONDUCT.md:52-56
Project Architecture for Contributors
Understanding the system architecture is critical for implementing new features or fixing bugs. AlphaPy utilizes a pipeline-based approach where models are configured via YAML files and executed through specialized flows like MarketFlow or SportFlow.
The following diagram illustrates the high-level workflow for model development within the framework:
The project entry points are defined in setup.py, allowing contributors to interact with the system via console scripts: alphapy, mflow, and sflow.
Sources: alphapy/main.py:535-555, setup.py:65-69, README.rst:55-75
Development Guidelines
Dependency Management
AlphaPy relies on a specific set of scientific computing and machine learning libraries. Contributors must ensure that any changes are compatible with the following core requirements:
| Package | Minimum Version | Use Case |
|---|---|---|
scikit-learn | 0.23.1 | Core ML algorithms and utilities |
pandas | 1.0 | Data structure management |
numpy | 1.17 | Numerical operations |
tensorflow | 2.0 | Backend for Keras models |
pyyaml | 5.0 | Configuration parsing |
Sources: setup.py:36-53
Configuration Logic
The system is driven by model.yml. Developers adding features must update get_model_config in alphapy/model.py to handle new configuration keys. The configuration is divided into sections such as project, data, features, model, and pipeline.
def get_model_config():
# ... logic to read yaml ...
specs['directory'] = cfg['project']['directory']
specs['model_type'] = ModelType(model_types[model_type])
# ... logic to log parameters ...
return specs
Sources: alphapy/model.py:165-175, alphapy/model.py:270-285
Technical Workflow for Contributions
Reporting Issues
The official channel for support and reporting bugs is the GitHub issue tracker.
- Bug Reports: Should include clear steps to reproduce the error.
- Feature Requests: Should describe the purpose and expected outcome of the new functionality.
Sources: README.rst:80-85
Model and Estimator Integration
AlphaPy unifies various algorithms through the Model class and Estimator wrappers. When contributing a new algorithm, it must be mapped within the estimator_map or handled via the optional package loading logic for libraries like XGBoost, LightGBM, or CatBoost.
Conclusion
Contributing to AlphaPy requires a balance of adhering to community conduct standards and understanding a highly configurable, pipeline-driven machine learning architecture. By following these guidelines, contributors ensure that the framework remains robust for both financial market speculation and general data science applications.
Sources: README.rst:11-15, CODE_OF_CONDUCT.md:1-5