ium_495716/data_download.sh

31 lines
690 B
Bash
Raw Normal View History

2024-03-20 14:48:24 +01:00
#!/bin/bash
figlet "DOWNLOAD DATA"
2024-03-20 16:50:15 +01:00
kaggle datasets download iabhishekofficial/mobile-price-classification --unzip --force
figlet "TESTSET BEFORE ID COLUMN CUT"
head -n 5 test.csv
cut -d',' -f2- test.csv > test_without_id_column.csv
figlet "TESTSET AFTER ID COLUMN CUT"
head -n 5 test_without_id_column.csv
2024-03-20 17:20:48 +01:00
figlet "CUTOFF DATA FROM TRAIN SET"
shift "$(($OPTIND - 1))"
if [[ "$1" == "--cutoff" ]]; then
shift
2024-03-20 17:37:02 +01:00
echo "$1"
2024-03-20 17:34:38 +01:00
if [[ ! "$1" =~ ^[1-9][0-9]*$ ]]; then
2024-03-20 17:20:48 +01:00
echo "Error: cutoff value must be a positive number"
2024-03-20 17:34:38 +01:00
exit 1
2024-03-20 17:20:48 +01:00
fi
2024-03-20 17:25:00 +01:00
cutoff=$(("$1" + 1))
echo "CUTOFF $cutoff"
2024-03-20 17:20:48 +01:00
fi
head -n "$cutoff" train.csv > cutoff_train.csv
figlet "DISPLAY CUTOFF DATA"
cat cutoff_train.csv