Hello everyone,
This is my first attempt with Streamlit; I’m trying to build an interactive salary prediction web app.
The Streamlit app provides different predictions in comparison with Jupyter Notebook. Have you got any idea why this issue occurred?
I have this exact same issue @Isaak_Karagiannidis, did you figure it out? It was also giving me different predictions on my running the streamline app on local machine vs. on the web. So, my local machine and Jupyter Notebook were the same, but the web app was different. It also happened seemingly randomly, all three were the same and then the web app changed (giving different accuracy percentage for the prediction model, and also giving different predictions than Jupypter and local machine)
Hello Mariana,
My problem was the different order of the features for transformation (encoding) in the Jupyter and VS Code. When I put them in the same order the predictions are still the same. In case you are using encoders for transformation check the order of the features.
Great. When writing Jupyter notebooks, it’s always a good idea to be aware of execution order and ensuring you wrap state mutators in functions, so that when you convert to a script (to run in Streamlit, for example), the correct execution order is preserved.
Thank you for your reply @Isaak_Karagiannidis! I had looked at that issue for mine, but that didn’t solve it. Just to help anyone out there who may be struggling with this issue: What caused my problem: changing the csv dataset I trained and pickled my model on by 2 rows on the Github repository attached to the project and also on my local machine, but not changing the .pkl file on GitHub after that fact.
I’m still pretty new to git and GitHub in general, so I believe I was getting different predictions and r2 values and predictions because the .pkl file in GitHub was still the original .pkl file before I changed the csv.
After I pushed the entire project again to a new repository the r^2 and prediction values in Jupyter, local machine, and app were all the same.
Thank you!
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.