A Python library called ScratchML was created to build the most fundamental Machine Learning models from scratch (using only Numpy), emphasizing producing user-friendly, straightforward, and easy-to-use implementations for novices and enthusiasts.
The Perceptron model currently assumes that labels are already in a binary format of 0 and 1. However, if labels are provided in a different binary format, such as -1 and 1 (common in many datasets), the model raises an error or behaves unexpectedly.
A suggested solution would be to map any binary labels to 0 and 1 before training the Perceptron model. This adjustment can be made in the perceptron.py script within the models directory, in the following part of the code:
The Perceptron model currently assumes that labels are already in a binary format of 0 and 1. However, if labels are provided in a different binary format, such as -1 and 1 (common in many datasets), the model raises an error or behaves unexpectedly.
A suggested solution would be to map any binary labels to 0 and 1 before training the Perceptron model. This adjustment can be made in the perceptron.py script within the models directory, in the following part of the code:
if len(self.classes_) == 2:
Map the unique classes to 0 and 1