2024-03-20 14:29:57 +01:00
|
|
|
pipeline {
|
|
|
|
agent any
|
2024-03-26 18:29:52 +01:00
|
|
|
parameters {
|
|
|
|
string (
|
|
|
|
name: 'KAGGLE_USERNAME',
|
|
|
|
defaultValue: 'ardenw',
|
|
|
|
description: 'Kaggle username'
|
|
|
|
)
|
|
|
|
password (
|
2024-04-02 20:24:31 +02:00
|
|
|
name: 'API_KEY',
|
2024-03-26 18:29:52 +01:00
|
|
|
defaultValue: '',
|
|
|
|
description: 'Kaggle API key'
|
|
|
|
)
|
|
|
|
string (
|
|
|
|
name: 'DATA_TRAIN_RATIO',
|
2024-03-26 18:45:26 +01:00
|
|
|
defaultValue: '80',
|
|
|
|
description: 'Train data ratio percentage'
|
2024-03-26 18:29:52 +01:00
|
|
|
)
|
|
|
|
string (
|
|
|
|
name: 'CUTOFF',
|
|
|
|
defaultValue: '500',
|
|
|
|
description: 'Cutoff value'
|
|
|
|
)
|
|
|
|
}
|
2024-03-20 14:29:57 +01:00
|
|
|
stages {
|
2024-03-20 14:58:46 +01:00
|
|
|
stage('Checkout repository') {
|
2024-03-20 14:29:57 +01:00
|
|
|
steps {
|
2024-03-26 18:29:52 +01:00
|
|
|
checkout scm
|
2024-03-20 14:58:46 +01:00
|
|
|
}
|
|
|
|
}
|
2024-04-02 20:24:31 +02:00
|
|
|
stage('Download dataset') {
|
|
|
|
steps {
|
|
|
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
|
|
|
|
sh "kaggle datasets download -d nikhil7280/student-performance-multiple-linear-regression --unzip"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2024-04-02 20:02:32 +02:00
|
|
|
stage('Prepare dataset') {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
|
|
|
filename 'Dockerfile'
|
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-03-20 14:58:46 +01:00
|
|
|
steps {
|
2024-04-02 20:02:32 +02:00
|
|
|
sh "chmod +x ./get_dataset.py"
|
2024-04-02 20:24:31 +02:00
|
|
|
sh "python ./get_dataset.py"
|
2024-04-02 20:02:32 +02:00
|
|
|
archiveArtifacts artifacts: 'dataset.csv,df_train.csv,df_test.csv', onlyIfSuccessful: true
|
|
|
|
}
|
2024-03-20 14:29:57 +01:00
|
|
|
}
|
2024-04-03 09:39:37 +02:00
|
|
|
stage("Prediction") {
|
|
|
|
agent {
|
|
|
|
dockerfile {
|
|
|
|
filename 'Dockerfile'
|
|
|
|
reuseNode true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
steps {
|
|
|
|
sh "chmod +x ./train.py"
|
|
|
|
sh "chmod +x ./predict.py"
|
|
|
|
sh "python ./train.py"
|
|
|
|
sh "python ./predict.py"
|
|
|
|
archiveArtifacts artifacts: 'model.keras,predictions.txt', onlyIfSuccessful: true
|
|
|
|
}
|
|
|
|
}
|
2024-03-20 14:29:57 +01:00
|
|
|
}
|
2024-03-26 18:34:28 +01:00
|
|
|
}
|