Using Kaggle for Faster Experimentation
The Kaggle kernel platform provides free access to GPUs, which speeds up the training of machine learning by around 10x. GPUs are specialized chips that perform matrix calculations very quickly, much faster than a CPU. In this section, we will learn how we can make use of this free service to train our models more quickly:
- Open https://www.kaggle.com/kernels in your browser and sign in.
- Click on the New Kernel button and select Notebook in the popup. The screen that is loaded, which is where you can run your code, looks like this:
Figure 0.1: Notebook screen
In the top-left corner is the name of the notebook, which you can change.
- Click on Settings and activate the GPU on this notebook. To use the internet through the notebook, you will have to authenticate with your mobile phone:
Figure 0.2: Settings screen
- To upload a Jupyter notebook to Kaggle, click on File and then Upload notebook. To load a dataset for this notebook, click on the Add Dataset button in the top-right corner. From here, you can add any dataset hosted on Kaggle or upload your own dataset. You can access your uploaded dataset from the following path:
../input/
- To download this notebook with the results after you are done running the code, click on File and select Download notebook. To save this notebook and its results in your Kaggle account, click the Commit button in the top-right corner.
You can make use of this Kaggle environment whenever you feel that your machine learning models are taking a lot of time to train.
This book uses datasets from UCI Machine Learning Repository [http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, School of Information and Computer Science.