Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Hands-On Graph Neural Networks Using Python

You're reading from  Hands-On Graph Neural Networks Using Python

Product type Book
Published in Apr 2023
Publisher Packt
ISBN-13 9781804617526
Pages 354 pages
Edition 1st Edition
Languages
Author (1):
Maxime Labonne Maxime Labonne
Profile icon Maxime Labonne

Table of Contents (25) Chapters

Preface Part 1: Introduction to Graph Learning
Chapter 1: Getting Started with Graph Learning Chapter 2: Graph Theory for Graph Neural Networks Chapter 3: Creating Node Representations with DeepWalk Part 2: Fundamentals
Chapter 4: Improving Embeddings with Biased Random Walks in Node2Vec Chapter 5: Including Node Features with Vanilla Neural Networks Chapter 6: Introducing Graph Convolutional Networks Chapter 7: Graph Attention Networks Part 3: Advanced Techniques
Chapter 8: Scaling Up Graph Neural Networks with GraphSAGE Chapter 9: Defining Expressiveness for Graph Classification Chapter 10: Predicting Links with Graph Neural Networks Chapter 11: Generating Graphs Using Graph Neural Networks Chapter 12: Learning from Heterogeneous Graphs Chapter 13: Temporal Graph Neural Networks Chapter 14: Explaining Graph Neural Networks Part 4: Applications
Chapter 15: Forecasting Traffic Using A3T-GCN Chapter 16: Detecting Anomalies Using Heterogeneous GNNs Chapter 17: Building a Recommender System Using LightGCN Chapter 18: Unlocking the Potential of Graph Neural Networks for Real-World Applications
Index Other Books You May Enjoy

Preprocessing the CIDDS-001 dataset

In the last section, we identified some issues with the dataset we need to address to improve the accuracy of our model.

The CIDDS-001 dataset includes diverse types of data: we have numerical values such as duration, categorical features such as protocols (TCP, UDP, ICMP, and IGMP), and others such as timestamps or IP addresses. In the following exercise, we will choose how to represent these data types based on the information from the previous section and expert knowledge:

  1. First, we can one-hot-encode the day of the week by retrieving this information from the timestamp. We will rename the resulting columns to make them more readable:
    df['weekday'] = df['Date first seen'].dt.weekday
    df = pd.get_dummies(df, columns=['weekday']).rename(columns = {'weekday_0': 'Monday','weekday_1': 'Tuesday','weekday_2': 'Wednesday', 'weekday_3': 'Thursday...
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 $15.99/month. Cancel anytime}