added cutoff script

This commit is contained in:
s495716 2024-03-20 17:20:48 +01:00
parent 8124103847
commit 93f452556f
2 changed files with 18 additions and 1 deletions

2
Jenkinsfile vendored
View File

@ -25,7 +25,7 @@ pipeline {
withEnv(["KAGGLE_USERNAME=${params.KAGGLE_USERNAME}",
"KAGGLE_KEY=${params.KAGGLE_KEY}" ]) {
sh 'chmod 777 ./data_download.sh'
sh './data_download.sh'
sh './data_download.sh --cutoff \"${params.CUTOFF}\"'
}
}
}

View File

@ -10,3 +10,20 @@ cut -d',' -f2- test.csv > test_without_id_column.csv
figlet "TESTSET AFTER ID COLUMN CUT"
head -n 5 test_without_id_column.csv
figlet "CUTOFF DATA FROM TRAIN SET"
cutoff="10"
shift "$(($OPTIND - 1))"
if [[ "$1" == "--cutoff" ]]; then
shift
if [[ ! "$1" =~ ^[0-9]+$ ]]; then
echo "Error: cutoff value must be a positive number"
exit 1
fi
cutoff="$1"
fi
head -n "$cutoff" train.csv > cutoff_train.csv
figlet "DISPLAY CUTOFF DATA"
cat cutoff_train.csv