Skip to content

Latest commit

 

History

History
110 lines (80 loc) · 3.31 KB

01_model_training.md

File metadata and controls

110 lines (80 loc) · 3.31 KB

Lecture 1

Model training and experimentation with Comet ML


Steps

  1. Create the virtual environment with Poetry
  2. Generate training data
  3. Build a baseline model
  4. Build Machine Learning models

1. Create the virtual environment with Poetry


  1. Create a Python virtual environment with all project dependencies with

    $ curl -sSL https://install.python-poetry.org | python3 -
    $ poetry install
    

    or simply use the Makefile

    $ make init
    
  2. Activate the virtual environment you just created

    $ poetry shell
    
  3. Sign up for Comet ML for FREE, create a workspace and copy your API key from the dashboard.

  4. Set your API key and workspace name variables in set_environment_variables_template.sh, rename the file and run it

    $ . ./set_environment_variables.sh
    

Your local development environment is ready. Let's now generate some training data.

2. Generate training data

Download historical data from Coinbase and save it locally to disk

  • Run either $ python src/data.py, or
  • Simply $ make data

3. Build a baseline model

  • Establish a baseline performance using a very dummy (yet powerful) baseline model
    $ python src/baseline_model.py
    

4. Build Machine Learning models

  • Here is the list of experiments I ran

    $ python src/baseline_model.py
    $ python src/train.py --model lasso
    $ python src/train.py --model lasso --tune-hyperparams --hyperparam-trials 3
    $ python src/train.py --model lightgbm
    $ python src/train.py --model lightgbm --tune-hyperparams --hyperparam-trials 3
    
  • Feel free to try adding more features, using other technical indicators, or experiment with other ML models.