From 76a6537844f8329b9ecf5150eecb0d706d5c8527 Mon Sep 17 00:00:00 2001 From: szymonj98 Date: Wed, 27 Apr 2022 21:25:40 +0200 Subject: [PATCH] iteration parameter --- Jenkinsfile_train | 9 ++++++++- biblioteki_dl.py | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile_train b/Jenkinsfile_train index b739e2f..f8a11a6 100644 --- a/Jenkinsfile_train +++ b/Jenkinsfile_train @@ -2,12 +2,19 @@ pipeline { agent { dockerfile true } + parameters { + string( + defaultValue: '2', + description: 'learning iterations', + name: 'epoch' + ) + } stages { stage('Stage 1') { steps { copyArtifacts filter: 'data.csv', fingerprintArtifacts: true, projectName: 's444386-create-dataset', selector: lastSuccessful() sh 'chmod u+x ./biblioteki_dl.py' - sh 'python3 biblioteki_dl.py' + sh 'python3 biblioteki_dl.py $epoch' sh 'tar -czf model.tar.gz model/' archiveArtifacts 'model.tar.gz' archiveArtifacts 'xtest.csv' diff --git a/biblioteki_dl.py b/biblioteki_dl.py index 6a80a87..99eaa08 100644 --- a/biblioteki_dl.py +++ b/biblioteki_dl.py @@ -4,10 +4,13 @@ import pandas as pd import numpy as np import csv from sklearn.model_selection import train_test_split +import sys # os.system("kaggle datasets download -d tamber/steam-video-games") # os.system("unzip -o steam-video-games.zip") +epoch = int(sys.argv[1]) + steam=pd.read_csv('data.csv',usecols=[0,1,2,3],names=['userId','game','behavior','hoursPlayed']) steam.isnull().values.any() steam['userId'] = steam.userId.astype(str) @@ -109,7 +112,7 @@ y_test = np.array(y_test).astype(np.float32) -model.fit(x_train, y_train, epochs=2) +model.fit(x_train, y_train, epochs=epoch) model.evaluate(x_test, y_test) prediction = model.predict(x_test) classes_x=np.argmax(prediction,axis=1)