mirror of
https://github.com/webclinic017/drift.git
synced 2026-07-27 18:57:55 +00:00
feat(Docs): prepare for sphinx-pages (#205)
* feat(Docs): prepare for sphinx-pages * feat(CI): added sphinx workflow * feat(Docs): added content * fix(CI): use the patched GH action * fix(CI): set source dir * chore(Docs): reorder project structure * chore(Docs): moved index.rst one level up? * fix(Config): restore the config file, etc. * fix(Docs): adjusted config
This commit is contained in:
committed by
GitHub
parent
1f813f89e3
commit
62686393f5
@@ -0,0 +1,13 @@
|
|||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Sphinx Pages
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: toniher/sphinx-pages@patch-1
|
||||||
|
id: sphinx-pages
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
create_readme: true
|
||||||
|
source_dir: docs
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Minimal makefile for Sphinx documentation
|
||||||
|
#
|
||||||
|
|
||||||
|
# You can set these variables from the command line, and also
|
||||||
|
# from the environment for the first two.
|
||||||
|
SPHINXOPTS ?=
|
||||||
|
SPHINXBUILD ?= sphinx-build
|
||||||
|
SOURCEDIR = content
|
||||||
|
BUILDDIR = _build
|
||||||
|
|
||||||
|
# Put it first so that "make" without argument is like "make help".
|
||||||
|
help:
|
||||||
|
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
|
|
||||||
|
.PHONY: help Makefile
|
||||||
|
|
||||||
|
# Catch-all target: route all unknown targets to Sphinx using the new
|
||||||
|
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
|
||||||
|
%: Makefile
|
||||||
|
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
# Configuration file for the Sphinx documentation builder.
|
||||||
|
#
|
||||||
|
# This file only contains a selection of the most common options. For a full
|
||||||
|
# list see the documentation:
|
||||||
|
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||||
|
|
||||||
|
# -- Path setup --------------------------------------------------------------
|
||||||
|
|
||||||
|
# If extensions (or modules to document with autodoc) are in another directory,
|
||||||
|
# add these directories to sys.path here. If the directory is relative to the
|
||||||
|
# documentation root, use os.path.abspath to make it absolute, like shown here.
|
||||||
|
#
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
sys.path.insert(0, os.path.abspath('.'))
|
||||||
|
|
||||||
|
|
||||||
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
|
project = 'Drift'
|
||||||
|
copyright = '2022, Daniel Szemerey and Mark Szulyovszky'
|
||||||
|
author = 'Daniel Szemerey, Mark Szulyovszky'
|
||||||
|
|
||||||
|
# The full version, including alpha/beta/rc tags
|
||||||
|
release = '1.0'
|
||||||
|
|
||||||
|
|
||||||
|
# -- General configuration ---------------------------------------------------
|
||||||
|
|
||||||
|
# Add any Sphinx extension module names here, as strings. They can be
|
||||||
|
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||||
|
# ones.
|
||||||
|
extensions = ['sphinx.ext.autodoc',
|
||||||
|
'sphinx.ext.autosectionlabel'
|
||||||
|
]
|
||||||
|
|
||||||
|
# Add any paths that contain templates here, relative to this directory.
|
||||||
|
templates_path = ['_templates']
|
||||||
|
|
||||||
|
# List of patterns, relative to source directory, that match files and
|
||||||
|
# directories to ignore when looking for source files.
|
||||||
|
# This pattern also affects html_static_path and html_extra_path.
|
||||||
|
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', 'sphinx-env']
|
||||||
|
|
||||||
|
|
||||||
|
# -- Options for HTML output -------------------------------------------------
|
||||||
|
|
||||||
|
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||||
|
# a list of builtin themes.
|
||||||
|
#
|
||||||
|
html_theme = 'furo'
|
||||||
|
|
||||||
|
# Add any paths that contain custom static files (such as style sheets) here,
|
||||||
|
# relative to this directory. They are copied after the builtin static files,
|
||||||
|
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||||
|
# html_static_path = ['_static']
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
.. drift documentation master file, created by
|
||||||
|
Daniel Szemerey and Mark Szulyovszky on Wed Feb 02 14:02:22 2022.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Welcome to drift's documentation!
|
||||||
|
==================================
|
||||||
|
|
||||||
|
TLDR: *Drift helps you train and make predictions on time-series data.*
|
||||||
|
|
||||||
|
.. figure:: images/pipeline.png
|
||||||
|
:alt: Figure of Data transformation pipeline
|
||||||
|
|
||||||
|
Pipeline of the entire process.
|
||||||
|
|
||||||
|
Drift is an **end-to-end***, **composable*** **modelling pipeline for financial time-series prediction**. It was designed for quantitative financial predictions.
|
||||||
|
|
||||||
|
Drift was specifically engineered not to fool the user: it uses walk-forward method for analysis and makes sure no future information is introduced.
|
||||||
|
|
||||||
|
Drift makes it easy to use state-of-the-art methods financial ML techniques, like the triple-barrier labeling method, ensembling models and adding bet-sizing into the mix (with meta-labeling).
|
||||||
|
|
||||||
|
Drift has two level of usage: You can simply use existing models and transformations and just provide the data and the target asset, or you can customize your own pipeline.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Technical Explanation
|
||||||
|
==================================
|
||||||
|
|
||||||
|
Why Drift
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Machine learning on financial time series requires a fundamentally different approach compared to standard ML domains.
|
||||||
|
The (small amount of) data is non-stationary, extremely noisy, where the patterns frequently change, and it's extremely important to not to leak out-of-sample data into the test set.
|
||||||
|
|
||||||
|
How Drift is different
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
There are very few open-source end-to-end machine learning pipelines that can be effectively used to train and evaluate ML models on financial time series. Among them are: [qlib](https://github.com/microsoft/qlib), [AlphaPy](https://github.com/ScottfreeLLC/AlphaPy).
|
||||||
|
|
||||||
|
Drift is different to them in a couple of angles:
|
||||||
|
|
||||||
|
- All pre-processing steps are *online (up until a certain point),* ****so they never inject lookahead bias into the mix. (this is a major issue with finML papers)
|
||||||
|
- Feature extraction and selection are an important, pre-built step in the pipeline. Garbage in, garbage out!
|
||||||
|
- Evaluation is done in a [walk-forward manner](https://en.wikipedia.org/wiki/Walk_forward_optimization). We argue that that a train/validation/test split is not adequate to evaluate an ML model's performance in a non-stationary, regime changing environment. The walk-forward methodology enables us to evaluate the model's performance on almost the whole time series.
|
||||||
|
- Training can be done in any way possible, including Combinatorial purged k-fold cross-validation. You can shuffle the past in any way you prefer, but you can never use data from the future to train the model.
|
||||||
|
- Instead of training one model, you train tons of models **over time**, that are making predictions until they become obsolete. The walk-forward training/evaluation methodology enables "online" (ever-changing) models, that adapt to the market environment. You can specify how frequently would you like to re-train the models.
|
||||||
|
- Ensemble-by-default: train multiple models, and average their predictions. Improves performance and adds a lot of robustness in a low signal-to-noise environment, like financial time series.
|
||||||
|
- Bet sizing and Meta-labeling (training a model to evaluate a lower level model's prediction for each timestamp) is a built-in feature.
|
||||||
|
|
||||||
|
This project is inspired partially by [Marcos Lopez de Prado's Advances in Financial Machine Learning](https://www.wiley.com/en-us/Advances+in+Financial+Machine+Learning-p-9781119482086) and [The Alpha Scientist's blogposts](https://alphascientist.com/).
|
||||||
|
|
||||||
|
|
||||||
|
External Links
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
For more information refer
|
||||||
|
`here<www.python.org>`
|
||||||
|
|
||||||
|
|
||||||
|
.. py:function:: square(x)
|
||||||
|
|
||||||
|
return the square of a function
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Contents
|
||||||
|
==================================
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
setup/index
|
||||||
|
basic-usage/index
|
||||||
|
advanced-usage/index
|
||||||
|
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
@ECHO OFF
|
||||||
|
|
||||||
|
pushd %~dp0
|
||||||
|
|
||||||
|
REM Command file for Sphinx documentation
|
||||||
|
|
||||||
|
if "%SPHINXBUILD%" == "" (
|
||||||
|
set SPHINXBUILD=sphinx-build
|
||||||
|
)
|
||||||
|
set SOURCEDIR=.
|
||||||
|
set BUILDDIR=_build
|
||||||
|
|
||||||
|
if "%1" == "" goto help
|
||||||
|
|
||||||
|
%SPHINXBUILD% >NUL 2>NUL
|
||||||
|
if errorlevel 9009 (
|
||||||
|
echo.
|
||||||
|
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
|
||||||
|
echo.installed, then set the SPHINXBUILD environment variable to point
|
||||||
|
echo.to the full path of the 'sphinx-build' executable. Alternatively you
|
||||||
|
echo.may add the Sphinx directory to PATH.
|
||||||
|
echo.
|
||||||
|
echo.If you don't have Sphinx installed, grab it from
|
||||||
|
echo.http://sphinx-doc.org/
|
||||||
|
exit /b 1
|
||||||
|
)
|
||||||
|
|
||||||
|
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||||
|
goto end
|
||||||
|
|
||||||
|
:help
|
||||||
|
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
|
||||||
|
|
||||||
|
:end
|
||||||
|
popd
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
Sphinx
|
||||||
|
sphinx_rtd_theme
|
||||||
|
sphinx_rtd_theme_ext_color_contrast
|
||||||
|
myst_nb
|
||||||
|
sphinx-lesson
|
||||||
|
furo
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
Advanced Usage
|
||||||
|
==========
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
installguide
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
Setup and Installation
|
||||||
|
======================
|
||||||
|
|
||||||
|
Install using pip
|
||||||
|
-----------------
|
||||||
|
This is a sub heading to install using pip
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
pip install library
|
||||||
|
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This is a note. Add your note here
|
||||||
|
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
|
||||||
|
Basic Usage
|
||||||
|
==========
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
installguide
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
Setup and Installation
|
||||||
|
======================
|
||||||
|
|
||||||
|
Install using pip
|
||||||
|
-----------------
|
||||||
|
This is a sub heading to install using pip
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
pip install library
|
||||||
|
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This is a note. Add your note here
|
||||||
|
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 157 KiB |
@@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
Start Here
|
||||||
|
==========
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
installguide
|
||||||
|
quick_start
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
Setup and Installation
|
||||||
|
======================
|
||||||
|
|
||||||
|
Install using pip
|
||||||
|
-----------------
|
||||||
|
This is a sub heading to install using pip
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
pip install library
|
||||||
|
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This is a note. Add your note here
|
||||||
|
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
Quick Start
|
||||||
|
======================
|
||||||
|
|
||||||
|
Install using pip
|
||||||
|
-----------------
|
||||||
|
This is a sub heading to install using pip
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
pip install library
|
||||||
|
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
This is a note. Add your note here
|
||||||
|
|
||||||
@@ -10,4 +10,4 @@ dependencies:
|
|||||||
- pip:
|
- pip:
|
||||||
- black
|
- black
|
||||||
- libcst
|
- libcst
|
||||||
prefix: /usr/local/anaconda3/envs/strip
|
prefix: /usr/local/anaconda3/envs/strip
|
||||||
Reference in New Issue
Block a user