kaggle: how to work from colab and try a competition as a total ML/de

Source: Deep Learning on Medium

kaggle: how to work from colab and try a competition as a total ML/deep learning noob.

So I am a total deep learning and ml noob.

I have no background and I have been watching some videos and that is all.

But somehow I decided to learn it:D And also compete on kaggle.

I know..

But I can not help it…

So the first thing I did was I found a competition and decided to learn while trying to compete 😀

This is the one: https://www.kaggle.com/c/LANL-Earthquake-Prediction

And I checked what people use; they use jupyter notebooks. And I choose colab.research.google.com as my enviroment.

I went to that link: https://colab.research.google.com/notebooks/welcome.ipynb#recent=true

And I have an environment now:D

That is cool!

First thing I need to do is install some things:

!pip install kaggle!pip install numpy==1.17.4!pip install catboost

and then import some other things:

import pandas as pdimport numpy as npfrom catboost import CatBoostRegressor, Poolfrom sklearn.preprocessing import StandardScalerfrom sklearn.model_selection import GridSearchCVfrom sklearn.svm import NuSVR, SVRfrom sklearn.kernel_ridge import KernelRidgeimport matplotlib.pyplot as plt

that is awesome!

after doing all these I need to press the little play icon next to the code block so it runs and imports.

Next I need to be able to use kaggle api so after registering to kaggle you download kaggle.json.

Go here about how to do it: https://www.kaggle.com/docs/api

Then you go back to your jupyter notebook and run these commands:

from google.colab import filesuploaded = files.upload()!mkdir -p ~/.kaggle/ && mv kaggle.json ~/.kaggle/ && chmod 600 ~/.kaggle/kaggle.json

after file.upload line you will see a button on the notebook to pick the kaggle.json file and upload it.

Then the mkdir command will run.

Then you run this:

!kaggle competitions download -c LANL-Earthquake-Prediction

Ops it raised one warning and one error.

Warning is this:

Warning: Looks like you’re using an outdated API Version, please consider updating (server 1.5.6 / client 1.5.4)

To get rid of this warning you need to upgrade kaggle by these commands:

!pip uninstall -y kaggle!pip install — upgrade pip!pip install kaggle==1.5.6!kaggle -v

Then run this again:

!kaggle competitions download -c LANL-Earthquake-Prediction

Ops still error:

403 — Forbidden

To get rid of this error; you need to go to

and submit to the competition and accept terms and conditions.

Then run again:

!kaggle competitions download -c LANL-Earthquake-Prediction

Yes! it worked. Downloading the data.