Scaler's Machine Learning Course
Scaler's Machine Learning Course
● Naive Bayes
● Random Forests
● Polynomial Regression
● Ridge Regression
● Lasso Regression
systems
● Credit scoring for financial
assessments
● Medical diagnosis to enhance
treatment accuracy
● Predicting customer churn in business
analytics
● Hierarchical Clustering
● DBSCAN
● Customer segmentation
● Recommendation systems
● Anomaly detection
3. Semi-Supervised Learning
Semi-supervised learning combines elements
of both supervised and unsupervised learning.
It utilizes a small amount of labeled data along
with a large amount of unlabeled data to train
models.
● Methods: Semi-supervised learning
● Co-training
● Graph-based methods
● Speech recognition
Take your understanding of machine learning
techniques to the next level with Scaler’s
Machine Learning course. Enroll now to
master the skills that will set you apart in the
field of artificial intelligence!
4. Reinforcement Learning
Reinforcement learning is a type of machine
learning where an agent learns to make
decisions by interacting with an environment
and receiving rewards or penalties based on its
actions. The goal is to learn a policy that
maximizes the cumulative reward over time.
● Types: Reinforcement learning involves
two main types of feedback:
● Positive Reinforcement: The agent
Conclusion
In conclusion, understanding the various types
of machine learning – supervised,
unsupervised, semi-supervised, and
reinforcement – is crucial for anyone
venturing into this dynamic field. Each type
offers unique strengths and applications,
catering to different data scenarios and
objectives.
Supervised learning excels in prediction and
classification tasks, while unsupervised
learning uncovers hidden patterns and
structures in unlabeled data. Semi-supervised
learning bridges the gap between the two,
leveraging both labeled and unlabeled data,
while reinforcement learning enables agents to
learn optimal actions through trial and error.
Overview
Supervised Machine Learning is the way in which a model is
trained with the help of labeled data, wherein the model
learns to map the input to a particular output.
Unsupervised Machine Learning is where a model is
presented with unlabeled data, and the model is made to
work on it without prior training and thus holds great
potential on real-world labelless datasets.
● Face detection/recognition.
● Weather forecasting.
● Spam Detection.
● Stock price prediction.
Working of Supervised Learning
Let us understand the working of supervised Machine
Learning with the help of an example:
You may tell them about the features and characteristics of it.
Such as a cat has whiskers and meows, a dog barks, etc. You
may show them what cats and dogs look like.
Next time, when you ask them to identify whether the animal
is a cat or a dog, and if the kid is able to identify it correctly,
this means you successfully taught them!
1. Regression.
2. Classification.
Regression is the kind of supervised learning that learns from
labeled data and predicts continuous-valued output
corresponding to a given input. Examples of such continuous
outputs may be height, amount of money, etc.
Classification is the kind of supervised learning that learns
from labeled data and is used to predict a particular class
corresponding to a given input. An example of an output
class can be 'cat' or 'dog' to classify if the given picture is of a
cat or a dog.
Regression
Regression is a type of Supervised Machine Learning that we
use to understand and map the statistical relationship
between the predictor and response variables. This is
generally useful with numerical data such as sales revenue
and temperature trends.
Classification
Classification is the type of Supervised Machine Learning
that we use to categorize our output into one of the defined
categories, such as 'spam' or 'not spam,' 'masked' or 'not
masked' etc.
● Recommendation Systems.
● Customer segmentation.
● DNA clustering.
Working of Unsupervised Learning:
Let us understand the working of unsupervised Machine
Learning with the help of an example:
1. Clustering.
2. Association.
Clustering or cluster analysis is used when we want to group
our dataset on the basis of inherent similarities in the data.
Clustering
Cluster analysis is the most common method used in
Unsupervised Learning. We tend to perform cluster analysis
on our dataset when we are working with unlabeled data,
wherein our model discovers patterns on its own without any
human intervention.
Introduction
What is Regression Analysis?
Regression analysis is a statistical method that helps us to
model the relationship between dependent variables and one
or more independent variables. This analysis helps us to
understand the change in the value of our target variable
corresponding to an independent variable when other
independent variables are held fixed. It predicts
continuous/real values such as salary, prices, temperature,
etc.
Types of regression in ML
where a is intercept, b is slope of the line and e is error term. This equation
can be used to predict the value of target variable based on given predictor
variable(s).This can be written much more concisely using a vectorized
●
● Here y is the actual value and y’ is the predicted value. Lets substitute the
value of y’:
●
● Now the above equation is minimized using the gradient descent algorithm
by partially differentiating it w.r.t m and c.
●
● Then finally we update the values of m and c as follow:
●
● Code: simple demonstration of Gradient Descent
● 1
● # Making the imports % matplotlib inline
● 2
● import pandas as pd
● 3
● import numpy as np
● 4
● import matplotlib as mpl
● 5
● import matplotlib.pyplot as plt
● 6
● X = np.arange(1, 7)
● 7
● Y = X**2
● 8
● plt.figure(figsize =(10, 10))
● 9
● plt.scatter(X, y, color ="yellow")
● 10
● plt.title('sample demonstration of gradient descent')
● 11
● plt.ylabel('squared value-y')
● 12
● plt.xlabel('linear value-x')
● Output:
●
scatter plot
● Code:
● 1
● m = 0
● 2
● c = 0
● 3
●
● 4
● L = 0.0001 # The learning Rate
● 5
● epochs = 1000 # The number of iterations to perform
gradient descent
● 6
●
● 7
● n = float(len(X)) # Number of elements in X
● 8
●
● 9
● # Performing Gradient Descent
● 10
● for i in range(epochs):
● 11
● # The current predicted value of Y
● 12
● Y_pred = m * X + c
● 13
● # Derivative wrt m
● 14
● D_m = (-2 / n) * sum(X * (Y - Y_pred))
● 15
● # Derivative wrt c
● 16
● D_c = (-2 / n) * sum(Y - Y_pred)
● 17
● # Update m
● 18
● m = m - L * D_m
● 19
● # Update c
● 20
● c = c - L * D_c
● 21
●
● 22
● print (m, c)
● Output:
● 4.471681318702568 0.6514172394787497
● Code:
● 1
● Y_pred = m * X + c
● 2
● plt.figure(figsize =(10, 10))
● 3
● plt.scatter(X, Y, color ="yellow")
● 4
● # regression line
● 5
● plt.plot([min(X), max(X)], [min(Y_pred), max(Y_pred)],
color ='red')
● 6
● plt.title('sample demonstration of gradient descent')
● 7
● plt.ylabel('squared value-y')
● 8
● plt.xlabel('linear value-x')
● 9
● plt.show()
● Output:
●
final result
email security.
are:
1. Logistic Regression
2. Decision Tree
3. Random Forest
5. Naive Bayes
Machine Learning
In Logistic regression is classification algorithm used to estimate discrete
features and event probability are linear. Logistic Regression used for
shaped curve that can take any real-valued number and map it
2. Decision Tree
Decision Trees are versatile and simple classification and regression
nodes. Decision trees are easy to understand and depict, making them
utility.
The algorithm used for both classification and regression tasks. They
Decision Tree
classification rules.
making the predictions. The top nodes in a tree are the most
critical variables.
3. Random Forest
Random forest are an ensemble learning techniques that combines
and bias.
Random Forest
hyperplane that best classifies data while increasing the margin. SVM
bioinformatics, among other fields. Its use cases span image recognition,
the hyperplane and the nearest data points from each class,
data.
3. Kernel Trick: One of the most powerful features of SVM is its use
5.Naive Bayes
Text categorization and spam filtering benefit from Bayes theorem-based
probabilities.
used to predict the class are independent of each other given the
effective in practice.
predictions.
unknown or non-standard.
Algorithms
The top 6 Machine Learning Algorithms for Classification are compared in
this table:
Support
K-
Decision Random Naive Vector
Feature Ne
Tree Forest Bayes Machines
(
(SVM)
Learning
(Bagging
model model model
model)
Categorical
Categorical or Categorical or
Output or Categorical Ca
Continuous Continuous
Continuous
Similar to
Decision Tree,
Assumes data
but assumes Assumes
is separable in Assum
that a feature
Assumptions Minimal a high- instan
combination of independenc
dimensional simila
models e
space
improves
accuracy
Slower than
Medium to Fast
Decision Tree
high, data
Training Time Fast due to Very fast
depending on fo
ensemble
kernel choice d
method
nature) model) s)
learning algorithm. Each algorithm has strengths and works for different
● Decision Trees and Random Forests for their versatility and ease
of use.
smaller datasets.
Conclusion
Classification methods from machine learning have transformed difficult
data analysis. For classification, this article examined the top six machine