How do I download .csv dataset directly from Kaggle with Matlab code.
Show older comments
Hello, I found a dataset on Kaggle which I want to use for my Machine learning project. However, I'm required to download the dataset from the code itself. I tried this:
url1 = 'https://www.kaggle.com/competitions/mrs-spring-2023-battery-prediction-challenge/data?select=example_submission.csv';
url2 = 'https://www.kaggle.com/competitions/mrs-spring-2023-battery-prediction-challenge/data?select=test_data.csv';
url3 = 'https://www.kaggle.com/competitions/mrs-spring-2023-battery-prediction-challenge/data?select=training_data.csv';
example = websave('example_submission.csv',url1);
test = websave('test_data.csv',url2);
training = websave('training_data.csv',url3);
data_example = readtable("example_submission.csv");
data_test = readtable("test_data.csv");
data_train = readtable("training_data.csv");
I was able to download them, however instead of downloading the .csv files, it is downloading an HTML page that contains the Kaggle website.
3 Comments
Star Strider
on 19 May 2024
You probably have to download those directly from the Kaggle site after signing in. It is apparently not possible to download them directly from that site through MATLAB.
That problem aside, the code to get them using websave should be:
example = websave('example_submission',url1);
test = websave('test_data',url2);
training = websave('training_data',url3);
data_example = readtable(example);
data_test = readtable(test);
data_train = readtable(training);
That actually works (I tested it) however it returns the HTML code rather than the file contents in the table arrays.
.
.
Emil Buratovic
on 19 May 2024
Star Strider
on 19 May 2024
My pleasure!
Not that I am aware of. You probably need to search for the sort of information you want, since I am not certain what that is.
If you have access to a university library, search using those computers because the data could be in journals that have paywalls, and the university could have access to them. Once the data are downloaded, you can send the files to your home computer via e-mail. (That is the approach I have used in the past. The university library computers I am familiar with prohibit using SD cards and such because of the malware danger.)
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
