Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Artificial Intelligence with Python

You're reading from   Artificial Intelligence with Python Your complete guide to building intelligent apps using Python 3.x

Arrow left icon
Product type Paperback
Published in Jan 2020
Publisher Packt
ISBN-13 9781839219535
Length 618 pages
Edition 2nd Edition
Languages
Arrow right icon
Authors (2):
Arrow left icon
Prateek Joshi Prateek Joshi
Author Profile Icon Prateek Joshi
Prateek Joshi
Alberto Artasanchez Alberto Artasanchez
Author Profile Icon Alberto Artasanchez
Alberto Artasanchez
Arrow right icon
View More author details
Toc

Table of Contents (26) Chapters Close

Preface 1. Introduction to Artificial Intelligence 2. Fundamental Use Cases for Artificial Intelligence FREE CHAPTER 3. Machine Learning Pipelines 4. Feature Selection and Feature Engineering 5. Classification and Regression Using Supervised Learning 6. Predictive Analytics with Ensemble Learning 7. Detecting Patterns with Unsupervised Learning 8. Building Recommender Systems 9. Logic Programming 10. Heuristic Search Techniques 11. Genetic Algorithms and Genetic Programming 12. Artificial Intelligence on the Cloud 13. Building Games with Artificial Intelligence 14. Building a Speech Recognizer 15. Natural Language Processing 16. Chatbots 17. Sequential Data and Time Series Analysis 18. Image Recognition 19. Neural Networks 20. Deep Learning with Convolutional Neural Networks 21. Recurrent Neural Networks and Other Deep Learning Models 22. Creating Intelligent Agents with Reinforcement Learning 23. Artificial Intelligence and Big Data 24. Other Books You May Enjoy
25. Index

Preprocessing data

Raw data is the fuel of machine learning algorithms. But just like we cannot put crude oil into a car and instead we must use gasoline, machine learning algorithms expect data to be formatted in a certain way before the training process can begin. In order to prepare the data for ingestion by machine learning algorithms, the data must be preprocessed and converted into the right format. Let's look at some of the ways this can be accomplished.

For the examples we will analyze to work, we will need to import a few Python packages:

import numpy as np
from sklearn import preprocessing

Also, let's define some sample data:

input_data = np.array([[5.1, -2.9, 3.3],
                       [-1.2, 7.8, -6.1],
                       [3.9, 0.4, 2.1],
                       [7.3, -9.9, -4.5]])

These are the preprocessing techniques we will be analyzing:

  • Binarization
  • Mean removal
  • Scaling
  • Normalization

Binarization...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime