How to use validation dataset in my logistic regression model?
So generally, when you seperate your training data to 80%-20% then you fit method should get 2 x,y. better to call them x_train,y_train, x_val, y_val or something similar.
Now its important you do the split before entering the fit, and not do it for each epoch or something alike.
Once you do that and the fit method should be something like:
def fit(self, x_train, y_train, x_val, y_val, num_iter=10, mb_size=32, lr=1e-1, lambda_reg=1e-2, reset=True):

Then you should, at the end of each epoch, test the performance of the model on the validation set entirely and calculate the desired metric for evaluation. If you improved it's better to save the current model. This is done repeatedly for each epoch until the end of the training and you will guarantee to have the model who gave you the best results on the validation set rather than on the training set, which might be overfitting it.
I will do it in a separate method with the following flow:

iterate on each sample in the validation set
for each one calculate the loss/metric
append it to some list
return the mean of that list

And if the average result is better from some previously saved one, save the new model