Use Minimal Required Imports Only When Building Apps!

Hi Daniel, I understand your confusion. Initially, I had only added snippets of model development and left the detailed code in the linked GitHub repository. Taking your feedback, I added the imports to the first snippet. Thanks!

However, I made no changes to the Streamlit code since it's best to use minimal required import statements for a better response time. The .predict() is a popular method of the scikit-learn model object. Since we load a scikit-learn Random Forest model for inference, we can use the .predict() method to get predictions just like that! I've tested the code and deployed it; please have a look.

Code -

Live App -

I hope this helped. Thank you for your feedback; I genuinely appreciate it!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store