Webify Your Data Driven Projects! Part 2

Vedanth V Baliga
2 min readMar 12, 2021

Overview

In this part of our Webify Your Data Driven Projects we are going to create a simple structure for our application.

In the next few parts of our series, we will be building and deploying an application that can predict Diamond Prices based on various input features.(App preview in the cover photo!)

If you haven’t read the first blog, Click here.

Building a Simple Structure for our Webpage!

Skeleton For Our Webpage

The first thing we have done is imported Streamlit using

import streamlit as st

Then we are going to create four sections for our application that are going to describe the various steps of our Project Pipeline. beta_container() is the function of Streamlit that is used to create sections or containers in our page.

The five main components of our page are:

  • Site Header
  • Data Sources
  • Data Exploration
  • Model Training
  • Linear Regression

In the model Training section we are going to predict the price using the Random Forest model and in the Linear Regression section we are going to perform the same prediction using the Linear Regression model.

Adding headers and text to our containers!

To add header text in your streamlit application, we are going to use the st.header() function of Streamlit and to add a description to each of the containers/sections we are going to use the st.write() function.

As you may have already noticed, the functions in Streamlit are self explanatory and we can include tons of features in our applications with very few lines of code.

In the above code snippet, I have clearly described what each of the sections contain using the header and write functions of Streamlit.

Once you have completed this step, run this command to run your application

streamlit run structure.py

Note: Please replace the file name with your file name!

If everything runs smoothly your application should look like this:

Final Application!

That’s all for this part folks!

Feel free to drop a comment if you face any difficulties in or find the solution in the Discussion Forum

That’s all for now folks! Hope you liked the blog post!

Stay tuned for further parts of the Webify Your Data Driven Project! series.

Do check out my other posts as well and connect with me on LinkedIn!

--

--

Vedanth V Baliga

Hello World! My name is Vedanth and I am a Computer Science undergrad who loves tech!