SlideShare a Scribd company logo
Classificationand different algorithm
Classification
Algorithms
Dataset
Model
#importing dataset
#importing data
#encoding
#define X & Y
# Split train & test
#Fit Model
#Confusion Matrix
Confusion Matrix
Precision
Recall
Accuracy
F1 Score
4
51
2
12 Samples
Precision is the ratio of
correctly predicted positive
observations to the total
predicted positive
observations.
Recall is the ratio of
correctly predicted
positive observations to
the all observations in
actual class
F1 Score is the weighted average of Precision and Recall
Classificationand different algorithm
Classificationand different algorithm
Confusion Matrix
Classificationand different algorithm
Un-supervised Learning
Unsupervised learning machine learning
Classificationand different algorithm
Clustering
Clustering
Clustering
Clustering is a very simple algorithm which clusters the data into a number of clusters. The above image
from PyPR is an example of Clustering.
As the examples are unlabeled, clustering relies on unsupervised machine learning. If the examples are labeled,
then clustering becomes classification.
Applications of Clustering in different fields
1.Inertia: It is the sum of squared distances of samples to their closest cluster center.
•# Number of clusters
•k = 3
•# X coordinates of random centroids
•C_x = np.random.randint(0, np.max(X)-20, size=k)
•# Y coordinates of random centroids
•C_y = np.random.randint(0, np.max(X)-20, size=k)
•C = np.array(list(zip(C_x, C_y)), dtype=np.float32)
•print("Initial Centroids")
•print(C)
•# Plotting along with the Centroids
•plt.scatter(f1, f2, c='#050505', s=7)
•plt.scatter(C_x, C_y, marker='*', s=200, c='g')
Code from Scratch
# To store the value of centroids when it updates
C_old = np.zeros(C.shape)
# Cluster Lables(0, 1, 2)
clusters = np.zeros(len(X))
# Error func. - Distance between new centroids and old centroids
error = dist(C, C_old, None)
# Loop will run till the error becomes zero
while error != 0:
# Assigning each value to its closest cluster
for i in range(len(X)):
distances = dist(X[i], C)
cluster = np.argmin(distances)
clusters[i] = cluster
# Storing the old centroid values
C_old = deepcopy(C)
# Finding the new centroids by taking the average value
for i in range(k):
points = [X[j] for j in range(len(X)) if clusters[j] == i]
C[i] = np.mean(points, axis=0)
error = dist(C, C_old, None)
K-Means Algorithm
K-Means Algorithm
K-Means Algorithm
K-Means Algorithm
K-Means Algorithm
K-Means Algorithm
Other Clustering Algorithms
Code: Linear regression
# Importing the dataset
# Getting the values and plotting it
Code: Linear regression
# Number of clusters
# Fitting the input data
# Getting the cluster labels
# Centroid values
Code: Linear regression
#no. of clusters
#plotting the clusters
#plotting the centroids
Classificationand different algorithm

More Related Content

PPTX
08-09 Chapter numerical integration
PDF
Two-Way MIMO Decode-and-Forward Relaying Systems with Tensor Space-Time Coding
PDF
Fast coputation of Phi(x) inverse
PPTX
Fuzzy image processing- fuzzy C-mean clustering
PPTX
Pointers
PPTX
Presentation of c 1
PDF
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
PPT
Pointer
08-09 Chapter numerical integration
Two-Way MIMO Decode-and-Forward Relaying Systems with Tensor Space-Time Coding
Fast coputation of Phi(x) inverse
Fuzzy image processing- fuzzy C-mean clustering
Pointers
Presentation of c 1
Numerical Method Analysis: Algebraic and Transcendental Equations (Non-Linear)
Pointer

What's hot (20)

PPTX
APPLICATION OF NUMERICAL METHODS IN SMALL SIZE
PPTX
Lectue five
PPT
Calculus Sections 4.1 and 4.3
PPT
Dynamic allocation
PDF
Iteration method-Solution of algebraic and Transcendental Equations.
PDF
Algorithm of some numerical /computational methods
PPT
16 subroutine
PDF
Group p1
 
PDF
Matlab integration
PPTX
Programming Assignment Help
PPTX
Bisection method
PPTX
Aplicaciones de la derivada
PPT
Math Functions in C Scanf Printf
PDF
Matlab 3
 
PPTX
Aplicaciones de la derivada
PPT
Lesson 4.1 Extreme Values
PPT
Bisection method in maths 4
PPT
14 arrays
PDF
Redo midterm
 
APPLICATION OF NUMERICAL METHODS IN SMALL SIZE
Lectue five
Calculus Sections 4.1 and 4.3
Dynamic allocation
Iteration method-Solution of algebraic and Transcendental Equations.
Algorithm of some numerical /computational methods
16 subroutine
Group p1
 
Matlab integration
Programming Assignment Help
Bisection method
Aplicaciones de la derivada
Math Functions in C Scanf Printf
Matlab 3
 
Aplicaciones de la derivada
Lesson 4.1 Extreme Values
Bisection method in maths 4
14 arrays
Redo midterm
 
Ad

Similar to Classificationand different algorithm (20)

PDF
cluster(python)
PPTX
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
PDF
DCSM report2
PDF
Machine Learning: Classification Concepts (Part 1)
PPT
Lect4
PPTX
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
PDF
Implementation of K-Nearest Neighbor Algorithm
PDF
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
PDF
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
PDF
Machine Learning Algorithms Introduction.pdf
PPTX
PDF
Machine Learning with Python- Machine Learning Algorithms- K-Means Clustering...
PPTX
Unsupervised learning clustering
PPTX
Project PPT
PPTX
Deep learning from mashine learning AI..
PPTX
K means clustering algorithm
PPTX
Knn 160904075605-converted
PDF
Introduction to Big Data Science
PDF
Introduction to data mining and machine learning
PPTX
K-Means clustering and its working .pptx
cluster(python)
ANLY 501 Lab 7 Presentation Group 8 slide.pptx
DCSM report2
Machine Learning: Classification Concepts (Part 1)
Lect4
CST413 KTU S7 CSE Machine Learning Clustering K Means Hierarchical Agglomerat...
Implementation of K-Nearest Neighbor Algorithm
MLT Unit4.pdfgmgkgmflbmrfmbrfmbfrmbofl;mb;lf
MLT Unit4.pdffdhngnrfgrgrfflmbpmpphfhbomf
Machine Learning Algorithms Introduction.pdf
Machine Learning with Python- Machine Learning Algorithms- K-Means Clustering...
Unsupervised learning clustering
Project PPT
Deep learning from mashine learning AI..
K means clustering algorithm
Knn 160904075605-converted
Introduction to Big Data Science
Introduction to data mining and machine learning
K-Means clustering and its working .pptx
Ad

More from SuyashSingh70 (6)

PPTX
Introduction to ml and dl
PPTX
Introduction to ml
PPTX
How to clear a job interview
PPTX
Personality development
PPT
Sucess in interview
PPTX
Regression ppt
Introduction to ml and dl
Introduction to ml
How to clear a job interview
Personality development
Sucess in interview
Regression ppt

Recently uploaded (20)

PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
PPTX
Computer network topology notes for revision
PDF
Lecture1 pattern recognition............
PPTX
Business Acumen Training GuidePresentation.pptx
PDF
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PDF
Galatica Smart Energy Infrastructure Startup Pitch Deck
PPT
ISS -ESG Data flows What is ESG and HowHow
PPTX
Acceptance and paychological effects of mandatory extra coach I classes.pptx
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
PPTX
Qualitative Qantitative and Mixed Methods.pptx
PDF
annual-report-2024-2025 original latest.
PPTX
1_Introduction to advance data techniques.pptx
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
PPTX
Introduction to machine learning and Linear Models
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
ALIMENTARY AND BILIARY CONDITIONS 3-1.pptx
Computer network topology notes for revision
Lecture1 pattern recognition............
Business Acumen Training GuidePresentation.pptx
Recruitment and Placement PPT.pdfbjfibjdfbjfobj
Business Ppt On Nestle.pptx huunnnhhgfvu
Galatica Smart Energy Infrastructure Startup Pitch Deck
ISS -ESG Data flows What is ESG and HowHow
Acceptance and paychological effects of mandatory extra coach I classes.pptx
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
Microsoft-Fabric-Unifying-Analytics-for-the-Modern-Enterprise Solution.pptx
Qualitative Qantitative and Mixed Methods.pptx
annual-report-2024-2025 original latest.
1_Introduction to advance data techniques.pptx
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Introduction to machine learning and Linear Models

Classificationand different algorithm