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
Hands-On Artificial Intelligence for Cybersecurity

You're reading from   Hands-On Artificial Intelligence for Cybersecurity Implement smart AI systems for preventing cyber attacks and detecting threats and network anomalies

Arrow left icon
Product type Paperback
Published in Aug 2019
Publisher Packt
ISBN-13 9781789804027
Length 342 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Alessandro Parisi Alessandro Parisi
Author Profile Icon Alessandro Parisi
Alessandro Parisi
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Section 1: AI Core Concepts and Tools of the Trade
2. Introduction to AI for Cybersecurity Professionals FREE CHAPTER 3. Setting Up Your AI for Cybersecurity Arsenal 4. Section 2: Detecting Cybersecurity Threats with AI
5. Ham or Spam? Detecting Email Cybersecurity Threats with AI 6. Malware Threat Detection 7. Network Anomaly Detection with AI 8. Section 3: Protecting Sensitive Information and Assets
9. Securing User Authentication 10. Fraud Prevention with Cloud AI Solutions 11. GANs - Attacks and Defenses 12. Section 4: Evaluating and Testing Your AI Arsenal
13. Evaluating Algorithms 14. Assessing your AI Arsenal 15. Other Books You May Enjoy

How to split data into training and test sets

One of the most commonly used methods to evaluate the learning effectiveness of our models is to test the predictions made by the algorithms on data it has never seen before. However, it is not always possible to feed fresh data into our models. One alternative involves subdividing the data at our disposal into training and testing subsets, varying the percentages of data to be assigned to each subset. The percentages usually chosen vary between 70% and 80% for the training subset, with the remaining 20–30% assigned to the testing subset.

The subdivision of the original sample dataset into two subsets for training and testing can be easily performed using the scikit-learn library, as we have done several times in our examples:

from sklearn.model_selection import train_test_split
# Create training and testing subsets
X_train, X_test...
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 €18.99/month. Cancel anytime