Skip to content

Saved model.pkl file is not trained #3

@svkadhikary

Description

@svkadhikary

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.

return report

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions