Machine Learning Basics | What is Machine Learning? | Introduction to Machine Learning

Adonis Tejeda Rivera
Analytics Vidhya
Published in
7 min readJul 6, 2020

We know humans learn from their past experiences and machines follow instructions given by humans but what if humans can train the machines to learn from the past data and to what humans can do act much faster. Well that’s called machine learning but it’s a lot more than just learning it’s also about understanding and reasoning.

In this blog we will learn about the basics of machine learning.

Suppose Paul he loves listening to new songs, he either likes them or dislikes them. Paul decides this on the basis of the songs tempo, genre, intensity and the gender of voice.

For simplicity let’s just use tempo and intensity for now, tempo is on the x-axis ranging from relaxed to fast whereas intensity is on the y-axis ranging from light to soling. We see that Paul likes the song with fast tempo and soaring intensity while he dislikes a song with relaxed tempo and light intensity.

So now we know Paul’s choices let’s see Paul listens to a new song let’s name it a song ‘A’. Song ‘A’ has fast tempo and the soaring intensity, can you guess will like the song or not… correct so Paul likes the song by looking at Paul’s past choices we were able to classify the unknown song very easily.

Let’s say now Paul listens to a new song let’s label it as song ‘B’. So song B lies somewhere with medium tempo and medium intensity neither relaxed nor fast neither light nor soaring now can you guess where the Paul likes it or not, not able to guess with this Paul will like it or dislike at the choice is unclear… correct we could easily classify song ‘A’ but when the choice became complicated as in the case of song ‘B’… yes and that’s where machine learning comes in.

Machine Learning can be defined as the science (and art) of programming computers so they can learn from data. [3]

Let’s see how in the same example for song ‘B’ if we draw a circle around the song B we see that there are four words for like whereas one would for dislike. If we go for the majority words we can say that Paul will definitely like the song. That’s all this was a basic machine learning algorithm also it’s called K nearest neighbors. So this is just a small example in one of the many machine learning algorithms. Quite easy right believe me it is but what happens when the choices become complicated as in the case of song ‘B’ that’s when machine learning comes in it learns the data builds the prediction model and when the new data point comes in it can easily project for it.

More Data > better model > higher accuracy.

There are many ways in which the machine learns it could be either:

  • Supervised learning
  • Unsupervised learning
  • Reinforcement learning

Let’s first quickly understand supervised learning.

Supervised learning

Suppose your friend gives you 1 million coins of three different currencies say one rupee, one euro and one dirham each coin has different weights for example a coin of one rupee weighs three grams, one euro weighs seven grams and one dirham weighs four grams. Your model will predict the currency of the coin. Here your weight becomes the feature of coins while currency becomes the label when you feed this data to the machine learning model it learns which feature is associated with which slip. For example it will learn that if a coin is of three grams it will be a one rupee coin.

Let’s give a you going to the machine on the basis of the weight of the new coin your model will predict the currency hence supervised learning uses labels data to train the model here the Machine knew the features of the object and also the labels associated with those features on this note.

In supervised learning, the training data you feed to the algorithm includes the desired solutions, called labels.

The most important supervised learning algorithms in the book: [2]

  • k-Nearest Neighbors
  • Linear Regression
  • Logistic Regression
  • Support Vector Machines (SVMs)
  • Decision Trees and Random Forests
  • Neural networks

Let’s move to unsupervised learning and see the difference.

Unsupervised learning

Suppose you have cricket datasets of various players with their respective scores and wickets taken. When you feed this datasets to the machine, the machine identifies the pattern of player performance so it plops this data with the respective wickets on the x axis while runs on the y axis. While looking at the data you will clearly see that there are two clusters, the one cluster are the players who scored high runs and took less wickets while the other cluster is of the players who scored less runs but took many wickets. So here we interpret these two clusters as batsmen and bowlers the important point to note here is that there were no labeled of batsmen and bowlers. Hence the learning with unlabeled data is unsupervised learning so we saw a supervised learning where the data was labeled and the unsupervised learning where the data was unlabeled.

In unsupervised learning, as you might guess, the training data is unlabeled. The system tries to learn without a teacher.

The most important supervised learning algorithms in the book [1]:

  • Clustering: k-Means, Hierarchical Cluster Analysis (HCA) and Expectation Maximization.
  • Visualization and dimensionality reduction: Principal Component Analysis (PCA), Kernel PCA, Locally-Linear Embedding (LLE), t-distributed Stochastic Neighbor Embedding (t-SNE)
  • Association rule learning: Apriori, Eclat

And then there’s reinforcement learning which is a reward based learning or we can say that it works on the principle of feedback.

Reinforcement learning

Here let’s say you provide the system with an image of a dog and ask it to identify it. The system identifies it as a cat so you give a negative feedback to the Machine saying that it’s a dog’s image. The machine will learn from the feedback and finally if it comes across any other image of a dog it will be able to classify it correctly that is reinforcement learning.

To generalize machine learning model let’s see a flowchart:

Input is given to a machine learning model which then gives the output according to the algorithm applied if it’s right we take the output as a final result else we provide feedback to the training model and ask it to predict until it learns.

Moving on don’t you sometimes wonder how is machine learning possible in today’s era well that’s because today we have humongous data available everybody is online either making a transaction or just surfing the internet and that’s generating a huge amount of data every minute and that data my friend is the key to analysis. Also the memory handling capabilities of computers have largely increased which helps them to process such a huge amount of data at hand without any delay and yes computers now have great computational powers so there are a lot of applications of machine learning out there. To name a few machine learning is used in:

  • Healthcare where Diagnostics are predicted for doctor’s review.
  • The sentiment analysis that the tech giants are doing on social media is another interesting application machine learning.
  • Fraud detection in the finance sector and also to predict customer churn in the e-commerce sector.

Also it uses predictive modeling to predict where the demand will be high with the goal that drivers can take care of the demand and surge pricing can be minimized great.

I hope you’ve understood supervised and unsupervised learning.
So let’s have a quick quiz you have to determine whether the given scenarios use the supervised or unsupervised learning simple right.

References

[1] Mitchell, T., 2017. Machine Learning. New York: McGraw Hill.

[2] Kanber, B., 2018. Hands-On Machine Learning With Javascript. Birmingham: Packt Publishing.

[3] Aurélien, G., 2017. Hands-On Machine Learning With Scikit-Learn & TensorFlow. Gravenstein Highway North: O’Reilly Media, Inc.

--

--