A General Introduction to Machine Learning

Sumit Kumar
Analytics Vidhya
Published in
7 min readAug 15, 2020

Decoding Machine Learning For Everyone

What is Machine Learning and how is it different from traditional computer programming?

We will understand this with the help of the block diagrams.

  • Traditional Computer Programming

In Traditional computer programming, we feed our computer with the data and the program to get the output.

figure 1: Traditional Computer Programming.
Figure 1: Traditional Computer Programming
  • Machine Learning

In Machine learning our computer is fed with the data and the output to generate a program that later can be used in unseen circumstances.

The performance of the program is measured using different evaluation metrics.

figure 2: Machine Learning
Figure 2: Machine Learning

Now that the stage is set, let’s take a deeper dive into machine learning.

What is Machine Learning?

[Machine Learning is the] field of study that gives computers the ability to learn without being explicitly programmed. — Arthur Samuel, 1959

It can be said that Machine Learning is the science which enables computers to learn from data through programming

Examples: Spam Filtering, Virtual Personal Assistant(Siri, Alexa), Product recommendations.

Why Machine Learning?

  • Economic reasons: using Machine Learning one can develop systems that manually need sophisticated technology users.
  • Simple and easy to implement: problems that require a lot of rules or hand-tuning can be solved with Machine learning algorithms.
  • Personalized user experience: one can develop a Machine Learning system that can adapt itself to the new data and therefore can be customized individually.
  • Discover insights from the large set of data: Machine Learning can be used to derive meaningful information from data, for example, Market Basket Analysis(sales data from a store is taken to uncover associations between products. Insights like “Customers who buy milk have also purchased eggs” can be derived) and can even be used to make predictions for the future events, example: Weather forecasting(we use previous weather data to predict the future weather conditions)

Types of Machine Learning

To make it simple to understand, we can classify Machine Learning into the 3 major categories:

Figure 3: Block Diagram showing types of Machine Learning

1. Based on whether the model needs human supervision or not

Under this category, the Machine Learning systems can further be classified based on the amount and the type of supervision required for training.

a) Supervised learning

Supervised learning is mostly classification based(example: a student fails or does not fail in the exam) but can also be used for regression (example: prediction of sales for a store)

This type of learning is preferred when the data provided is structured and labeled. The block diagram below provides an insight into how this learning is implemented.

Figure 4: Block diagram for Supervised Machine Learning

A few important algorithms for supervised learning are:

  • k-Nearest Neighbours(KNNs)
  • Support Vector Machines(SVMs)
  • Decision Trees and Random forests
  • Linear Regression
  • Logistic Regression
  • Neural Networks

Some regression algorithms like Logistic regression can be used for classification as well.

b) Unsupervised learning

This type of learning is preferred when the data provided is unlabelled therefore the system is programmed to learn without the labels.

Figure 5: An unlabelled dataset for unsupervised learning

A few important algorithms for unsupervised learning are:

  • Clustering(k-Means, Hierarchical Cluster Analysis, Expectation Maximisation)
  • Dimensionality Reduction and Visualisation{t-distributed Stochastic Neighbour Embedding(t-SNE), Locally Linear Embedding(LLE), Principal Component Analysis(PCA), Kernal Principal Component Analysis}
  • Association rule learning(Apriori, Eclat)

To separate a group of people into sub-groups, different clustering methods can be used.

Figure 6: After applying unsupervised learning we can see that a large group is subdivided into smaller groups

c) Semi-supervised learning

Semi-supervised learning is used for the mixed data(labeled + unlabeled data) which contains

  • A very small chunk of labeled data.
  • A large part of the data is unlabelled.

To handle such data types, techniques like Pseudo Labelling can be used.

Pseudo labeling is a technique where pseudo labels are predicted for the unlabelled data using labeled part of the data.

Now the pseudo-labeled data and labeled data are together used to generate a new model. This new model is then used to make predictions on the test data.

Figure 7: Block diagram for Pseudo-learning for semi-supervised learning

d) Reinforcement learning

Among all the learning methods discussed above, reinforcement learning works differently.

Photo by Franck V. on Unsplash
  • The aim here is to train a learning system(Agent) via trial and error in an unknown environment.
  • The agent is responsible to act as per the observations and rewards or penalizes according to the environment.
  • An agent has a learning algorithm and a policy.
  • A policy assists the agent to make the right decision in an unknown environment.
  • And to maximize rewards the system needs to constantly update the policy to handle this task we have a learning algorithm.
Figure 8: Block diagram for Reinforcement learning

Here’s a fun video to make you understand it better.

2. Whether they can learn incrementally from a stream of data or not

a) Online learning

  • The system is capable of learning incrementally
  • Small groups of data(mini-batches) is fed to the system to allow the system to learn sequentially(Individual instances).
  • Supports out-of-core learning(capable to handle data that cannot fit into the memory).
  • The ability of the system to learn in a new or changing environment is called the learning rate.
  • Here, to deal with bad data, one needs to monitor the system.
  • Useful where the data is generated continuously.
Figure 9: Online learning for large datasets

b) Batch learning

  • The system is capable of learning incrementally.
  • Also called offline learning as the system is trained(system has learned) and then deployed into production without any further learning process.
  • Training of the system is done using the available data.
  • It’s time-consuming as the full dataset is used to train the model.
  • Requires a lot of computing resources to handle large data.
  • The application is limited.

3. If they can measure the similarity between the points in the data or do they deliver patterns and build a predictive model

a) Instance-Based learning:

  • Does not perform explicit generalization.
  • Compares the instances seen in the training data to the new data and draws similarities between the two to make a decision.

b) Model-Based learning

A model is built from the set of given examples which is then used to make predictions(inferences).

There are 6 steps involved in the model building :

  • Problem Definition: in this step, we identify the problem that we are looking to solve and try to formulate the problem mathematically.
  • Hypothesis generation: this step is preferred to be done before having a look at the data to be unbiased.
  • Data Extraction: to collect data from various sources.
  • Data Exploration and Transformation:
Figure 10: Steps involved in Data Exploration and Transformation
  • Predictive Modelling: this is the part where we select the model (example: Linear Regression) which needs to be deployed to get the desired results.
  • Model Deployment/Implementation: in this step, we train the selected model on the training data and make predictions. Different performance measures are used to compare and select the best model.

Challenges involved in Machine Learning

The two main challenges involved in ML are bad algorithms and bad data.

  • Bad Data: if the training data is noisy then it gets really hard for the system to learn the underlying patterns within the data. This will affect the performance of the model negatively. Therefore, it is important to have clean data to develop a high-performance model.
Figure 11: Challenges involved in Machine Learning due to Bad Data
  • Bad Algorithm: The challenges linked with the bad algorithm are demonstrated using a block diagram below:
Figure 12: Challenges involved in Machine Learning due to Bad Algorithm

References

  • Hands-On Machine Learning with Scikit-Learn and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems 1st Edition by Aurélien Géron, Chapter1.

Congratulations! Now you have a basic idea of Machine Learning.

If you aren’t familiar with any of the algorithms mentioned in the article don’t worry we will be discussing them in coming articles.

In case if you have any questions, you can post it in comments, I would be more than happy to address them.

You can also find me on LinkedIn.

Any suggestions for improvement and feedback will be appreciated.

If you like my work, please consider following me, I will be writing more articles on Data Science.

--

--

Sumit Kumar
Analytics Vidhya

Data Engineer at NINE, Sydney | Masters in Data Science at Macquarie University, Sydney | Active Learner