CHP1 Introduction To Machine Learning
CHP1 Introduction To Machine Learning
Learning
Terminologies:
Regression: Shown as a scatter plot of stars and circles with a solid line
indicating the model’s ability to predict continuous outcomes.
Each type of machine learning has specific applications and methods for training
models to perform tasks based on input data.
Logistic Regression: Despite its name, it’s a classification method. It uses the
logistic function to model a binary dependent variable (an outcome that can
take only two values, like 0/1, Yes/No).
Polynomial Regression: Used when the data points are modeled better by an
nth degree polynomial instead of a straight line (as in Linear Regression).
The regression model is typically evaluated using metrics like Mean Absolute Error
(MAE), Mean Squared Error (MSE), Root Mean Squared Error (RMSE), and R-
squared (coefficient of determination) value.
The key idea behind clustering is that data points in the same group are more
similar to each other than to those in other groups. In simple words, the aim is to
segregate groups with similar traits and assign them into clusters.
K-Means Clustering: This algorithm partitions the input data into K distinct
clusters. The number of clusters (K) is user specified.
An association rule has two parts: an antecedent (if) and a consequent (then). An
example of an association rule could be “If a customer buys bread and butter, they
are likely to also buy milk.”
Support: This is the percentage of transactions in the dataset that contain all
items in the antecedent and consequent of the rule. It indicates how frequently
the rule occurs in the dataset.
Lift: This is the ratio of the observed support to that expected if the
antecedent and the consequent were independent. A lift value greater than 1
indicates that the antecedent and consequent are dependent on each other.
Decision Trees are a type of supervised machine learning algorithm that is mostly
used for classification, but can also be used for regression. They are called
decision trees because they make decisions by splitting data into subsets based
on feature values, which can be visualized as a tree structure.
The top of the tree starts with a single node, which splits into several branches.
Each branch represents a decision based on a feature’s value, leading to another
node or to a leaf node. Leaf nodes represent the output or decision (class label for
classification, numerical value for regression).
Key concepts in decision trees include:
Pruning: The process of removing the unwanted branches from the tree.
Parent and Child Node: A node gets divided into sub-nodes where the node is
called parent and sub-nodes are called child nodes.
Support Vectors: These are the data points that are closest to the hyperplane
and influence the position and orientation of the hyperplane. Using these
support vectors, we maximize the margin of the classifier.
Margin: This is a gap between the two lines on the closest class points. This is
calculated as the perpendicular distance from the line to support vectors or
closest points. If the margin is larger in between the classes, then it is
considered a good margin, a smaller margin is a bad margin.
Neurons: These are the basic units of a neural network. They take in one or
more inputs, apply a transformation function (often non-linear), and produce
an output.
Weights and Biases: These are the learnable parameters of a neural network.
The weights control the signal (or the strength of the connection) between two
neurons, and the biases allow you to shift the activation function to the left or
right.
Layers: A deep learning model consists of multiple layers that transform the
input data into a representation that can be used for the task at hand. Each
layer learns to extract a new feature from the input it receives.
Weights and Biases: These are the learnable parameters of a deep learning
model. The weights control the signal (or the strength of the connection)
Deep learning has been successfully applied to a variety of tasks including image
recognition, speech recognition, natural language processing, and many others.
Actions: What the agent can do. The choice of action depends on the policy.
Policy: The strategy that the agent employs to determine the next action
based on the current state.
Reward Function: A rule that returns a reward to the agent based on the action
it took. The agent’s objective is to learn to act in a way that maximizes the
reward.
Value Function: A prediction of future rewards. It’s the total amount of reward
the agent expects to accumulate over the future, starting from a state.
Classification
Weather Prediction
Biometric Attendance
Unsupervised Learning
Clustering
Applications:
2. Speech recognition:
3. Traffic Prediction
4. Product Recommendation
Self-Driving Cars, as depicted in the image, are one of the most exciting
applications of Machine Learning (ML). Machine Learning plays a significant role
in the functioning of these autonomous vehicles.
A prominent example of this technology is Tesla, a popular car manufacturing
company that is working on self-driving cars. Tesla uses unsupervised learning
methods to train their car models. These models are trained to detect people and
objects while driving, thereby enabling the cars to navigate safely and efficiently.
Gathering Data, as depicted in the image, is the first step of the Machine Learning
(ML) life cycle. The goal of this step is to identify and obtain all data related to
specific problems.
Data can be collected from various sources such as files, databases, the internet,
or mobile devices. It is one of the most important steps of the life cycle as the
quantity and quality of collected data will determine the efficiency of the output.
The more data there is, the more accurate the prediction will be.
This step includes tasks such as identifying various data sources, collecting data,
and integrating the data obtained from different sources. By performing these
tasks, we get a coherent set of data, also called a dataset, which will be used in
further steps.
1. Data Preparation
Data Preparation, as depicted in the image, is the second step of the Machine
Learning (ML) life cycle. After gathering data, it needs to be prepared for further
steps. This preparation involves putting all collected data together and
randomizing its order.
This step can be further divided into two processes: Data Exploration and Data
Pre-processing. Data Exploration is used to understand the nature of the data that
we have to work with. We need to understand the characteristics, format, and
quality of the data. A better understanding leads to an effective outcome. In this
phase, we find correlations, general trends, and outliers.
1. Data Wrangling
Data Wrangling, as depicted in the image, is a crucial step in the Machine Learning
(ML) life cycle. It involves cleaning and converting raw data into a format that is
usable for machine learning or statistical analysis.
This step is essential as it ensures the quality and reliability of data before it is
used for training models or making decisions. The process includes cleaning the
data to address quality issues, selecting relevant variables, and transforming the
data into a suitable format for analysis.
In real-world applications, collected data may have various issues such as missing
values, duplicate data, and invalid data. Noise is another common problem that
needs to be addressed during this stage. Various filtering techniques are
employed to clean the data and remove these issues because they can negatively
affect the quality of outcomes derived from the processed data.
1. Analyse Data
Data Analysis, as depicted in the image, is a crucial step in the Machine Learning
(ML) life cycle. Once the data is cleaned and prepared, it is passed on to the
analysis step. This step involves the selection of analytical techniques, building
models, and reviewing the results.
The aim of this step is to build an ML model that can analyze the data using
various analytical techniques and review the outcomes. It starts with the
determination of the type of problems where we select machine learning
techniques such as Classification, Regression, Cluster Analysis, Association etc.,
then build models using prepared data and evaluate these models.
Hence, in this step, we use machine learning algorithms to build models.
1. Deployment