Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Hands-On Machine Learning for Cybersecurity

You're reading from  Hands-On Machine Learning for Cybersecurity

Product type Book
Published in Dec 2018
Publisher Packt
ISBN-13 9781788992282
Pages 318 pages
Edition 1st Edition
Languages
Authors (2):
Soma Halder Soma Halder
Profile icon Soma Halder
Sinan Ozdemir Sinan Ozdemir
Profile icon Sinan Ozdemir
View More author details
Toc

Table of Contents (13) Chapters close

Preface 1. Basics of Machine Learning in Cybersecurity 2. Time Series Analysis and Ensemble Modeling 3. Segregating Legitimate and Lousy URLs 4. Knocking Down CAPTCHAs 5. Using Data Science to Catch Email Fraud and Spam 6. Efficient Network Anomaly Detection Using k-means 7. Decision Tree and Context-Based Malicious Event Detection 8. Catching Impersonators and Hackers Red Handed 9. Changing the Game with TensorFlow 10. Financial Fraud and How Deep Learning Can Mitigate It 11. Case Studies 12. Other Books You May Enjoy

Deep learning time

Finally, we will use deep learning to solve the issue and look for the accuracy of the results. We will take advantage of the keras package to use the Sequential and Dense models, and the KerasClassifier packages, as shown in the following code:

from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scikit_learn import KerasClassifier

We change our function to have multiple hidden layers in our network:

def network_builder(hidden_dimensions, input_dim):
# create model
model = Sequential()
model.add(Dense(hidden_dimensions[0], input_dim=input_dim, kernel_initializer='normal', activation='relu'))
# add multiple hidden layers
for dimension in hidden_dimensions[1:]:
model.add(Dense(dimension, kernel_initializer='normal', activation='relu'))
model.add...
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 ₹800/month. Cancel anytime