Chapter 11

Using ML Services

In this chapter we will bring IoT and AI together and look at how an online and free-to-use ML service can be added to our growing  weather station project: we are going to build a genuine “artificial intelligence powered predictive weather station.”

Errata:

There is cruft buried in the example.  We create an IoT Hub in Azure (11.4), but we don’t actually use it.  It won’t hurt at all to create it, then play around with what it can do, but I am reliably informed that it could have been omitted.  It was our intention to keep everything as simple as possible, and this is easily the densest chapter, so it is pity we missed this chance to simplify things.  Many thanks to @peterheldens for pointing this out.  While we are on the topic of using Azure, and making it easier to do so, you might want to check out this link, about Azure Plug-and-Play.

I will offer an explanation (excuse!). There were multiple options we had for our ML experiment, and we prototyped several.  The IBM Watson product was a very strong contender and Azure had made breaking changes to an earlier iteration, so in the run-up to deadline this chapter (and the next) were quite different.  But we’d already looked at how to use the MQTT Wi-Fi blocks, and we wanted to demonstrate that the IoT platform was NOT the hero of the experiment – that it could be switched out just as easily as the hardware.  So, at the last minute we pivoted and resurrected an earlier iteration, which passed all the testing and made it into the chapter.  We missed the chance to simplify it properly, in part because my co-author and I were a bit too close to things to spot it, and we ran out of time to keep making edits.

This leads to me a point that I made strongly in an earlier iteration of the book, but edited it out at some stage because it came across ever so slightly as a rant:

The point was that although the logical process of consuming an ML service is conceptually very simple, the providers of these services are primarily catering for expert users.  In much the same way that the early iterations of the Internet were accessible only to people with a fair amount of prior knowledge, so too are ML services pretty difficult to JUST USE!  I am not talking about building them, or training them – I mean passing some data into one and getting a bit of data out of it.  It SHOULD NOT take 33 images (crufts notwithstanding) and 30 pages to set up something so simple.  As the applications of ML become more pervasive and mundane so will the interfaces become less disjointed and confusing.

There are some exceptions: in particular Scratch has some really cool AI stuff that is extremely simple to use, and there are some very clever applications developed using IBM Watson.  The state of the art is changing daily though, and I don’t want to keep editing this page, so rather than provide links I’ll leave it up to you to Google it 🙂

I will slip in a final note, which is kind of an apology for this chapter. Not for the content I hasten to add – that does what it needs to do.  What I felt dissatisfied with here was the more staid and less engaging prose that is used.  I hope you noticed that I tried to intersperse the book with anecdotes and lighter moments, to make it as easy going as possible.  But with Chapter 11 I just couldn’t manage it.