Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Python Machine Learning
Python Machine Learning

Python Machine Learning: Machine Learning and Deep Learning with Python, scikit-learn, and TensorFlow 2 , Third Edition

Arrow left icon
Profile Icon Sebastian Raschka Profile Icon Vahid Mirjalili
Arrow right icon
$29.99 $43.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (41 Ratings)
eBook Dec 2019 772 pages 3rd Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
Arrow left icon
Profile Icon Sebastian Raschka Profile Icon Vahid Mirjalili
Arrow right icon
$29.99 $43.99
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (41 Ratings)
eBook Dec 2019 772 pages 3rd Edition
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m
eBook
$29.99 $43.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Python Machine Learning

Training Simple Machine Learning Algorithms for Classification

In this chapter, we will make use of two of the first algorithmically described machine learning algorithms for classification: the perceptron and adaptive linear neurons. We will start by implementing a perceptron step by step in Python and training it to classify different flower species in the Iris dataset. This will help us to understand the concept of machine learning algorithms for classification and how they can be efficiently implemented in Python.

Discussing the basics of optimization using adaptive linear neurons will then lay the groundwork for using more sophisticated classifiers via the scikit-learn machine learning library in Chapter 3, A Tour of Machine Learning Classifiers Using scikit-learn.

The topics that we will cover in this chapter are as follows:

  • Building an understanding of machine learning algorithms
  • Using pandas, NumPy, and Matplotlib to read in, process, and visualize data
  • ...

Artificial neurons – a brief glimpse into the early history of machine learning

Before we discuss the perceptron and related algorithms in more detail, let's take a brief tour of the beginnings of machine learning. Trying to understand how the biological brain works, in order to design artificial intelligence (AI), Warren McCulloch and Walter Pitts published the first concept of a simplified brain cell, the so-called McCulloch-Pitts (MCP) neuron, in 1943 (A Logical Calculus of the Ideas Immanent in Nervous Activity, W. S. McCulloch and W. Pitts, Bulletin of Mathematical Biophysics, 5(4): 115-133, 1943). Biological neurons are interconnected nerve cells in the brain that are involved in the processing and transmitting of chemical and electrical signals, which is illustrated in the following figure:

McCulloch and Pitts described such a nerve cell as a simple logic gate with binary outputs; multiple signals arrive at the dendrites, they are then integrated into the...

Implementing a perceptron learning algorithm in Python

In the previous section, we learned how Rosenblatt's perceptron rule works; let's now implement it in Python and apply it to the Iris dataset that we introduced in Chapter 1, Giving Computers the Ability to Learn from Data.

An object-oriented perceptron API

We will take an object-oriented approach to defining the perceptron interface as a Python class, which will allow us to initialize new Perceptron objects that can learn from data via a fit method, and make predictions via a separate predict method. As a convention, we append an underscore (_) to attributes that are not created upon the initialization of the object, but we do this by calling the object's other methods, for example, self.w_.

Additional resources for Python's scientific computing stack

If you are not yet familiar with Python's scientific libraries or need a refresher, please see the following resources:

    ...

Adaptive linear neurons and the convergence of learning

In this section, we will take a look at another type of single-layer neural network (NN): ADAptive LInear NEuron (Adaline). Adaline was published by Bernard Widrow and his doctoral student Tedd Hoff only a few years after Rosenblatt's perceptron algorithm, and it can be considered an improvement on the latter (An Adaptive "Adaline" Neuron Using Chemical "Memistors", Technical Report Number 1553-2, B. Widrow and others, Stanford Electron Labs, Stanford, CA, October 1960).

The Adaline algorithm is particularly interesting because it illustrates the key concepts of defining and minimizing continuous cost functions. This lays the groundwork for understanding more advanced machine learning algorithms for classification, such as logistic regression, support vector machines, and regression models, which we will discuss in future chapters.

The key difference between the Adaline rule (also known as the Widrow...

Summary

In this chapter, we gained a good understanding of the basic concepts of linear classifiers for supervised learning. After we implemented a perceptron, we saw how we can train adaptive linear neurons efficiently via a vectorized implementation of gradient descent and online learning via SGD.

Now that we have seen how to implement simple classifiers in Python, we are ready to move on to the next chapter, where we will use the Python scikit-learn machine learning library to get access to more advanced and powerful machine learning classifiers, which are commonly used in academia as well as in industry.

The object-oriented approach that we used to implement the perceptron and Adaline algorithms will help with understanding the scikit-learn API, which is implemented based on the same core concepts that we used in this chapter: the fit and predict methods. Based on these core concepts, we will learn about logistic regression for modeling class probabilities and support vector...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Third edition of the bestselling, widely acclaimed Python machine learning book
  • Clear and intuitive explanations take you deep into the theory and practice of Python machine learning
  • Fully updated and expanded to cover TensorFlow 2, Generative Adversarial Network models, reinforcement learning, and best practices

Description

Python Machine Learning, Third Edition is a comprehensive guide to machine learning and deep learning with Python. It acts as both a step-by-step tutorial, and a reference you'll keep coming back to as you build your machine learning systems. Packed with clear explanations, visualizations, and working examples, the book covers all the essential machine learning techniques in depth. While some books teach you only to follow instructions, with this machine learning book, Raschka and Mirjalili teach the principles behind machine learning, allowing you to build models and applications for yourself. Updated for TensorFlow 2.0, this new third edition introduces readers to its new Keras API features, as well as the latest additions to scikit-learn. It's also expanded to cover cutting-edge reinforcement learning techniques based on deep learning, as well as an introduction to GANs. Finally, this book also explores a subfield of natural language processing (NLP) called sentiment analysis, helping you learn how to use machine learning algorithms to classify documents. This book is your companion to machine learning with Python, whether you're a Python developer new to machine learning or want to deepen your knowledge of the latest developments.

Who is this book for?

If you know some Python and you want to use machine learning and deep learning, pick up this book. Whether you want to start from scratch or extend your machine learning knowledge, this is an essential resource. Written for developers and data scientists who want to create practical machine learning and deep learning code, this book is ideal for anyone who wants to teach computers how to learn from data.

What you will learn

  • Master the frameworks, models, and techniques that enable machines to learn from data
  • Use scikit-learn for machine learning and TensorFlow for deep learning
  • Apply machine learning to image classification, sentiment analysis, intelligent web applications, and more
  • Build and train neural networks, GANs, and other models
  • Discover best practices for evaluating and tuning models
  • Predict continuous target outcomes using regression analysis
  • Dig deeper into textual and social media data using sentiment analysis

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Dec 12, 2019
Length: 772 pages
Edition : 3rd
Language : English
ISBN-13 : 9781789958294
Vendor :
Google
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Dec 12, 2019
Length: 772 pages
Edition : 3rd
Language : English
ISBN-13 : 9781789958294
Vendor :
Google
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 161.97
Advanced Deep Learning with Python
$48.99
Python Machine Learning
$54.99
Machine Learning for Algorithmic Trading
$57.99
Total $ 161.97 Stars icon

Table of Contents

20 Chapters
Giving Computers the Ability to Learn from Data Chevron down icon Chevron up icon
Training Simple Machine Learning Algorithms for Classification Chevron down icon Chevron up icon
A Tour of Machine Learning Classifiers Using scikit-learn Chevron down icon Chevron up icon
Building Good Training Datasets – Data Preprocessing Chevron down icon Chevron up icon
Compressing Data via Dimensionality Reduction Chevron down icon Chevron up icon
Learning Best Practices for Model Evaluation and Hyperparameter Tuning Chevron down icon Chevron up icon
Combining Different Models for Ensemble Learning Chevron down icon Chevron up icon
Applying Machine Learning to Sentiment Analysis Chevron down icon Chevron up icon
Embedding a Machine Learning Model into a Web Application Chevron down icon Chevron up icon
Predicting Continuous Target Variables with Regression Analysis Chevron down icon Chevron up icon
Working with Unlabeled Data – Clustering Analysis Chevron down icon Chevron up icon
Implementing a Multilayer Artificial Neural Network from Scratch Chevron down icon Chevron up icon
Parallelizing Neural Network Training with TensorFlow Chevron down icon Chevron up icon
Going Deeper – The Mechanics of TensorFlow Chevron down icon Chevron up icon
Classifying Images with Deep Convolutional Neural Networks Chevron down icon Chevron up icon
Modeling Sequential Data Using Recurrent Neural Networks Chevron down icon Chevron up icon
Generative Adversarial Networks for Synthesizing New Data Chevron down icon Chevron up icon
Reinforcement Learning for Decision Making in Complex Environments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(41 Ratings)
5 star 68.3%
4 star 19.5%
3 star 4.9%
2 star 4.9%
1 star 2.4%
Filter icon Filter
Top Reviews

Filter reviews by




THEODOROS ZAFEIRIDIS Jul 16, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
the best among many others
Feefo Verified review Feefo
Matthew Emerick Apr 20, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Disclaimer: The publisher asked me to review this book and gave me a review copy. I promise to be 100% honest in how I feel about this book, both the good and the less so.Overview:This book is for anyone with Python experience that in interested in learning about machine learning and artificial intelligence. It gives a wide range of experience for anyone that goes through the exercises, from the fundamentals to advanced TensorFlow, GANs, and reinforcement learning. By working through this book, the reader should know enough to join a machine learning team.What I Like:This book has a wonderful breadth and depth about it, and is structured very well. The very first chapter sets realistic expectations and how to get ready for the meat of the book. The second chapter follows quite well with the basics that the rest of the book is based on.Chapters four and five are great for preparing your data, which is required for the remaining chapters. Then comes a timely chapter on tuning your hyperparameters, which is essential for gaining the best results from your algorithm. Then come several chapters that go into detail on specific applications. Chapters thirteen and fourteen detail the use of TensorFlow, which is used in the remaining chapters.The final chapters go into more advanced applications of ML using the concepts already discussed in the book. This gives a little closure to the book, but I feel like it's missing something. Maybe a chapter listing ways to extend what you've already done, or sections of other concepts that were not discussed.What I Don't Like:One of the only things that I can really point out is that while chapter three works through classification algorithms (unsupervised learning), the following two chapters go through preparing your data which comes before using any of those clustering algorithms. The only way to look at it that make sense is to see chapter three giving you even more of a follow up introduction after the previous chapter before getting into more detail. It's probably not the path I would have gone, but I'm not the author. And, really, it's a small quibble.Chapter seven is also placed a little oddly, in that it's about ensemble learning, which is where you combine techniques, which haven't been taught yet, to get better results. I would have placed this at the end, which would have been a nice way to close out the book.There is also a section in chapter fourteen about migrating from the first version of TensorFlow to the second, which is an odd thing to have in a book that is introducing the reader to the library. Why not just stick with the newer version, which will be supported longer?What I Would Like to See:There is very little I would change in this book, other than a little more consistency with using the newest version of TensorFlow and a slight reorganization. I like the summaries at the end of the chapters. Project extension ideas would have been nice, as would add a chapter with a quick summary of important concepts that the authors didn't have time to go into. But otherwise, it's an excellent book.Overall, I give this book 4.6 out of 5 stars. I applaud the work done and look forward to more from the authors.
Amazon Verified review Amazon
acc_annon Dec 18, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Review of the drm-free pdf version sold by the publisher. One of the best practical books on the subject! Covering wide range of topics with concrete non-trivial practical examples, python code, data sets, and with enough-but-not-too-much theory and references to provide further insight and understanding. 750+ pages! Highly recommended.
Amazon Verified review Amazon
Puneet Apr 29, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Easy language book...
Amazon Verified review Amazon
B Apr 12, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
El libro cubre un amplio contenido en Machine Learning y Deep Learning, con explicaciones muy precisas de lo que se está haciendo en cada momento, es un libro muy bueno pero recomiendo tener algunas bases, lo recomiendo si quieres profundizar en el tema o si no has entendido del todo algunos fundamentos o bases, es perfecto para estudiantes y profesionales del sector, también habrá códigos que no funcionen 100% como en el libro y tendrás que adaptarlos o matizarlos, pues los paquetes han ido actualizándose y hay pequeños cambios, en cualquier caso, es fácil resolver cualquier problema que encuentres con los códigos si consultas en internet y en foros especializados.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.