0% found this document useful (0 votes)
16 views35 pages

ML Types

The document provides an overview of machine learning, detailing its types: supervised, unsupervised, and reinforcement learning. It explains supervised learning's reliance on labeled data for predictions, unsupervised learning's ability to identify patterns without labels, and reinforcement learning's focus on decision-making through trial and error. Additionally, it highlights practical applications across various industries and introduces Python as a preferred language for machine learning due to its rich library support and community resources.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views35 pages

ML Types

The document provides an overview of machine learning, detailing its types: supervised, unsupervised, and reinforcement learning. It explains supervised learning's reliance on labeled data for predictions, unsupervised learning's ability to identify patterns without labels, and reinforcement learning's focus on decision-making through trial and error. Additionally, it highlights practical applications across various industries and introduces Python as a preferred language for machine learning due to its rich library support and community resources.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Types of Machine Learning

• Machine Learning (ML) is a subfield of Artificial Intelligence (AI) that focuses on building
algorithms and models that enable computers to learn from data and improve with
experience without explicit programming for every task. In simple words, Machine
Learning teaches systems to learn patterns and make decisions like humans by
analyzing and learning from data.
• There are several types of machine learning, each with special
characteristics and applications. Some of the main types of machine
learning algorithms are as follows:
• Supervised Machine Learning
• Unsupervised Machine Learning
• Reinforcement Learning
• 1. Supervised Machine Learning
• Supervised learning is a type of machine learning where a model
learns from labelled data—meaning every input has a corresponding
correct output.
• The model makes predictions and compares them with the true
outputs, adjusting itself to reduce errors and improve accuracy over
time.
• The goal is to make accurate predictions on new, unseen data.
• For example, a model trained on images of handwritten digits can
recognise new digits it has never seen before.

• Types of Supervised Learning in Machine Learning
• Now, Supervised learning can be applied to two main types of
problems:
• Classification: Where the output is a categorical variable (e.g., spam
vs. non-spam emails, yes vs. no).
• Regression: Where the output is a continuous variable (e.g.,
predicting house prices, stock prices).
• While training the model, data is usually split in the ratio of 80:20 i.e.
80% as training data and the rest as testing data.
• In training data, we feed input as well as output for 80% of data. The
model learns from training data only.
• We use different supervised learning algorithms (which we will
discuss in detail in the next section) to build our model.
• Let's first understand the classification and regression data through
the table below:

• Both the above figures have labelled data set as follows:
• Figure A: It is a dataset of a shopping store that is useful in predicting
whether a customer will purchase a particular product under consideration
or not based on his/her gender, age and salary.
• Input: Gender, Age, Salary
• Output: Purchased i.e. 0 or 1; 1 means yes the customer will purchase and
0 means that the customer won't purchase it.
• Figure B: It is a Meteorological dataset that serves the purpose of
predicting wind speed based on different parameters.
• Input: Dew Point, Temperature, Pressure, Relative Humidity, Wind Direction
• Output: Wind Speed
Working of Supervised Machine Learning
• The working of supervised machine learning follows these key steps:
• 1. Collect Labeled Data
• Gather a dataset where each input has a known correct output (label).
• Example: Images of handwritten digits with their actual numbers as labels.
• 2. Split the Dataset
• Divide the data into training data (about 80%) and testing data (about 20%).
• The model will learn from the training data and be evaluated on the testing data.
• 3. Train the Model
• Feed the training data (inputs and their labels) to a suitable supervised learning algorithm (like Decision Trees,
SVM or Linear Regression).
• The model tries to find patterns that map inputs to correct outputs.
• 4. Validate and Test the Model
• Evaluate the model using testing data it has never seen before.
• The model predicts outputs and these predictions are compared with the actual labels to calculate accuracy or
error.
• 5. Deploy and Predict on New Data
• Once the model performs well, it can be used to predict outputs for completely new, unseen data.

• Practical Examples of Supervised learning
• Few practical examples of supervised machine learning across various industries:
• Fraud Detection in Banking: Utilizes supervised learning algorithms on historical
transaction data, training models with labeled datasets of legitimate and
fraudulent transactions to accurately predict fraud patterns.
• Parkinson Disease Prediction: Parkinson’s disease is a progressive disorder that
affects the nervous system and the parts of the body controlled by the nerves.
• Customer Churn Prediction: Uses supervised learning techniques to analyze
historical customer data, identifying features associated with churn rates to
predict customer retention effectively.
• Cancer cell classification: Implements supervised learning for cancer cells based
on their features and identifying them if they are ‘malignant’ or ‘benign.
• Stock Price Prediction: Applies supervised learning to predict a signal that
indicates whether buying a particular stock will be helpful or not.

Unsupervised Machine Learning

• Unsupervised Learning is a type of machine learning where the model works


without labelled data. It learns patterns on its own by grouping similar data
points or finding hidden structures without any human intervention.
• It is used for tasks like clustering, dimensionality reduction and Association Rule
Learning.
• Helps identify hidden patterns in data
• Useful for grouping, compression and anomaly detection


• The image shows set of animals like elephants, camels and cows that
represents raw data that the unsupervised learning algorithm will
process.
• The "Interpretation" stage signifies that the algorithm doesn't have
predefined labels or categories for the data. It needs to figure out
how to group or organize the data based on inherent patterns.
• An algorithm represents unsupervised learning process that helps to
identify patterns in the data.
• The processing stage shows the algorithm working on the data.
• The output shows the results of the unsupervised learning process.
In this case, the algorithm might have grouped the animals into
clusters based on their species (elephants, camels, cows).
Unsupervised Learning Algorithms
• Clustering Algorithms

• Clustering is an unsupervised machine learning technique that groups unlabeled data into
clusters based on similarity. Its goal is to discover patterns or relationships within the data
without any prior knowledge of categories or labels.
• Groups data points that share similar features or characteristics.
• Helps find natural groupings in raw, unclassified data.
• Commonly used for customer segmentation, anomaly detection and data organization.
• Works purely from the input data without any output labels.
• Enables understanding of data structure for further analysis or decision-making.


• 2. Dimensionality Reduction
• Dimensionality reduction is the process of decreasing the number of
features or variables in a dataset while retaining as much of the
original information as possible.
• This technique helps simplify complex data making it easier to
analyze and visualize.
• It also improves the efficiency and performance of machine learning
algorithms by reducing noise and computational cost.
• If a Supervised Machine Learning Algorithm is the student that is spoon-
fed all the information by the teacher, then the Unsupervised Machine
Learning Algorithm is the genius student that does not need much
instruction and can learn information by himself.
• This student is not restricted by being taught only a specific thing, but he
learns from whatever comes his/her way by exploring and understanding
the information.
• So this student is good in many types of situations as he can tackle
problems when they arise.
• This is also the situation with an Unsupervised Machine Learning
Algorithm. Here, the algorithm is left unsupervised to find the underlying
structure in the data in order to learn more and more about the new
situation.
Reinforcement Learning

• Reinforcement Learning (RL) is a branch of machine learning that


focuses on how agents can learn to make decisions through trial and
error to maximize cumulative rewards. RL allows machines to learn
by interacting with an environment and receiving feedback based on
their actions. This feedback comes in the form of rewards or
penalties.

• Reinforcement Learning revolves around the idea that an agent (the
learner or decision-maker) interacts with an environment to achieve
a goal. The agent performs actions and receives feedback to optimize
its decision-making over time.
• Agent: The decision-maker that performs actions.
• Environment: The world or system in which the agent operates.
• State: The situation or condition the agent is currently in.
• Action: The possible moves or decisions the agent can make.
• Reward: The feedback or result from the environment based on the
agent’s action.

Applications of Machine Learning

• 1. Healthcare and Medical Diagnosis


• ML algorithms can analyze large volumes of patient data, medical scans and
genetic information to aid in diagnosis and treatment.
• Applications:
• Disease Detection: ML models are used to identify diseases like cancer,
pneumonia and Parkinson’s from medical images. They often achieve accuracy
comparable to or better than human doctors.
• Predictive Analytics: By analyzing patient history and symptoms, models can
predict the risk of certain diseases or potential complications.
• Drug Discovery: ML accelerates the drug development process by predicting how
different compounds will interact, reducing the time and cost of research.

1. Machine Learning in Healthcare
2. Machine Learning in Finance
3. Machine Learning in Marketing and
Advertising
4. Machine Learning in Autonomous Vehicles
5. Machine Learning in Retail
6. Machine Learning in Education
Introduction to Python for ML
• Python language is widely used in machine learning because it provides libraries like Numpy,Pandas,Scikit-learn,
TensorFlow and Keras.
• These libraries offers tools and functions essential for data manipulation ,analysis and building machine
learning models.
• Why Python For Machine Learning?
• Python has emerged as the preferred language for machine learning (ML) for several compelling reasons:
• 1. Simple and Easy to Learn
• Python has a clean and readable syntax. This makes it easy for beginners and professionals to write ML
programs quickly.
• 2. Rich Library Support
• Python has powerful libraries specially made for Machine Learning and Data Science:
• NumPy – for numerical computations
• Pandas – for data handling and analysis
• Matplotlib & Seaborn – for data visualization
• Scikit-learn – for ML algorithms
• TensorFlow & PyTorch – for deep learning
• These libraries save a lot of development time.
• 3. Strong Community Support
• Python has a very large global community. You can easily find
tutorials, forums, documentation, and ready-made solutions.
• 4. Platform Independent
• Python works on Windows, Linux, and macOS, making it easy to run
ML programs anywhere.
• 5. Integration with Other Technologies
• Python can be easily integrated with:
• Big Data tools (Hadoop, Spark)
• Web frameworks (Flask, Django)
• Cloud platforms (AWS, Google Cloud, Azure)
• 1. NumPy(Numerical python)
• NumPy is a fundamental numerical computing library in Python that
provides support for large, multi-dimensional arrays and matrices,
along with a comprehensive collection of mathematical functions. In
machine learning, NumPy is primarily used for handling numerical
data, performing vectorized operations and implementing low-level
mathematical computations efficiently.
• Used for numerical feature representation and transformation
• Enables fast mathematical operations through vectorization
• Serves as the computational backbone for many ML libraries
• Efficient memory management for large datasets
py –m pip install numpy
py –m pip install pandas
• Import numpy as np
• Arr=[Link]([1,2,3,4,5])
• Print(“Array:”,arr)
• Print(“Mean:”,[Link](arr))
• 2. Pandas

• Pandas is a high-level data analysis and manipulation library built on top of NumPy.
• It introduces useful data structures such as DataFrame , which allow machine learning practitioners
to clean, transform and analyze structured data efficiently before feeding it into models.
• Used for data cleaning, transformation and preparation
• Handles missing, inconsistent and categorical data
• Simplifies exploratory data analysis
• Import pandas as pd
Data={‘Names’:[‘Diksha’,’Praful’,’Pranali’],
‘Age’:[25,37,40],
‘score’;[80,95,85]
}
df=[Link](Data)
Print(df)
Print(“Names:\n”,df[‘Name’])
Print(“Age>28:\n,df[df[‘Age’] >28])
3. Matplotlib
• Matplotlib is a powerful and versatile open-source plotting library for
Python, designed to help users visualize data in a variety of formats.
• it enables users to graphically represent data, facilitating easier
analysis and understanding.
• If you want to convert your boring data into interactive plots and
graphs, Matplotlib is the tool for you
• Matplotlib is a comprehensive data visualization library used to
create static and interactive plots.
• In machine learning, it plays a critical role in understanding data
distributions, detecting patterns and interpreting model performance
through graphical representations.

• import [Link] as plt
• x = [0, 1, 2, 3, 4]
• y = [0, 1, 4, 9, 16]
• [Link](x, y)
• [Link]()

pyplot → a module inside matplotlib used for plotting graphs


• Scikit-learn is an open-source machine learning library that provides
simple and efficient tools for data analysis and modeling. It is built
on NumPy, SciPy, and Matplotlib, making it a powerful tool for tasks
like classification, regression, clustering, and dimensionality
reduction.

You might also like