Book Image

Data Science with Python

By : Rohan Chopra, Aaron England, Mohamed Noordeen Alaudeen
Book Image

Data Science with Python

By: Rohan Chopra, Aaron England, Mohamed Noordeen Alaudeen

Overview of this book

Data Science with Python begins by introducing you to data science and teaches you to install the packages you need to create a data science coding environment. You will learn three major techniques in machine learning: unsupervised learning, supervised learning, and reinforcement learning. You will also explore basic classification and regression techniques, such as support vector machines, decision trees, and logistic regression. As you make your way through the book, you will understand the basic functions, data structures, and syntax of the Python language that are used to handle large datasets with ease. You will learn about NumPy and pandas libraries for matrix calculations and data manipulation, discover how to use Matplotlib to create highly customizable visualizations, and apply the boosting algorithm XGBoost to make predictions. In the concluding chapters, you will explore convolutional neural networks (CNNs), deep learning algorithms used to predict what is in an image. You will also understand how to feed human sentences to a neural network, make the model process contextual information, and create human language processing systems to predict the outcome. By the end of this book, you will be able to understand and implement any new data science algorithm and have the confidence to experiment with tools or libraries other than those covered in the book.
Table of Contents (10 chapters)

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:

  1. Open https://www.kaggle.com/kernels in your browser and sign in.
  2. 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
    Figure 0.1: Notebook screen

    In the top-left corner is the name of the notebook, which you can change.

  3. 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
    Figure 0.2: Settings screen
  4. 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/

  5. 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.