Skip to content

thakursneha430/perceptron_algo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

20 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€–perceptron-algorithm-scratch

The Perceptron Algorithm From Scratch 🧠 is a beginner-friendly machine learning project that demonstrates how a simple neural network can learn to classify data without using high-level ML libraries like scikit-learn. In this project: 🐍 Implemented the Perceptron algorithm using Python and NumPy πŸ“Š Trained the model on a small binary classification dataset πŸ€– Predicts class labels (0 or 1) for new data points 🎨 Includes visualization of the decision boundary using Matplotlib

image

Overview

This project implements the Perceptron algorithm from scratch using Python without relying on high-level machine learning libraries.The goal of this project is to understand how a basic neural network learns to classify data.The Perceptron is one of the earliest machine learning algorithms and forms the foundation of modern neural networks.The perceptron was introduced by Frank Rosenblatt (1957).It is a simple supervised learning algorithm used for binary classification problems.The model learns by adjusting weights and bias to correctly separate two classes of data using a decision boundary.

image

Project Structure

perceptron-from-scratch/
│── data/
β”‚   └── dataset.csv
│── src/
β”‚   └── perceptron.py
│── train.py
│── README.md

Output

After training the model:

  • Predictions are printed in the terminal
  • A visualization graph is generated showing:
    • Data points
    • Decision boundary learned by the perceptron
output

How the Algorithm Works

  1. Initialize weights and bias
  2. Compute the linear combination of inputs and weights
  3. Apply the activation function
  4. Predict the class label
  5. Update weights if prediction is incorrect

Technologies Used

  • Python
  • NumPy
  • Pandas
  • Matplotlib

Learning Outcome

This project helps understand:

  • Basics of neural networks

About

πŸ€– Perceptron: a simple algorithm that learns to classify data by updating weights based on mistakes πŸ“ˆ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages