diff --git a/.github/workflows/cml.yml b/.github/workflows/cml.yml new file mode 100644 index 00000000..20f95dc6 --- /dev/null +++ b/.github/workflows/cml.yml @@ -0,0 +1,27 @@ +name: model-training +on: + push: + branches: + - mlmodel +jobs: + run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + - uses: iterative/setup-cml@v1 + - name: Train model + env: + REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ls + cd model_data/simulation_system + pip install -r requirements.txt + python3 training.py --train-filepath ./model_build_data/change_data/rdsap_full/train_validation_data.parquet --test-filepath ./model_build_data/change_data/rdsap_full/test_data.parquet + + cd model_directory/RDSAP_CHANGE + echo "## MODEL METRICS from registry" > report.md + cat model_registry.csv >> report.md + + cml comment create report.md + diff --git a/model_data/simulation_system/training.py b/model_data/simulation_system/training.py index 04ef3493..d0a2c8ac 100644 --- a/model_data/simulation_system/training.py +++ b/model_data/simulation_system/training.py @@ -1,6 +1,6 @@ import argparse -import boto3 +# import boto3 import os from pathlib import Path from datetime import datetime @@ -152,7 +152,7 @@ def training( logger.info("--- Optimising model for deployment ---") deployment_model_path = model.optimise_model_for_deployment(deployment_path= output_base / DEPLOYMENT_FOLDER) - logger.info("Optimised version of best model can be found at: {deployment_model_path}") + logger.info(f"Optimised version of best model can be found at: {deployment_model_path}") # TODO: Need a model registry - for now have this as a CSV # Save this in the model directory @@ -204,4 +204,4 @@ if __name__ == "__main__": test_filepath=args.test_filepath, target_column=args.target_column, model_type=args.model_type - ) \ No newline at end of file + )