# Week 1 :Introduction to machine learning

Machine learning is a subset of Artificial Intelligence(AI) where we develop algorithms in such a way that enables learn from data and perform tasks based on that data without being explicitly programmed to do so like how chat bots aren’t explicitly programmed to give answers to each one of our question but it has been given data about all those fields and the model behind those chatbots uses that data to come up with those answers. Machine learning is used in recommender systems, chatbots, healthcare etc.

# Types of Machine learning

### **Based on required supervision machine learning is divided into 3 parts :**

* Supervised learning
    
* Unsupervised learning
    
* Reinforcement learning
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1746377535543/4f8f501f-1a10-414a-8251-d7405d6921c7.webp align="center")

## 1\. Supervised learning

When algorithm learns from labeled data where a input is connected to its correct output so that when another input is given the algorithm uses the previously provided data to come up with the output.

Supervised machine learning is used in spam detection, Time-series market forecasting, fraud detection, Internet of Things (IOT) management etc.

Supervised learning algorithms are divided into two parts:

1. Classification algorithms - where inputs are defined into different parts e.g. spam filtration etc.
    
2. Regression algorithms - where a numerical output is generated e.g. house price prediction, salary estimation.
    

## 2\. Unsupervised learning

When algorithm learns from unlabeled data then it is an example of unsupervised machine learning. Unsupervised learning is especially useful when you have a lack of labeled data. It doesn’t have a correct guidance to coming up with the output so it uses pattern recognition, correlation or clustering within the data to come up with the output.

Unsupervised learning is used for anomalies detection, customer segmentation, and building recommendation systems etc.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1746338659570/9009ab80-3286-4c76-a9bb-2b789dffcdf1.jpeg align="center")

## 3\. Reinforcement learning

Reinforcement learning is like learning how to drive you understand the basics and when you try to drive you do some mistakes and you learn from them and correct those mistakes for the future and this cycle continues until you learn how to drive. That is how Reinforcement learning works you create an algorithm you test it some mistakes come up and you train the model on the same and the cycle continues.

Reinforcement learning is majorly used in Autonomous driving, Robotics, and healthcare etc.

### **Based on how the model is trained :**

* Batch learning
    
* Online learning
    

### 1\. Batch learning

In production when you are getting more data or feedback on the model and you need to retrain the model you take all the data and retrain the model together in a batch this methodology is called batch learning.

* Since you are training the model together it is resource intensive.
    
* The model works statically here since the model is retrained after a time interval.
    
* Availability becomes an issue when the model getting retrained.
    

### 2\. Online learning

You would have used Youtube, there if you click on a cat video the youtube algorithm will start showing you cat videos or if you click on a dog video it will start showing you dog, the very moment you click on the video. It surely can’t happen if the model is getting trained after a time interval so if the model is getting trained on the servers than it is called online learning.

* It is faster than Batch learning
    
* It is effective where the concept drift comes very frequently like social media platform
    
* It is cost effective in nature since you don’t require special hardware to train the model with large sums of data together.
    
* It is Riskier compared to batch learning cause you can’t the data for how correct it is than the model getting trained on wrong data leads to wrong results
    

### **Based on how models learn :**

* Instance-based learning
    
* model-based learning
    

### 1.Instance-based learning

In this the model stores all the data and compares new point to existing point to come up with the output. It is also known as lazy learning.

### 2.Model-based learning

It uses the training data to come up with a generalized model to predicting the output.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1746381391193/2b7bdf3a-aba8-4b2a-846e-c31b7368d190.webp align="center")

## Challenges with machine learning

1. Data collection is the hardest part in training a model for a large project.
    
2. Insufficient data and non representative also becomes a very big challenge in the training of a model
    
3. Overfitting : when model is trained on the training data so closely that it cannot work properly on data other than that
    
4. Underfitting : when model is trained such that it bypasses the training data and gives a output that is not representative of the data given.
    
5. Integrating machine learning model into other software is a huge into using it in real world scenario.
