From a0f75ae01d1d4ed3497c1375eb8af951a9e37517 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 30 May 2024 01:17:10 +0000 Subject: [PATCH] new model --- .github/workflows/main.yml | 2 +- backtest.py | 4 ++++ model.py | 20 ++++++++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 backtest.py create mode 100644 model.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1c50068..9e901b5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,7 @@ jobs: --perimeter default \ --github-actions - - name: Run tests + - name: Backtest model run: |- python hello.py run --with kubernetes diff --git a/backtest.py b/backtest.py new file mode 100644 index 0000000..d652186 --- /dev/null +++ b/backtest.py @@ -0,0 +1,4 @@ +from metaflow import Runner + +with Runner('model.py', decospecs=['kubernetes']).run() as running: + assert running.run.data.model_accuracy > 0.9 \ No newline at end of file diff --git a/model.py b/model.py new file mode 100644 index 0000000..26eccff --- /dev/null +++ b/model.py @@ -0,0 +1,20 @@ +from metaflow import FlowSpec, step, card, project, current + +@project(name='mlproject') +class GitHubActionsDemo(FlowSpec): + + @step + def start(self): + self.x = 'cucumber' + print('x is', self.x) + print('branch is', current.branch_name) + print("Hello GitHub Actions!") + self.next(self.end) + + @step + def end(self): + self.model_accuracy = 0.91 + print('fixed') + +if __name__ == "__main__": + GitHubActionsDemo()