Now that we understood the difference about the three approaches we can have over AI with the last article, let’s dive in into the mid-term approach, always keeping in mind the borders. Given the explanation of the differences between Machine Learning approaches: a) ready-to-use APIs, b) training a model, and c) creating a model, let’s talk about training (using) a model.
Training a model
This is the mid-term approach to AI (Machine Learning) problems. Once you found out your problem can’t be solved by any ready-to-use API, try this approach. Just because there is no ready-to-use API, it doesn’t mean nobody ever tried to solve your problem generically and widely speaking. There is a high probability that your problem already can be solved by an existing model. Using this approach you will have to look for three things. It’s not a dependency, since the third step can be left away in some cases (example below), but they are a sequence.
Finding the best model
This is the part where you will have to have someone with good experience in this subject. There are different models to solve the same problem, as an instance. And there are also many problems without models covering it. You will have to find the best model that fits best to your needs. You will have to check the trust percentage that model gives, if it checks all the information you have, if you will have to adapt any information you already have to use that model, and many other things;
We can split the models into three different groups:
Models for supervised training
It happens when you have the information that the algorithm must reach conclusion X (objective) after evaluating A (info 1), B (info 2) and C (info 3) information; Example: you know that sneezing (info 1), high body temperature (info 2) and pain over all the body (info 3) means you have the flu (objective). Here I present some well-known models:
o Linear regression – https://docs.aws.amazon.com/machine-learning/latest/dg/types-of-ml-models.html – It is good to work with number prediction. Examples: What will be the weather for tomorrow? For how much this house will be sold?
o Decision tree – https://www.ibm.com/support/knowledgecenter/en/SS3RA7_15.0.0/com.ibm.spss.modeler.help/nodes_treebuilding.htm – Find out the disease: are the sympthoms A, B and C true? Then disease X; Are the sumptoms A, B and D true? Then disease Y;
o Bayesian network – https://pt.slideshare.net/GiladBarkan/bayesian-belief-networks-for-dummies – When we have an evidence and want to reach its cause. Belief propagation. The same health scenario above can be applied, but in an inverse way. I have the flu. I must identify in this patient we have all the sympthoms, or even without showing sneezing, he still has the flu.
Models for unsupervised training
It happens when you don’t have the conclusion the algorithm must reach. You will have to check it every time it runs. Example: if the customer bought product X and Y, he may be interested in product Z. You won’t know if it is true, because the customer may get interested, but even with that, don’t buy the product. Here I present some well-known models:
o Association – https://en.wikipedia.org/wiki/Association_rule_learning – Same example above of suggesting things to be bought;
o Anomaly detection – Any chart control or information where anomalies have to be alerted. Stock market or the temperature inside a factory’s chamber, as instances;
Models for semi supervised training
When sometimes you know what you will reach. Your problem will set if you will be able to use this model. More models can be found at https://en.wikipedia.org/wiki/Outline_of_machine_learning#Machine_learning_algorithms
Configuring a model
It happens when you have a known model and must configure it. Sometimes you won’t have to train the model.
An example for linear regression, which came from another customer: he wanted to mix many different information from many different sources and reach out how it would affect their product pricing. For each of their products, you configure the algorithm in order to understand that supply A affects 10% of final product pricing, supply B affects 50%, and etc. Knowing that, the algorithm would be able to “predict” changes on their prices and warn them to buy more or less of each supply. This way they would be in front of their competitors, saving money at the right time;
And then… Training a model
Once you have a problem requiring a model to be trained to identify your target, you will have to have data to train your model. The image analysis that cloud providers provide through APIs are great examples. Once you upload an Eiffel Tower image there, the algorithm already knows there is an Eiffel Tower within your image. But how do they do that? They have already trained the model to understand patterns on the image and then classify it. It’s the same thing that Facebook does every time it recognizes faces on your uploaded photos. For the Facebook example, it gets even more impressive because Facebook trains their algorithm with everybody’s faces. Then they know that your image has a photo of your specific friend, and suggest you to tag that guy! It’s not just a generic person recognition like other models do.
How to do that?
At last, there are many tools, such as Google AutoML, Amazon Machine Learning, Watson and TensorFlow (open source tool). The providers solutions allow you to send a given model to cloud and then use their infrastructure to run, train and consume it;