I am comparing 4 algorithms (Logistic regression, random forest, xgboost and catboost), and I am choosing the best one based on recall.
My main problem is that everytime I am running the models, I am getting a different result for accuracy, recall, precision and F1 score. How to fix this? I have tried putting random_state=42
but I don't know if I placed it well.
Also, could someone check my code and tell me if they think it's ok? This is the link:
CodePudding user response:
Use :
import random
random.seed(42)