Streamlit is an open-source Python library that makes it easy to create and share beautiful, custom web apps for machine learning and data science. We able to deploy our Streamlit app from Google’s Colab, source code link is at the bottom of page. Here are the steps to deploy:
Step 1:
install streamlit and pyngrok
Step 2:
write the code and save it to current instance file using%%writefile
import streamlit and pickle,then load the pkl file
In prediction function, a lot of if else statement will be used for translating actual meaning into number which we used to train in dataset previously.
In main function, the application interface is constructed and few components used such as slider, select box and button
Step 3:
use the basic linux command to run streamlit
Step 4:
using pyngrok and passing in the port from streamlit to create Ngrok tunnel
Then, click on http://189510e12043.ngrok.io , it direct to the streamlit apps.
In this apps, you can select :
aircraft version between 1 to 132 version
service type either passenger service, freighter or others.
leg sequence number between 1 to 3
fly duration either less than 5 hours, 5 to 10 hours or more than 10 hours
is the destination of flight is Southeast Asia
have any business class passenger
total number of passenger
Click here to view the code in Google Colab: