We must acknowledge the fact that being able to write a machine learning algorithm from scratch is a certain rewarding learning experience. The moment it finally clicks, and you get the hold of understanding what is really going on, it fills you with a rush of adrenaline. Of course, it goes without saying that implementing a machine learning algorithm in code can equip you with quite a lot of information and knowledge about the algorithm along with its functioning.
Well, particularly in the field of machine learning, it is always considered a good idea to follow predefined steps in order to get the desired results. Some of the algorithms are comparatively more complicated than others; you should start with simple algorithms such as the single-layer perceptron.