ium_426206/skrypt.sh
2021-04-10 18:00:26 +02:00

20 lines
740 B
Bash

#!/bin/bash
kaggle datasets download -d apoorvaappz/global-super-store-dataset
unzip -o global-super-store-dataset.zip
if [[ $1 = "0" ]]; then
CUTOFF=51291
cp Global_Superstore2.csv Global_Superstore22.csv
else
CUTOFF=$1
head -n $1 Global_Superstore2.csv > Global_Superstore22.csv
fi
head -n -1 Global_Superstore22.csv | shuf > Global_Superstore2.csv.shuf
prop1=$((CUTOFF/5))
head -n $prop1 Global_Superstore2.csv.shuf > Global_Superstore2.csv.test
head -n $((prop1*2)) Global_Superstore2.csv.shuf | tail -n $prop1 > Global_Superstore2.csv.dev
tail -n +$((prop1*2+1)) Global_Superstore2.csv.shuf > Global_Superstore2.csv.train
rm Global_Superstore2.csv.shuf
#Sprawdźmy, czy wielkości się zgadzają:
wc -l Global_Superstore2*