Skip to content

ragav-47/MULTI-CLASS-CLASSIFICATION

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

EX NO:03

DATE: 11.04.2022

MULTI-CLASS-CLASSIFICATION

AIM:

To write a python program to implement the multi class classification algorithm .

EQUIPMENTS REQUIRED:

  1. Hardware – PCs
  2. Anaconda – Python 3.7 Installation / Moodle-Code Runner / Google Colab

RELATED THEORITICAL CONCEPT:

In multi-class classification, the neural network has the same number of output nodes as the number of classes. Each output node belongs to some class and outputs a score for that class. Class is a category for example Predicting animal class from an animal image is an example of multi-class classification, where each animal can belong to only one category.

ALGORITHM:

  1. Import the necessary modules.
  2. Frame the dataset using make_blobs.
  3. Assign the counter value using the Counter function.
  4. Using a for loop, plot the points using scatter function.

PROGRAM:

Program to implement the multi class classifier.
Developed by   : VIJAYARAGAVAN ARR
Register Number : 212220230059
from numpy import where
from collections import Counter
from sklearn.datasets import make_blobs
from matplotlib import pyplot
X,y=make_blobs(n_samples=1000,centers=3,random_state=1)
print(X.shape,y.shape)
counter=Counter(y)
print(counter)
for i in range(10):
    print(X[i],y[i])
for label,_ in counter.items():
    row_ix=where(y==label)[0]
    pyplot.scatter(X[row_ix,0],X[row_ix,1],label=str(label))
pyplot.legend()
pyplot.show()

OUTPUT:

output

RESULT:

Thus the python program to implement the multi class classification was implemented successfully.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published