Memuat
Memuat
Watch every step above performed live, with English narration.
0 plays
Class book
Page 1 / 6
Cover: Class Intrusion Detection Network IoT Hybrid ML #3: Feature Selection with Mutual Information and PCA
Click a page or use ◀ ▶ to turn · swipe on mobile · to enlarge
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Class Intrusion Detection Network IoT Hybrid ML #3: Feature Selection with Mutual Information and PCA”.
Other ways we can help with Python.
Learn with a mentor
Scheduled Cyber Security courses with live guidance and a certificate.

IoT Network Intrusion Detection Course with Hybrid Autoencoder + XGBoost

Cyber Security Course: Foundations of System & Network Security

Ethical Hacking Course: Web Application Penetration Testing
Have it built for you
No time to learn Python? Our team can do the project for you.
See all in Cyber Security →Get notified about new Python classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
This is the final result, from 122 features, we found that the 40 best features according to Mutual Information already produce the same accuracy, and 31 PCA components already capture 95% of the information. Let's start. Hello, welcome to episode three of the IoT network intrusion detection series with Hybrid Machine Learning. On IoT devices and routers with limited computational power, each calculated feature consumes time and energy. Feature selection helps us choose the ones that are truly important. Today we are comparing two approaches, Mutual Information and PCA.
Create a feature selection underscore file.py. Mutual Information measures how much information a feature has about the attack class, including non-linear relationships. We calculate on 20,000 random samples to make it fast, print the top 10 features, and save the 40 best features to a JSON file. Then PCA transforms the 122 features into components that are not correlated with each other, and we find out how many components explain 95% of the variance. Run. The most informative feature is SRC-B test with a value of 0.7, followed by DVSR-V rate, SAMSR-V rate, and DST-B test, features that indeed differentiate attack connection patterns. Only 31 PCA components are needed for 95% variance.
Continue with the RF test function that trains a random forest with 60 trees and calculates macro F1 on the test data. Then we compare the three feature sets and plot their graphs. Run. With all features, macro F1 is 0.484. With 40 mutual information features, 0.482, almost the same as a third of the number of features. With 31 PCA components, 0.460, slightly lower. This low F1 value is expected for NSL-KAD because there are many 0DI attacks in the test data, a challenge we will address with the hybrid model.
Let's see the graphs. The mutual information diagram shows several features being dominant, then gradually decreasing. The PCA curve rises quickly in the first 10 components and then levels off. The right diagram compares the three feature sets. Mutual information maintains accuracy while reducing the number of features. And since the features remain the original ones, the results are easy to interpret by security analysts.
Done. We have measured the importance of features using mutual information, reduced the dimensionality with PCA, and tested its impact on Random Forest. In the next episode, we will build three single models. Random Forest, XGBoost, and Autoencoder. Currently working on a thesis, dissertation, or research in the field of network security and machine learning? Cerdas Inovasi Digital helps implement intrusion detection systems, from network traffic preprocessing, feature selection, Random Forest and XGBoost, up to Autoencoder for 0DI attacks and monitoring dashboard, as well as offering Python programming courses for electrical engineering and computer science. Want to master the entire series, from intrusion datasets to hybrid systems ready for monitoring? All six episodes, complete with step-by-step PDF guides, datasets, and source code, are available to premium tutorial subscribers. Subscribe starting at Rp69.000 per month, save 28% with the 12-month package, or pay once Rp999.000 for lifetime access. Want just one class? Buy a single class with lifetime access. Subscribe now on the premium page at cerdasinovasidigital.com. Contact us via WhatsApp, or visit cerdasinovasidigital.com. Thank you for watching, see you in the next episode.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →