iteration parameter

This commit is contained in:
szymonj98 2022-04-27 21:25:40 +02:00
parent dcb52af614
commit 76a6537844
2 changed files with 12 additions and 2 deletions

View File

@ -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'

View File

@ -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)