From 3f421a765bc90a2aa7c8f84816e0ec8b3d588a8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Zar=C4=99ba?= Date: Wed, 10 May 2023 15:44:36 +0200 Subject: [PATCH] t --- Jenkinsfile | 21 +++------------------ Jenkinsfile2 | 2 +- JenkinsfileDL | 2 +- predictions.py | 2 +- train.py | 2 +- 5 files changed, 7 insertions(+), 22 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4ca2572..795b11d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -51,13 +51,11 @@ pipeline { #!/bin/bash pip install kaggle - kaggle datasets download -d nitishsharma01/olympics-124-years-datasettill-2020 - - unzip -o olympics-124-years-datasettill-2020.zip + git clone https://git.wmi.amu.edu.pl/s487187/ium_487187.git echo "Processed Data" > output.txt ''' - sh "head -n ${params.CUTOFF} olympics-124-years-datasettill-2020/Athletes_summer_games.csv" + sh "head -n ${params.CUTOFF} data.csv" } } catch (err) { error "Failed to build: ${err.message}" @@ -66,19 +64,6 @@ pipeline { } } - stage('Clone Git Repository') { - when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } - steps { - script { - try { - git 'https://git.wmi.amu.edu.pl/s487187/ium_487187.git' - } catch (err) { - error "Failed to clone repository: ${err.message}" - } - } - } - } - stage('End') { when { expression { params.KAGGLE_USERNAME && params.KAGGLE_KEY } } steps { @@ -92,4 +77,4 @@ pipeline { } } } -} \ No newline at end of file +} diff --git a/Jenkinsfile2 b/Jenkinsfile2 index dc8a539..d703b9d 100644 --- a/Jenkinsfile2 +++ b/Jenkinsfile2 @@ -47,7 +47,7 @@ pipeline { sh ''' #!/bin/bash - python3 count_lines.py --input_file olympics-124-years-datasettill-2020/Athletes_summer_games.csv > output.txt + python3 count_lines.py --input_file olympics-124-years-datasettill-2020/Athletes_winter_games.csv > output.txt ''' } } diff --git a/JenkinsfileDL b/JenkinsfileDL index 6d057c1..f2743fe 100644 --- a/JenkinsfileDL +++ b/JenkinsfileDL @@ -12,7 +12,7 @@ pipeline { stage('Pobierz dane') { steps { script { - copyArtifacts(projectName: 's487187-create-dataset', filter: '*.csv', target: 'data', fingerprintArtifacts: true) + copyArtifacts(projectName: 's487187-create-dataset', filter: '*.csv', target: 'Athletes_winter_games.csv', fingerprintArtifacts: true) } } } diff --git a/predictions.py b/predictions.py index 173d9a6..7c0eb6a 100644 --- a/predictions.py +++ b/predictions.py @@ -4,7 +4,7 @@ from sklearn.preprocessing import MinMaxScaler model = tf.keras.models.load_model('model.h5') -data = pd.read_csv('data.csv', sep=';') +data = pd.read_csv('Athletes_winter_games.csv', sep=';') data = pd.get_dummies(data, columns=['Sex', 'Medal']) data = data.drop(columns=['Name', 'Team', 'NOC', 'Games', 'Year', 'Season', 'City', 'Sport', 'Event']) diff --git a/train.py b/train.py index 808e67b..c421462 100644 --- a/train.py +++ b/train.py @@ -5,7 +5,7 @@ import tensorflow as tf from imblearn.over_sampling import SMOTE smote = SMOTE(random_state=42) -data = pd.read_csv('data.csv', sep=';') +data = pd.read_csv('Athletes_winter_games.csv', sep=';') print('Total rows:', len(data)) print('Rows with medal:', len(data.dropna(subset=['Medal'])))