ium_z487186/script.sh

18 lines
762 B
Bash
Raw Normal View History

2023-04-20 22:45:53 +02:00
curl -o liver.data 'https://archive.ics.uci.edu/ml/machine-learning-databases/00225/Indian%20Liver%20Patient%20Dataset%20(ILPD).csv'
sort -R liver.data > liver.data.shuf
2023-04-20 23:46:06 +02:00
2023-04-21 09:52:12 +02:00
if [[ "$CUTOFF" != "0" ]]; then
2023-04-20 23:46:06 +02:00
cut_train=$(( 60 * CUTOFF / 100 ))
2023-04-20 23:53:27 +02:00
cut_test=$(( 20 * CUTOFF / 100 ))
cut_dev=$(( CUTOFF - cut_train - cut_test ))
2023-04-20 23:46:06 +02:00
head -n $cut_train liver.data.shuf > liver.data.train
head -n $(( cut_train + cut_dev )) liver.data.shuf | tail -n $cut_dev > liver.data.dev
2023-04-20 23:53:27 +02:00
tail -n +$(( cut_train + cut_dev + 1 )) liver.data.shuf | head -n $cut_test > liver.data.test
2023-04-21 09:52:12 +02:00
else
head -n 120 liver.data.shuf > liver.data.test
head -n 240 liver.data.shuf | tail -n 120 > liver.data.dev
tail -n +241 liver.data.shuf > liver.data.train
2023-04-20 23:46:06 +02:00
fi
2023-04-20 23:30:23 +02:00
rm liver.data liver.data.shuf