From 5786c55311f50000ae0dd274a8129a1fdf394ee6 Mon Sep 17 00:00:00 2001 From: zgolebiewska Date: Sun, 9 Jun 2024 22:02:57 +0200 Subject: [PATCH] IUM_11 --- .github/workflows/train_and_evaluate.yml | 33 +++++++++++++++++++ .idea/inspectionProfiles/Project_Default.xml | 13 ++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ .idea/ium_464906.iml | 8 +++++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ model.py | 3 +- 7 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/train_and_evaluate.yml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/ium_464906.iml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml diff --git a/.github/workflows/train_and_evaluate.yml b/.github/workflows/train_and_evaluate.yml new file mode 100644 index 0000000..a177b2e --- /dev/null +++ b/.github/workflows/train_and_evaluate.yml @@ -0,0 +1,33 @@ +name: Train and Evaluate Model + +on: + workflow_dispatch: + inputs: + epochs: + description: 'Number of epochs' + required: true + default: 100 + +jobs: + train_and_evaluate: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.8' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pandas scikit-learn tensorflow sacred pymongo + + - name: Train and evaluate model + run: | + python model.py with epochs=${{ github.event.inputs.epochs }} + env: + MONGO_URL: ${{ secrets.MONGO_URL }} diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..44196fd --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,13 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/ium_464906.iml b/.idea/ium_464906.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/ium_464906.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..cf27e91 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/model.py b/model.py index f1df595..a5c3138 100644 --- a/model.py +++ b/model.py @@ -5,10 +5,11 @@ import pandas as pd from sklearn.preprocessing import LabelEncoder, StandardScaler from sklearn.model_selection import train_test_split import json +import os ex = Experiment("s464906_experiment") -mongo_url = "mongodb://admin:IUM_2021@tzietkiewicz.vm.wmi.amu.edu.pl:27017" +mongo_url = os.getenv("MONGO_URL", "mongodb://admin:IUM_2021@tzietkiewicz.vm.wmi.amu.edu.pl:27017") ex.observers.append(MongoObserver(url=mongo_url, db_name='sacred')) ex.observers.append(FileStorageObserver('logs'))