06-training
This commit is contained in:
parent
9dca2d4283
commit
af6518f064
43
Jenkinsfile
vendored
43
Jenkinsfile
vendored
@ -1,36 +1,37 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
triggers {
|
||||
upstream(upstreamProjects: 'z-s464937-create-dataset', threshold: hudson.model.Result.SUCCESS)
|
||||
}
|
||||
|
||||
parameters {
|
||||
string(name: 'CUTOFF', defaultValue: '100', description: 'Ilość wierszy do odcięcia')
|
||||
string(name: 'KAGGLE_USERNAME', defaultValue: '', description: 'Kaggle username')
|
||||
password(name: 'KAGGLE_KEY', defaultValue: '', description: 'Kaggle API key')
|
||||
string(name: 'EPOCHS', defaultValue: '10', description: 'Epochs')
|
||||
buildSelector(defaultSelector: lastSuccessful(), description: 'Build no', name: 'BUILD_SELECTOR')
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Clone repo') {
|
||||
stage('Clone Repository') {
|
||||
steps {
|
||||
git branch: "main", url: "https://git.wmi.amu.edu.pl/s464937/ium_464937"
|
||||
git branch: 'training', url: "https://git.wmi.amu.edu.pl/s464937/ium_464937.git"
|
||||
}
|
||||
}
|
||||
|
||||
stage('Download and preprocess') {
|
||||
environment {
|
||||
KAGGLE_USERNAME = "szymonbartanowicz"
|
||||
KAGGLE_KEY = "4692239eb65f20ec79f9a59ef30e67eb"
|
||||
stage('Copy Artifacts') {
|
||||
steps {
|
||||
copyArtifacts filter: 'openpowerlifting.csv', projectName: 'z-s464937-create-dataset', selector: buildParameter('BUILD_SELECTOR')
|
||||
}
|
||||
}
|
||||
stage("Run") {
|
||||
agent {
|
||||
dockerfile {
|
||||
filename 'Dockerfile'
|
||||
reuseNode true
|
||||
}
|
||||
}
|
||||
steps {
|
||||
withEnv([
|
||||
"KAGGLE_USERNAME=${env.KAGGLE_USERNAME}",
|
||||
"KAGGLE_KEY=${env.KAGGLE_KEY}"
|
||||
]) {
|
||||
sh "bash ./script1.sh ${params.CUTOFF}"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Archive') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: 'data/*', onlyIfSuccessful: true
|
||||
sh "chmod +x ./model.py"
|
||||
sh "python3 ./model.py ${params.EPOCHS}"
|
||||
archiveArtifacts artifacts: 'powerlifting_model.h5', onlyIfSuccessful: true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
4
model.py
4
model.py
@ -1,3 +1,5 @@
|
||||
import sys
|
||||
|
||||
import pandas as pd
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import StandardScaler, OneHotEncoder
|
||||
@ -34,6 +36,6 @@ pipeline = Pipeline(steps=[
|
||||
|
||||
pipeline['model'].compile(optimizer='adam', loss='mse', metrics=['mae'])
|
||||
|
||||
pipeline.fit(X_train, y_train, model__epochs=10, model__validation_split=0.1)
|
||||
pipeline.fit(X_train, y_train, model__epochs=int(sys.argv[1]), model__validation_split=0.1)
|
||||
|
||||
pipeline['model'].save('powerlifting_model.h5')
|
||||
|
Loading…
Reference in New Issue
Block a user