Sir, I want to point out one significant point about the saved model.pkl file.
In the utils.py file, we never returned the best model object itself, just the score.
And then in model_trainer.py we sort the best max score and then initialize a totally new model based on the name of the highest score model. And in the save_object we are actually saving the newly initialized model which is untrained.
|
best_model = models[best_model_name] |
What's strange is how it gave a prediction.
Mine didn't and I had to edit the code.
https://github.com/svkadhikary/student_perfomance/blob/45ba9818eb3ab7fb681da7c70d425ed0c70fc0a0/src/utils.py#L66
https://github.com/svkadhikary/student_perfomance/blob/45ba9818eb3ab7fb681da7c70d425ed0c70fc0a0/src/components/model_trainer.py#L100
Sir, I want to point out one significant point about the saved model.pkl file.
In the utils.py file, we never returned the best model object itself, just the score.
mlproject/src/utils.py
Line 50 in 6d24fc7
And then in model_trainer.py we sort the best max score and then initialize a totally new model based on the name of the highest score model. And in the save_object we are actually saving the newly initialized model which is untrained.
mlproject/src/components/model_trainer.py
Line 98 in 6d24fc7
What's strange is how it gave a prediction.
Mine didn't and I had to edit the code.
https://github.com/svkadhikary/student_perfomance/blob/45ba9818eb3ab7fb681da7c70d425ed0c70fc0a0/src/utils.py#L66
https://github.com/svkadhikary/student_perfomance/blob/45ba9818eb3ab7fb681da7c70d425ed0c70fc0a0/src/components/model_trainer.py#L100