The Interactive Linear Regression App using Streamlit

All,

I’ve created my first App using Streamlit and have deployed on Azure cloud using Docker containers.

The app itself is a simple interactive Linear Regression App, that allows you to simulate a Linear Function, generate sample data out of it and then use Linear Regression to predict the Regression Line.

I’ve also added widgets to play around with the distribution (Mean, Stddev) of Input X and the Residual as well as the number of samples generated and you can see the plotted results straight away.

It’s been great fun playing around with this and I intend to add more features but would appreciate your feedback and comments.

Some of the features coming up:

  • Navigation menu - I’ve tried to add various pages and a menu to navigate using a radio button, but haven’t been able to make it work and not sure what I’m doing wrong. I’m getting errors related to the awesome-streamlit library
  • Option to select different implementations for the linear regression model
  • Option to try your own dataset

Any ideas as to how I can make this app more interesting for users learning linear regression would be great!

Thanks,
Angelo

1 Like

Hey @etzimopoulos,

That looks great :slight_smile: ! Are you able to share a link to the app so users can play with it ?

Thanks in advance,
Fanilo

2 Likes

Hi @andfanilo,

Sorry, I was so excited I forgot to add the link :face_with_hand_over_mouth: .

Here’s the link for the app - https://liraweb.azurewebsites.net/

Also, here’s the GitHub but please be gentle, not a software developer (yet) :laughing: - https://github.com/etzimopoulos/LiRA-Web-App

Thanks and looking forward to comments and feedback.

Regards
Angelo

3 Likes

Great demo! Was it difficult to deploy it for Azure hosting? I would be really interested in that, for future suggestion. Thanks

2 Likes

Hi @ciao,

I hadn’t used Azure before, nor Streamlit, so there’s a lot of trial an error especially on how to configure the Docker container with its config file before deploying.

I found a couple of articles that helped me both on Azure and GCP which I played around with and made it work in the end.

Here’s the links:

  1. Azure cloud deployment using Docker
  2. GCP cloud deployment using Docker

On the Streamlit side, @Marc’s Awesome-Streamlit app itself and the resources on his website helped me understand how to structure my app and make it work. :pray:

I should probably write my own article at some point including how I built the app and the deployment bit :rofl:

Thanks,
Angelo

3 Likes

Please write that article I am having a hard time deploying it. It doesn’t seem to work when I follow step by step the article you post for Azure deployment

1 Like

Hi Benjamin, I still have it on my things to do but I moved on ever since and stayed behind.

I will plan it for next week.

Earlier last year I put out there initially a Hello Streamlit article to show how you can it get up and running (part I) and deployed it using Streamlit share which was easier.

You still have to do the requirements.txt but don’t need docker or azure.

Thanks for the nudge :nerd_face:

1 Like

+1 for an article and advantages of using Azure.

I specifically am stuck trying to get streamlit to run on azure due to company requirements to use Azure :dizzy_face:

Understood. My original implementation was deployed in Azure using Docker container but I was being charged to maintain the app online so moved it to Streamlit share which was free. In my article I’ll describe the azure docker setup, hopefully that will help you.