Dockerfile

This commit is contained in:
Mateusz 2024-04-01 17:50:58 +02:00
parent bae5aa88f8
commit df977d0a53
2 changed files with 7 additions and 11 deletions

8
Jenkinsfile vendored
View File

@ -16,6 +16,12 @@ pipeline {
} }
stages { stages {
stage('Clone Repository') {
steps {
git branch: 'main', url: 'https://git.wmi.amu.edu.pl/s464913/ium_464913.git'
}
}
stage('Download dataset') { stage('Download dataset') {
steps { steps {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) { withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}", "KAGGLE_KEY=${params.KAGGLE_KEY}"]) {
@ -35,7 +41,7 @@ pipeline {
steps { steps {
sh 'chmod +x create-dataset.py' sh 'chmod +x create-dataset.py'
sh 'python3 ./create-dataset.py $KAGGLE_USERNAME' sh 'python3 ./create-dataset.py'
} }
} }

View File

@ -1,6 +1,4 @@
import os import os
import sys
from kaggle.api.kaggle_api_extended import KaggleApi
import pandas as pd import pandas as pd
import numpy as np import numpy as np
@ -9,14 +7,6 @@ from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split from sklearn.model_selection import train_test_split
def download_kaggle_dataset():
os.environ["KAGGLE_USERNAME"] = "vskyper"
os.environ["KAGGLE_KEY"] = sys.argv[1]
kaggle = KaggleApi()
kaggle.authenticate()
kaggle.dataset_download_files("mlg-ulb/creditcardfraud", path="./", unzip=True)
def load_data(name): def load_data(name):
df = pd.read_csv(name) df = pd.read_csv(name)
return df return df