Documentation Setup
Relevant source files
The following files were used as context for generating this wiki page:
AlphaPy documentation is structured to support both speculators and data scientists using a machine learning pipeline for market and sports prediction. The primary documentation is hosted via ReadTheDocs, providing a comprehensive guide to the framework's capabilities, including integration with scikit-learn, Keras, xgboost, LightGBM, and CatBoost.
The setup facilitates the understanding of core workflows like MarketFlow for financial markets and SportFlow for sporting events. It also provides specific installation instructions for optional high-performance libraries and external analysis tools like Quantopian’s pyfolio.
Sources: README.rst:1-15, setup.py:5-10
Documentation Structure and Hosting
The project utilizes ReadTheDocs as its primary hosting platform. The documentation covers installation, core modules, and specific pipelines.
Primary Resources
- Official Documentation URL: http://alphapy.readthedocs.io/en/latest/
- Source Code: https://github.com/ScottFreeLLC/AlphaPy
- Issue Tracker: http://github.com/ScottFreeLLC/AlphaPy/issues
Sources: README.rst:24-27, README.rst:69-72, setup.py:12
Technical Metadata
The setup.py file defines the project metadata that populates package indexes and documentation headers.
| Field | Value |
|---|---|
| Maintainer | ScottFree LLC [Robert D. Scott II, Mark Conway] |
| License | Apache License, Version 2 |
| Version | 2.5.0 |
| Topic | Scientific/Engineering :: Mathematics |
Sources: setup.py:9-25
In-Code Documentation and Logging
AlphaPy uses a combination of Python docstrings (NumPy/SciPy style) and a standardized logging configuration to document system behavior during execution.
Logging Configuration
The system initializes loggers across all major modules (e.g., model.py, market_flow.py, sport_flow.py) to record configuration parameters, pipeline progress, and error states.
The diagram shows the dual-destination logging flow used in pipelines like SportFlow.
Sources: alphapy/sport_flow.py:465-478, alphapy/model.py:197-200
Configuration Logging
The get_model_config function in model.py is a primary documentation point for runtime settings. It logs every parameter from model.yml, providing an audit trail of the documentation setup for a specific run.
Sources: alphapy/model.py:270-335
Visual Documentation (Pipelines)
AlphaPy documentation extensively uses pipeline diagrams to explain data flow. These are represented in the README and implemented through the plots.py module to generate visual artifacts during model training.
Pipeline Flows
The project documents three main pipelines:
- Model Pipeline: General machine learning workflow.
- MarketFlow Pipeline: Tailored for financial time-series.
- SportFlow Pipeline: Tailored for game-based predictions.
This diagram illustrates the relationship between configuration files and the automated generation of visual documentation.
Sources: README.rst:17-64, alphapy/model.py:657-662
Component Documentation
Key modules contain internal documentation for specific machine learning components.
Estimator Map
The framework documents supported algorithms in estimators.py, mapping abbreviations to their respective classes.
| Abbreviation | Algorithm Class |
|---|---|
| XGB | xgboost.XGBClassifier |
| LGB | lightgbm.LGBMClassifier |
| RF | RandomForestClassifier |
| KERASC | KerasClassifier |
Sources: alphapy/estimators.py:126-168
Plotting Documentation
The plots.py module defines the visual documentation artifacts generated at runtime, including:
- Calibration Plots: For classification reliability.
- Feature Importance: Horizontal bar charts of relative importance.
- Learning Curves: Training vs. Cross-Validation scores.
- ROC Curves: Receiver Operating Characteristic.
Sources: alphapy/plots.py:34-60, alphapy/plots.py:168-180
External Documentation Dependencies
AlphaPy documentation relies on the documentation of several key sub-packages, as noted in the installation guides.
- XGBoost: http://xgboost.readthedocs.io/en/latest/build.html
- LightGBM: https://lightgbm.readthedocs.io/en/latest/Installation-Guide.html
- CatBoost: https://catboost.ai/docs/concepts/python-installation.html
Sources: README.rst:43-56
Summary
The documentation setup for AlphaPy is designed to be multi-layered, combining external ReadTheDocs pages with internal YAML-driven logging and automated plot generation. This ensures that users can access high-level conceptual documentation while simultaneously having access to detailed, execution-specific technical records produced by modules like model.py and plots.py.
Sources: README.rst:24-27, alphapy/model.py:338-345, alphapy/plots.py:100-112