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 Artificial Intelligence for IoT - Second Edition

You're reading from  Hands-On Artificial Intelligence for IoT - Second Edition

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781788836067
Pages 390 pages
Edition 2nd Edition
Languages
Author (1):
Amita Kapoor Amita Kapoor
Profile icon Amita Kapoor
Toc

Table of Contents (20) Chapters close

Title Page
Copyright and Credits
Dedication
About Packt
Contributors
Preface
1. Principles and Foundations of IoT and AI 2. Data Access and Distributed Processing for IoT 3. Machine Learning for IoT 4. Deep Learning for IoT 5. Genetic Algorithms for IoT 6. Reinforcement Learning for IoT 7. Generative Models for IoT 8. Distributed AI for IoT 9. Personal and Home IoT 10. AI for the Industrial IoT 11. AI for Smart Cities IoT 12. Combining It All Together 1. Other Books You May Enjoy Index

Coding genetic algorithms using Distributed Evolutionary Algorithms in Python


Now that we understand how genetic algorithms work, let's try solving some problems with them. They have been used to solve NP-hard problems such as the traveling salesman problem. To make the task of generating a population, performing the crossover, and performing mutation operations easy, we will make use of Distributed Evolutionary Algorithms in Python (DEAP). It supports multiprocessing and we can use it for other evolutionary algorithms as well. You can download DEAP directly from PyPi using this:

pip install deap

It is compatible with Python 3. 

To learn more about DEAP, you can refer to its GitHub repository (https://github.com/DEAP/deap) and its user's guide (http://deap.readthedocs.io/en/master/). 

Guess the word

In this program, we use genetic algorithms to guess a word. The genetic algorithm will know the number of letters in the word and will guess those letters until it finds the right answer. We decide...

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