added create-dataset.sh
This commit is contained in:
parent
b3728245af
commit
877ee10827
29
create-dataset.sh
Normal file
29
create-dataset.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
pip install kaggle
|
||||
|
||||
kaggle datasets download -d syedanwarafridi/vehicle-sales-data
|
||||
|
||||
unzip -o vehicle-sales-data.zip
|
||||
|
||||
# Tasowanie
|
||||
shuf car_prices.csv -o car_prices_shuf.csv
|
||||
|
||||
# Podział danych na podzbiory
|
||||
total_rows=$(wc -l < car_prices_shuf.csv)
|
||||
test_dev_rows=$(( $1 * 2 ))
|
||||
|
||||
head -n $1 car_prices_shuf.csv > car_prices_test.csv
|
||||
head -n $test_dev_rows car_prices_shuf.csv | tail -n +$(( $1 + 1 )) > car_prices_dev.csv
|
||||
tail -n +$(( $test_dev_rows + 1 )) car_prices_shuf.csv > car_prices_train.csv
|
||||
|
||||
test_size=$(wc -l < car_prices_test.csv)
|
||||
dev_size=$(wc -l < car_prices_dev.csv)
|
||||
train_size=$(wc -l < car_prices_train.csv)
|
||||
echo "Rozmiar zbioru testowego: $test_size"
|
||||
echo "Rozmiar zbioru deweloperskiego: $dev_size"
|
||||
echo "Rozmiar zbioru treningowego: $train_size"
|
||||
|
||||
# Zapis artefaktów
|
||||
mkdir -p data
|
||||
mv car_prices.csv car_prices_shuf.csv car_prices_test.csv car_prices_dev.csv car_prices_train.csv data/
|
Loading…
Reference in New Issue
Block a user