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
Smart Internet of Things Projects

You're reading from   Smart Internet of Things Projects Discover how to build your own smart Internet of Things projects and bring a new degree of interconnectivity to your world

Arrow left icon
Product type Paperback
Published in Sep 2016
Publisher Packt
ISBN-13 9781786466518
Length 258 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Agus Kurniawan Agus Kurniawan
Author Profile Icon Agus Kurniawan
Agus Kurniawan
Arrow right icon
View More author details
Toc

Table of Contents (8) Chapters Close

Preface 1. Making Your IoT Project Smart 2. Decision System for IoT Projects FREE CHAPTER 3. Building Your Own Machine Vision 4. Making Your Own Autonomous Car Robot 5. Building Voice Technology on IoT Projects 6. Building Data Science-based Cloud for IoT Projects Index

Building a simple decision system-based Bayesian theory


In this section, we build a simple decision system using Bayesian theory. A smart water system is a smart system that controls water. In general, you can see the system architecture in the following figure:

After using a sensing process on water to obtain the water quality, you can make a decision. If the water quality is good, we can transfer the water to customers. Otherwise, we purify the water.

To implement a decision system-based Bayesian theory, firstly we define the state of nature. In this case, we define two states of nature:

  • ω1: water is ready for drinking

  • ω2: water should be cleaned (kotor)

For inputs, we can declare x1 and x1 as negative and positive as the observation results.

We define prior values and class conditional probabilities as follows:

To build a decision, we should make a loss function The following is a loss function for our program:

Now you can write the complete scripts for the program.

# decision action
# d1 = distribute...
You have been reading a chapter from
Smart Internet of Things Projects
Published in: Sep 2016
Publisher: Packt
ISBN-13: 9781786466518
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 $19.99/month. Cancel anytime