Algorithms from scratch

Often companies ask to code different Algorithms from scratch as a part of their craft demo round.

The general steps are as follows:

  1. Get 3 things: The formula for the algorithm, the cost function, the derivatives to be used for gradient descent.

  2. Initialize the weights and bias.

  3. In the fit function set the loop to update the weights in each iteration as per the cost function optimization algorithm.

  4. Create a predict function to predict the values.

  5. Create a test dataset to test if your function works properly.

  6. Plot the results.

Last updated