Welcome to From Scratch!
This repository is dedicated to implementing a wide variety of algorithms across topics in Computer Science-including Machine Learning, Deep Learning, Data Science, Signal and Image Processing, Digital Logic, Optimisation Algorithms, Advanced Data Structures And Algorithms, Algebra, Physics and Mathematics, OS, Architecture And Organisation, Networking and Databases and more-without relying on major libraries. Our goal is to understand and code each algorithm from first principles, focusing on clarity, educational value, and hands-on learning.
- Learn by Doing: Deepen understanding by building algorithms from the ground up. Consider it as a challenge and code up your favourite algorithm from ground up using pure logic and minimal dependencies !!!!
- Improvise: If existing algorithms already exist in the repo feel free to improvise it.
- Minimal Dependencies: Avoid major libraries (like NumPy, scikit-learn, TensorFlow, etc.); use only basic language features and minimal standard libraries where necessary. ( Major languages like Python, C/C++ and Java are allowed )
- Usage Of Pre-Defined Libraries: One can use pre defined popular libraries to do accessory stuff like plotting or calculating complex equations but cannot use them for implementing the algorithm to be written from scratch
- Comprehensive Coverage: Tackle algorithms from ML, DL, signal processing, and other CS fields.
- Readable & Well-Documented: Ensure code is easy to follow, well-commented, and accompanied by explanations.
-
Fork the repository:
Click the "Fork" button at the top right of this page to create your own copy of the repository. -
Clone your forked repository:
git clone https://github.com/NirjharDebnath/From-Scratch.git`
-
Explore the folders:
Each topic contains standalone scripts for individual algorithms. -
Run the code:
Most scripts are self-contained and can be run directly with Python 3.x and Jupyter Notebooks:
python Linear Regression.py
- Read the explanations:
Each script contains comments and, where appropriate, markdown explanations to clarify the algorithm’s logic.
- Machine Learning: Linear Regression, Logistic Regression, K-NearestNeighbours, Decision Trees, Naive Bayes etc.
- Pseudo Random Number Generator: MT19337 or Mersenne Twister, etc.
- Deep Learning: ANN, etc.
We’re continuously adding new algorithms!
Contributions are welcome!
If you’d like to add a new algorithm or improve an existing one:
- Fork the repo and create your branch.
- Add your algorithm in the appropriate folder.
- Include clear comments and, if possible, a brief explanation.
- Submit a pull request!
This project is licensed under the MIT License.
By avoiding major libraries, we force ourselves to truly understand how each algorithm works under the hood. This is a great way to learn, teach, and demystify the magic behind modern software, data science, maths physics and core CS topics which are widely used.
Happy coding!
Questions or suggestions? Open an issue or start a discussion!
NOTE: This repo is still under development and needs more contributors to fix and improve the concept of doing algorithms from scratch. If the pull requests get delayed feel free to contact us.
An Initiative Taken By Student of Dept of CSE, Kalyani Government Engineering College
Repo first created on May, 2025 by Nirjhar Debnath, Student of Dept of CSE
