Open aedavids opened 2 months ago
We will need the data to understand what is the reason but I suspect that the issue is linked to random tie breaking.
Please also provide a short code snippet that we can copy&paste to reproduce the problem. From reading your original comment it sounds like you are using more than just a RandomForestClassifier
. Having a full snippet from start to finish makes sure we are all debugging the same thing.
Hi All
I am in the process of creating test code I can post. I have narrowed it down a bit. The problem happens in my jupyter notebook. If I run the predict cell multiple times I get the same results. If I restart the notebook I will get different results from the first run
I wrote a small py script. I can not reproduce the error when I run from the terminal.
I going to try and and figure out how I can isolate the problem in my Notebook. I will post the test notebook
Hopefully I can upload a zip file with the test code and my trained model
Kind regards
Andy
Describe the bug
If I load my pre trained model and set of samples and call predict() multiple times I get different predicted classes. Here are some sample results. I am using a juypter notebook. I have tried restarting the kernal multiple times and also just re-running the cell multiple times
I have a random forest I trained with the following parameters
The model was save using joblib. I load the model as follows
I make predictions as follow
I have tried setting calling random.seed()
Any suggestions would be greatly apreciated.
p.s. When I trained I save the label encoder and load as follows. (This was to insure the class number match the class names)
I can make my trained model avaliable
Steps/Code to Reproduce
predictions = model.predict(XNP)
yProbability = model.predict_proba(XNP)
Expected Results
predict(X) == predict(X)
Actual Results
Versions