ium_426206/skrypt.sh

16 lines
610 B
Bash
Raw Normal View History

2021-03-28 22:00:27 +02:00
#!/bin/bash
kaggle datasets download -d apoorvaappz/global-super-store-dataset
unzip global-super-store-dataset.zip
cat Global_Superstore2.csv | shuf > Global_Superstore2.csv.shuf
if [ $1="0" ]; then
CUTOFF=51291
else
CUTOFF=$1
fi
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.csv*