16 lines
610 B
Bash
16 lines
610 B
Bash
|
#!/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*
|