VibeBuilders.ai Logo
VibeBuilders.ai
Scratch Machine Learning Algorithms Implementations

Scratch Machine Learning Algorithms Implementations

ParkMountain
April 15, 2025
reddit

Hi there, other Redditors!

Like many of you, when I first started working in the AI field, I wanted to build some basic Machine Learning models from scratch in order to better understand how each algorithm works, improve my programming and math skills, or simply produce an eye-catching, difficult project to put in the résumé.

After spending some time searching for resources that could help me guide my studies, I discovered that the majority of scratch implementations that are currently available are either i) outdated (having been implemented years ago using Python 2 or an earlier version of Python 3); ii) too difficult to understand (using a lot of difficult, unfriendly optimization techniques or with poorly written code); or iii) too simple (only covering binary classification).

With that in mind, I made the decision to develop user-friendly, uncomplicated, organized, and simple implementations from scratch. Aside from all of that, I've always wanted to create an open-source project so that others, particularly novices and those with less than a year's experience (like me), can collaborate with others, contribute to public projects, and experience Git firsthand (some of these implementations were made by other contributors!).

Here are some implementations that are available:

  • Algorithms (Random Forest Classifier and Regressor, Decision Tree Classifier and Regressor, KMeans, KNN Classifier and Regressor, Gaussian Naive Bayes, Linear Regression, Logistic Regression, PCA, Perceptron, MLP Classifier and Regressor, SVM Classifier and Regressor);
  • Regression and classification metrics;
  • Distance metrics (such as Euclidean);
  • Data split functions (such as KFold);
  • Activation and loss functions;
  • Scalers (such as MinMaxScaler) and encoders (such as One Hot Encoder);
  • and a few things more!

Project's link: https://github.com/rafaelgreca/scratchml

Disclaimer: The goal of this library is to provide code that is simpler, easier to understand, and more approachable for artificial intelligence enthusiasts and beginners who want to contribute to an open-source repository or who want to learn more about how algorithms work. It is not meant to replace existing libraries that are better, more optimized, and have a wider variety of implemented algorithms (such as scikit-learn, PyTorch, Keras, and Tensorflow). If you want to use optimized implementations with accurate results, please use one of the previously mentioned libraries.

P.S.: I accidentally deleted the other post, so I am posting again. :-)

Vibe Score

LLM Vibe Score

0

Sentiment

Human Vibe Score

1

Rate this Resource

Join the VibeBuilders.ai Newsletter

The newsletter helps digital entrepreneurs how to harness AI to build your own assets for your funnel & ecosystem without bloating your subscription costs.

Start the free 5-day AI Captain's Command Line Bootcamp when you sign up:

By subscribing, you agree to our Privacy Policy and Terms of Service.