Machine Learning Architecture Overview
Extending on the topic of practical approaches to machine learning in this guide we're going to discuss three potential architectures that you can use when you're building out your own machine learning programs.
Guide Tasks
  • Read Tutorial
  • Watch Guide Video
Video locked
This video is viewable to users with a Bottega Bootcamp license

What an architecture means is it's how you're going to set up your programs. Now we're not going to get into the details of how to do it but what I want to give you is a high level mind set for what that looks like both in what you can do and also how you can partner with other services if your potential use case is a better fit for that.

So the first case we're going to talk about is simply hosting a machine learning system right on your own computer. So this would be a great choice if say that you're working for a company and they don't need to see all of the recommendation engine kind of thing so they're not a Netflix or an Amazon or even a devcamp. They're not showing it to any other people. They simply want to integrate machine learning into their own reporting system.

So this could be an example where say you might work in the accounting department for an organization and they want to analyze sales data in that case you can simply build out all of your models and integrate the programming language and implement all of the algorithms right on your own computer, pipe in the data and then build out your reports and that's a pretty standard approach. And I have used that approach in a number of different use cases and in fact if you're working in industry that could be a very common way that you would use machine learning and data science.

Now the second approach is building out a full web application architecture. And so this is what you would need to do say if you are building a recommendation engine similar to Netflix. And so let's use Netflix as a case study and let's see exactly what their architecture looks like when you go to Netflix.com I'm going to draw you as a user right here. You're going to Netflix and you're simply going to be seen a browser window or a mobile application window. And in that window there are going to be a list of movies they might be recommended.

They may simply be a list of their latest ones and so each one of these lines represents a list of movies that you might be seen in their app or in a web browser.

large

Now the way that this works is Netflix simply has a front end application here and you do not have to be a web developer to understand this you don't have to go rebuild each one of these components just understand that when you go and you visit their app or the web browser you're just looking at a front end application. It doesn't have a lot of intelligence in itself. It simply is a wrapper that goes and calls other services. So they're going to have a service.

Let's pretend that this line right here represents the items in your personal list. There is no machine learning associated with that. They simply are going to have a nother server right here that's going to be your personal list.

large

No machine learning simply showing a list of movies or TV shows that you've added to your queue.

Now this one though let's say that this is your set of recommended movies. How does that work? Well this is going to call a completely different server. So this server is going to be I'm just going to put it on our right there. This is going to be the server that manages the recommendation engine and so every time that you like a video or show or you dislike it or you even just watch something. All of that data is being collected by this system.

large

This recommendation engine is watching your behavior. And now inside of here are all kinds of algorithms so they might have a K nearest neighbor algorithm they may have a K nearest algorithm. They might have a neural network all kinds of different algorithms and those are ones we're going to be discussing later on in the algorithms section but they could have multiple machine learning algorithms right here that will dynamically generate the recommended guides that are movies and those are going to be piped in and listed so that you can see some theme that may or may not be of interest to you.

You know the typical approach for this is for your machine learning algorithms to be on their own server instance and we're not going to get into how to build that yet. That has its own course. But what this is going to allow you to do is to contain all of the logic all of the algorithms all of your formulas everything like that all on a single server.

If we tried to say put all of Netflix on a single server we would never be able to go see it because it would crash every single second. Many machine learning algorithms are very very expensive. From a computational standpoint. So if you tried to place those inside of a regular application it is not going to be a good idea from a performance standpoint even for the recommendation engine that I built for dev camp. I completed and built out an entirely different application.

It is not on the dev camp server and it's not even inside of the dev camp application. It's a different service and in this case, the dev camp server goes and calls this machine learning application which is a standalone API and it simply sends in the input and then it gets the recommended output it gets that recommended article. So that is the approach I took and is one of the more standard approaches you'll see in industry as you go through your own machine learning journey.

Now I will say that this approach right here requires quite a bit of development expertise so if you are looking to build out option 2 which is building out this entire ecosystem then you're going to have to understand how to build web applications how to work with API's in addition to understanding how to build out these types of machine learning algorithms so that is something to keep in mind.

Now the third approach is to work with vendor based services. Now the list of vendors is way too long to go through in a single guide and it's continually evolving so I'm simply going to give a couple examples of some of the leaders in the industry such as AWS which is Amazon. Amazon offers all kinds of various API integrations where you can send them your data and then they will run their own machine learning algorithms all the way through them.

You can see in this visual how they have an entire system where you can build train tune and then deploy a entire AI system.

large

Another great provider is Google. Google has some of the most powerful machine learning algorithms in existence. They can perform tasks such as passing in data and then being able to have image recognition. Working with natural language processing. So if you want your system that you're building out to understand what people are saying is going to be a much better and more accurate solution to use a tool such as Google's AI as opposed to trying to build out your own from scratch.

So, in summary, those are three of the most popular ways to implement machine learning and data science programs into your own industry. So they were building on your own system. That is one where you're building the reports you have all of the data you implement the algorithm and then you generate whatever the recommendation or whatever the reporting data is right on your own system and that is something that is very popular in many different industries.

The second is building out an entire Web application architecture that is what you would need if you want to show your recommendations and show the results of the machine learning algorithm to users and then the third is to work with outside services in and outside service such as using Google's AI or AWS.

You will be piping all of your data directly to them and then they will return the result in that vendor specific approach. That is a very similar architecture to what we have right here with the only difference being. Instead of calling your own application you're going to be calling one of those vendors.