Book Image

Python Data Mining Quick Start Guide

By : Nathan Greeneltch
Book Image

Python Data Mining Quick Start Guide

By: Nathan Greeneltch

Overview of this book

Data mining is a necessary and predictable response to the dawn of the information age. It is typically defined as the pattern and/ or trend discovery phase in the data mining pipeline, and Python is a popular tool for performing these tasks as it offers a wide variety of tools for data mining. This book will serve as a quick introduction to the concept of data mining and putting it to practical use with the help of popular Python packages and libraries. You will get a hands-on demonstration of working with different real-world datasets and extracting useful insights from them using popular Python libraries such as NumPy, pandas, scikit-learn, and matplotlib. You will then learn the different stages of data mining such as data loading, cleaning, analysis, and visualization. You will also get a full conceptual description of popular data transformation, clustering, and classification techniques. By the end of this book, you will be able to build an efficient data mining pipeline using Python without any hassle.
Table of Contents (9 chapters)

The scikit-learn transformer API

One of the reasons that scikit-learn is so popular is due to its ease of use. There are only a few, well thought-out API designs in the scikit-learn library and they are applied in a sweeping manner across many different methods and routines. This chapter will make use of the transformer API. It's extremely straightforward and once you understand how to use it, you can try our new transformer methods with ease because they all work the same (that is, they all make use of the transformer API).

The steps for transforming data are given as follows:

  1. Import the module.
  2. Instantiate the transformer object (model in the following diagram).
  3. Fit the model to input the training data (X_train in the following diagram).
  4. Transform the new test data (X_test in the following diagram).

These steps can also be represented as a workflow diagram, as follows...