Basics of Machine Learning

A Dive into Supervised, Unsupervised, and Reinforcement Learning Algorithms

Megha Sinha
6 min readMar 20, 2024

What you will learn in this article:

  1. What is ML
  2. Types of Machine learning
  3. Supervised Machine Learning
  4. Unsupervised Machine Learning
  5. Reinforcement Machine Learning
  6. Conclusion

Have you ever thought about how machines can learn and make decisions on their own? It’s a fascinating world! Machine learning is a field that keeps growing and changing. It’s transformed how we use technology and understand the world. In this series, we’ll explain machine learning concepts in a way that’s easy to understand. We’ll break down the complicated stuff into simple, easy-to-grasp ideas.

AI generated Image

What is ML

At its core, Machine Learning is a branch of Artificial Intelligence that enables computers to learn and improve from experience without being explicitly programmed. Think of it as teaching a computer to recognize patterns and make decisions, much like how humans learn from past experiences.

The magic of Machine Learning lies in its ability to analyze vast amounts of data, detect patterns, and make predictions or decisions based on that analysis. From recommending movies on Netflix to powering self-driving cars, Machine Learning algorithms are behind many of the conveniences we enjoy today. But how does it work? Machine Learning algorithms learn from data by identifying patterns and adjusting their parameters accordingly.

One of the most exciting aspects of Machine Learning is its potential for innovation and discovery. The possibilities are endless, whether it’s improving healthcare diagnostics, optimizing business processes, or enhancing customer experiences.

Types of Machine Learning

ML algorithms can be categorized into different types, including supervised learning, unsupervised learning, and reinforcement learning. Each of these approaches offers unique insights into how machines can learn from data, adapt to environments, and make decisions.

Supervised Machine Learning :

Supervised Learning is like having a knowledgeable mentor by your side, providing clear guidance and feedback every step of the way. In this paradigm, the algorithm learns from labeled data, where each input is associated with a corresponding output. The goal is to learn a mapping function that can predict the output for new, unseen inputs accurately.

Imagine training a model to distinguish between cats and dogs based on images. You provide the algorithm with a dataset containing labeled images of cats and dogs. Through iterations of training, the model learns the distinctive features of each animal, such as ear shape, fur texture, and tail length. Once trained, the model can accurately classify new images, even ones it hasn’t seen before.

Supervised Learning finds applications across various domains, from email spam detection and sentiment analysis to medical diagnosis and stock price prediction. Its reliance on labeled data makes it well-suited for tasks where clear examples are available.

Types of Supervised Learning Algorithm:

  1. Linear Regression
  2. Logistic Regression:
  3. Decision Trees
  4. Random Forests
  5. Support Vector Machine(SVM):
  6. K-Nearest Neighbors
  7. Gradient Boosting
  8. Polynomial Regression

Unsupervised Machine Learning:

Unsupervised Learning is akin to exploring uncharted territory, where there are no predefined paths or signposts. Here, the algorithm delves into unlabeled data, seeking hidden patterns, structures, or relationships without explicit guidance.

Consider clustering similar customer segments in a marketing dataset. With Unsupervised Learning, the algorithm identifies groups of customers with similar purchasing behaviors, preferences, or demographics, without any prior knowledge of these groups. This segmentation can then inform targeted marketing strategies or product recommendations.

The input to the unsupervised learning models:

  • Unstructured data: May contain noisy(meaningless) data, missing values, or unknown data
  • Unlabeled data: Data only contains a value for input parameters, there is no targeted value(output). It is easy to collect as compared to the labeled one in the Supervised approach.

Types of Unsupervised Learning:

  1. Clustering
  • K-means Clustering
  • Hierarchical Clustering
  • Density-Based Clustering (DBSCAN):
  • Mean-Shift Clustering:
  • Spectral Clustering

2. Dimensionality Reduction

  • Principal Component Analysis (PCA):
  • Non-negative Matrix Factorization (NMF):
  • Locally Linear Embedding (LLE):
  • Linear Discriminant Analysis (LDA)

3. Association Rule Learning

  • Apriori Algorithm
  • FP-Growth Algorithm
  • Eclat Algorithm
  • Efficient Tree-based Algorithms Scalability
  • Dimensionality Reduction

Reinforcement Machine Learning:

Reinforcement Learning mirrors the learning process observed in humans and animals, where agents learn optimal behavior through trial-and-error interactions with an environment. In this paradigm, the algorithm learns by receiving feedback in the form of rewards or penalties based on its actions. Imagine training an AI to play a game of chess. The algorithm makes moves, receives feedback on the outcome (win, lose, or draw), and adjusts its strategy accordingly to maximize future rewards.

Reinforcement Learning is well-suited for sequential decision-making tasks, such as robotics control, autonomous driving, and game playing. Its ability to learn from direct interactions with the environment makes it a powerful tool for mastering complex scenarios.

Types of Reinforcement learning :

Model-based algorithms:

In model-based algorithms, the agent is able to predict the reward of an outcome and takes the action in order to maximize the reward. It is a greedy algorithm where the decision is entirely based on maximizing the rewards points.

It is used in situations where we have complete knowledge about an environment and the outcome of the actions in that environment. For environments that are fixed or static in nature, model-based algorithms are more suitable. They also allow agents to plan ahead.

Model-free algorithms:

In model-free algorithms, the agent carries out multiple actions multiple times and learns from the outcomes. Based on the learning experience, it tries to decide a policy or a strategy to carry out actions with an aim to get optimal reward points. This type of algorithm should be applied to environments with a dynamic nature and where we don’t have complete knowledge about them.

A reinforcement learning example is autonomous driving cars that have a dynamic environment where there can be a lot of changes in traffic routes. Model-free algorithms are most suitable in such situations.

Reinforcement learning techniques:

Following are the list of various reinforcement learning techniques:

  1. Markov decision process (MDP)
  2. Bellman equation
  3. Dynamic programming
  4. Value iteration
  5. Policy iteration
  6. Q-learning.

Conclusion:

In conclusion, the world of machine learning offers a rich tapestry of algorithms and techniques designed to tackle a wide array of problems. In this basic overview, we explored three fundamental categories: supervised learning, unsupervised learning, and reinforcement learning.

Join me on this journey as we delve deeper into the fascinating world of Machine Learning, uncovering its wonders and exploring its endless possibilities.

Stay tuned for more insights, tutorials, and real-world applications of Machine Learning in upcoming posts. Together, let’s unlock the full potential of this transformative technology!

NLP Basics : https://medium.com/@megha24asma/an-introduction-to-natural-language-processing-nlp-3cb7b15fb2a1

--

--

Megha Sinha

Working as a Senior Data Scientist at Whiz.ai | Ex-NOKIA | Alumnus of NIT Jamshedpur | Natural Language Processing