What is Machine Learning ?

What is Machine Learning ?

Hi this this my first article, let's start understanding machine learning. In simplest words, Machine learning is a type of artificial intelligence that allows computers to learn and make decisions from data without being explicitly programmed. Instead of following specific instructions, the computer uses algorithms to find patterns in data and improve its performance over time. Think of it like teaching a computer to recognize things by showing it many examples, so it can make predictions or decisions based on what it has learned.

Machine learning can be broadly categorized into three main types:

Supervised Learning:

In supervised learning, the model is trained on labeled data, meaning the input data is paired with the correct output. The goal is for the model to learn a mapping from inputs to outputs so it can predict the output for new, unseen inputs an example of supervised learning can be a spam filter that is trained on emails labeled as "spam" or "not spam" to learn how to classify new emails. Supervised

Classification:

Classification is a type of machine learning used to categorize data into predefined classes or labels.

In the example below our code generates random data points for 2 classes ( yellow and reddish-blue), these two classes can be anything spam or no spam, cat or dog.. etc. Then we train a logistic regression classification model, and visualize the decision boundary evolving over 20 iterations.

Example of Supervised Learning classification
Example of Supervised Learning classification (gif by Author)

Regression:

Regression is a type of machine learning used to predict a continuous output variable based on one or more input variables.

Our code generates random data points with a linear trend, applies a linear regression model using stochastic gradient descent, and visualizes the evolving regression line over 10 iterations

Regression Example
Regression Example (gif by Author)

Unsupervised Learning:

In unsupervised learning, the model is given unlabeled data and must find patterns or structures within the data without any explicit instructions on what to look for.

Example: Clustering algorithms group similar data points together, in the example below, the code applies the K-means algorithm to cluster data points. The moving three red cross points are centroids of these clusters. The gif showing the clustering process over 10 iterations (steps).

Clustering Example
Unsupervised Learning: Example of clustering using K mean algorithm. (gif by Author)

Reinforcement Learning:

In reinforcement learning, the model learns by interacting with an environment and receiving feedback in the form of rewards or punishments. The model aims to maximize its cumulative reward by learning the best actions to take in different situations.

Example: A robot learns to navigate a maze by receiving rewards for reaching the end and penalties for hitting walls (as shown below).

Reenforcement Learning: Example of a robot (red dot) moving in maze whenever it hitting the wall it is becoming red. (gif by Author)

Each type of machine learning is used for different kinds of tasks and problems, depending on the nature of the data and the goals of the analysis.

Thats all for today πŸ˜„

See you next time πŸ€—