Search icon CANCEL
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
Machine Learning for Streaming Data with Python

You're reading from   Machine Learning for Streaming Data with Python Rapidly build practical online machine learning solutions using River and other top key frameworks

Arrow left icon
Product type Paperback
Published in Jul 2022
Publisher Packt
ISBN-13 9781803248363
Length 258 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Joos Korstanje Joos Korstanje
Author Profile Icon Joos Korstanje
Joos Korstanje
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Part 1: Introduction and Core Concepts of Streaming Data
2. Chapter 1: An Introduction to Streaming Data FREE CHAPTER 3. Chapter 2: Architectures for Streaming and Real-Time Machine Learning 4. Chapter 3: Data Analysis on Streaming Data 5. Part 2: Exploring Use Cases for Data Streaming
6. Chapter 4: Online Learning with River 7. Chapter 5: Online Anomaly Detection 8. Chapter 6: Online Classification 9. Chapter 7: Online Regression 10. Chapter 8: Reinforcement Learning 11. Part 3: Advanced Concepts and Best Practices around Streaming Data
12. Chapter 9: Drift and Drift Detection 13. Chapter 10: Feature Transformation and Scaling 14. Chapter 11: Catastrophic Forgetting 15. Chapter 12: Conclusion and Best Practices 16. Other Books You May Enjoy

Defining classification

In this chapter, you will discover classification. Classification is a supervised machine learning task in which a model is constructed that assigns observations to a category.

The simplest types of classification models that everybody tends to know are decision trees. Let's consider a super simple example of how a decision tree could be used for classification.

Imagine that we have a dataset in which we have observations about five humans and five animals. The goal is to use this data to build a decision tree that can be used on any new, unseen animal or human.

The data can be imported as follows:

Code Block 6-1

import pandas as pd
# example to classify human vs animal
#dataset with one variable
can_speak = [True,True,True,True,True,True,True,False,False,False]
has_feathers = [False,False,False,False,False,True,True,False,False,False]
is_human = [True,True,True,True,True,False,False,False,False,False]
data = pd.DataFrame...
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