dockerscript
This commit is contained in:
parent
e8a8a07d8d
commit
919f446857
30
createDataset/Jenkinsfile
vendored
30
createDataset/Jenkinsfile
vendored
@ -20,25 +20,35 @@ pipeline {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('Run sh file') {
|
stage('Download dataset') {
|
||||||
steps {
|
steps {
|
||||||
checkout scm
|
checkout scm
|
||||||
dir ('./createDataset') {
|
dir ('./createDataset') {
|
||||||
sh 'ls -l'
|
sh 'ls -l'
|
||||||
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
|
||||||
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
|
||||||
sh 'chmod +x ./datasetScript.sh'
|
// sh 'chmod +x ./datasetScript.sh'
|
||||||
sh './datasetScript.sh'
|
// sh './datasetScript.sh'
|
||||||
|
sh 'kaggle datasets download -d rishikeshkonapure/home-loan-approval'
|
||||||
|
sh 'unzip -o home-loan-approval.zip'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Archive file') {
|
stage('Docker') {
|
||||||
steps {
|
steps {
|
||||||
dir ('./createDataset') {
|
def dockerImage = docker.build("docker-iamge", "./docker")
|
||||||
archiveArtifacts artifacts: 'loan_sanction_shuffled.csv', fingerprint: true\
|
dockerImage.inside {
|
||||||
}
|
sh 'ls -l'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// stage('Archive file') {
|
||||||
|
// steps {
|
||||||
|
// dir ('./createDataset') {
|
||||||
|
// archiveArtifacts artifacts: 'loan_sanction_shuffled.csv', fingerprint: true\
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
22
createDataset/createDataset.py
Normal file
22
createDataset/createDataset.py
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import pandas as pd
|
||||||
|
from sklearn.preprocessing import MinMaxScaler
|
||||||
|
from sklearn.model_selection import train_test_split
|
||||||
|
home_loan_train = pd.read_csv('loan_sanction_train.csv')
|
||||||
|
home_loan_test = pd.read_csv('loan_sanction_test.csv')
|
||||||
|
|
||||||
|
home_loan_val_final, home_loan_test_final = train_test_split(home_loan_test, test_size=0.5, random_state=1)
|
||||||
|
home_loan_train_final = home_loan_train
|
||||||
|
|
||||||
|
numeric_cols_train = home_loan_train_final.select_dtypes(include='number').columns
|
||||||
|
numeric_cols_test = home_loan_test_final.select_dtypes(include='number').columns
|
||||||
|
numeric_cols_val = home_loan_val_final.select_dtypes(include='number').columns
|
||||||
|
|
||||||
|
scaler = MinMaxScaler()
|
||||||
|
|
||||||
|
home_loan_train_final[numeric_cols_train] = scaler.fit_transform(home_loan_train_final[numeric_cols_train])
|
||||||
|
home_loan_test_final[numeric_cols_test] = scaler.fit_transform(home_loan_test_final[numeric_cols_test])
|
||||||
|
home_loan_val_final[numeric_cols_val] = scaler.fit_transform(home_loan_val_final[numeric_cols_val])
|
||||||
|
|
||||||
|
home_loan_train_final.to_csv('home_loan_train.csv', index=False)
|
||||||
|
home_loan_test_final.to_csv('home_loan_test.csv', index=False)
|
||||||
|
home_loan_val_final.to_csv('home_loan_val.csv', index=False)
|
Loading…
Reference in New Issue
Block a user