ium_s434700/data/data.sh
Filip Izydorczyk 1313e993c1 data update
2021-05-25 18:50:14 +02:00

24 lines
685 B
Bash

rm ./results.csv
rm ./train_set.csv
rm ./dev_set.csv
rm ./test_set.csv
rm ./*.zip
kaggle datasets download -d mateusdmachado/csgo-professional-matches
unzip ./*.zip
rm ./players.csv
rm ./picks.csv
rm ./economy.csv
datas_count=$(cat ./results.csv | wc -l)
train_count=$(echo $datas_count*0.8 | bc)
dev_test_count=$(echo $datas_count*0.1 | bc)
train_end=${train_count%.*}
dev_count=${dev_test_count%.*}
dev_end=$(($train_end + $dev_count))
test_count=${dev_test_count%.*}
test_end=$(($dev_end + $test_count))
sed -n 1,"$train_end"p ./results.csv >> train_set.csv
sed -n "$train_end","$dev_end"p ./results.csv >> dev_set.csv
sed -n "$dev_end","$test_end"p ./results.csv >> test_set.csv