Steps to Setup Kaggle CLI – Download, Extract Data

In Machine Learning by Vijay Narayanan ParakimeethalLeave a Comment

Below is an overview of how to install kaggle-cli and extract data for planet competition located at https://www.kaggle.com/c/planet-understanding-the-amazon-from-space as an example. You can apply the same for any other competition.

Step by Step Guide to setup Kaggle CLI and download Data 

  1. Install Kaggle CLI (if done, Go to Step 2)
pip install –U kaggle-cli
  1. Configure your kaggle account
kg config –u <your username> -p <your password> -c <competition name>

Note:

  • Go to Kaggle Competition Website, Login and accept the rules of competition
  • If you’ve always signed into Kaggle using a linked social media account, you will get an error using the kaggle cli, which requires that you have a separate kaggle login. Fortunately, Kaggle has a solution: if you select *Forgot Password?*, you’ll receive an email with a few different options, the 3rd of which lets you set up your own Kaggle username/password and connects it to your original social media account
  • How to find Kaggle competition name – Go to Kaggle competition page in kaggle website and take the name. For ex – if page is https://www.kaggle.com/c/planet-understanding-the-amazon-from-space, then competition name is planet-understanding-the-amazon-from-space

3. Download the data

kg download
  1. Extract data: zip files
Unzip –q <filename.zip>
  1. Extract data: tar files. This extracts 7z format and delivers an output <filename.tar>
7za x <filename.tar.7z>
tar xf <filename.tar>
  1. You only need the following files for running the notebook
    1. train-jpg
    2. test-jpg
    3. test-jpg-additional
    4. csv
    5. csv
    6. csv
  2. I deleted the rest of the files as the device was running out of space, but if you have space you can keep it in a separate folder under data/planet.

Did I miss anything ? Any other tips ?


Leave a Comment

Comments Policy :
  • Comments are to drive conversation, add your thoughts, experiences, ask questions!
  • Do NOT write hate speech, swear words, or get into fight. Maintain etiquette
  • Enter your Name, valid Email, URL(optional - Facebook, LinkedIn profile URLs).
  • Your email will NOT be published. Do NOT post any phone numbers, email-ids
  • Do NOT post any links from other websites, unless official sites, University websites.
  • By submitting your comment, you agree to Term and Conditions of our website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.