IUM_s464980/download_dataset.sh
2024-03-26 18:48:24 +01:00

16 lines
508 B
Bash

#!/bin/bash
# download data from kaggle
kaggle datasets download -d nikhil7280/student-performance-multiple-linear-regression --unzip
# change dataset name to data.csv
mv Student_Performance.csv data.csv
# cut off rows
head -n "$2" data.csv > data.csv.tmp && mv data.csv.tmp data.csv
# get data size
data_size=$(wc -l < data.csv)
# split data to train and test and save it to csv files
head -n $(( $data_size * $1/100 )) data.csv > train.csv
tail -n $(( $data_size * ( 1 - $1/100 ) )) data.csv > test.csv