Predicting Housing Prices in Melbourne using Streamlit and Joblib
Turn Your Analysis into a Web App
I got really excited when I brought this model to life in a Streamlit app. With this app, users could easily input data, receiving real-time predictions for housing prices as a result.
I am going to make some web apps about urban planning. In the first step, I delve into Melbourne’s housing market trends. The aim was clear: to develop an interactive prediction tool that provides insights into housing prices.
Data Source
The invaluable dataset for this project hailed from Kaggle’s treasure trove. See it here.
Steps to Make the App
1. Data Preprocessing: It is easier to work with data in Jupyter Notebook! So in JN, I analysed the dataset and did preprocessing to address missing values and sculpt categorical variables into a form suitable for training.
2. Model Building: I used RandomForestRegressor to build a robust model. Then I evaluate it by Mean Squared Error. I saved the model by Joblib and I go to VSCode for the next steps.
3. Model Deployment and Streamlit Fusion: I loaded the model and made the UI of my project. ChatGPT is really helpful.
I integrated the model into a captivating Streamlit app. This interactive interface invited users to input feature values, showing instantaneous predictions for housing prices and showing the location.
**Experience the interactive app yourself: [Melbourne Housing Price Prediction App](https://melbourne-housing.streamlit.app/)**
4. Deployment!
This part is almost a piece of cake! Put your project on GitHub, then connect it to the Streamlit cloud.
## Challenges Faced: Version Compatibility!
Yet, no project is without its challenges. I forgot to upgrade my Scikit-learn package in Jupyter Notebook, that’s why I got stuck in later steps.
Before immigrating from JN to VSCode, be sure about the latest version of your packages. Also, I used a virtual environment to keep packages related to Streamlit enclosed.
Streamlit, while a powerful tool, presented some hurdles along the way. Customization and CSS styling turned out to be more intricate than expected. The concept of using element IDs for partial styling control brought its own set of complexities. Additionally, the server-side nature of Streamlit meant that any changes in the input data triggered a complete page rerun, causing occasional performance bottlenecks.
Advantages of Streamlit
Despite these challenges, Streamlit proved to be a game-changer. The speed at which I could develop and deploy the interactive app was truly remarkable. It simplified the process and allowed me to focus more on fine-tuning the model and enhancing user experience.
Project Impact
This project isn’t just about predictive algorithms and data; it’s about translating complexity into accessibility. The housing market can be an intricate realm to navigate, but with this app, users can gain a tangible understanding of how different factors influence prices. Whether you’re a prospective buyer, a real estate enthusiast, or an urban planner, the insights offered by this app hold value for everyone.
In Summary
Combining the power of Jupyter Notebook’s analytical prowess and VSCode’s deployment convenience, alongside the swiftness of Streamlit’s app development, has been an enlightening experience. This project marks the beginning of a series of urban planning projects, each aimed at unravelling the mysteries of our surroundings.
**Explore the project’s source code on my GitHub.
Further Projects:
I am thinking of air quality management. As I look ahead, I’m thrilled to do something for nature. The marriage of data science and urban planning holds the promise of insights that can shape the future of our cities.
Stay tuned for more exciting projects on the horizon. 😉