Skip to content

madhurimarawat/Streamlit-Programs

Repository files navigation

Streamlit-Programs

This repository contains programs in the Python programming language using module Streamlit.


Mode of Execution Used Visual Studio Code  Streamlit

Visual Studio Code

--> Visit the official website:  Visual Studio Code

--> Download according to the platform that will be used like Linux, Macos or Windows.

--> Follow the setup wizard.

--> Create a new file with the extention of .py and then this file can be executed in the server.

Streamlit Server

--> Streamlit is a python framework through which we can deploy any machine learning model and any python project with ease and without worrying about the frontend.

--> Streamlit is very user-friendly.

--> Streamlit has pre defined functions for all frontend components and we can directly use them.

--> To install streamlit in your system, just run this command-

pip install streamlit

Running Project in Streamlit Server

Make Sure all depencies are already satisfied before running the app.

  1. We can Directly run streamlit app with the following command-
streamlit run app.py

where app.py is the name of file containing streamlit code.

By default, streamlit will run on port 8501.

Also we can execute multiple files simultaneously and it will be executed in next ports like 8502 and so on.

  1. Navigate to URL http://localhost:8501

You should be able to view the homepage of your app.

๐ŸŒŸ Project and Models will change but this process will remain the same for all Streamlit projects.


About Projects

Complete Description about the project and resources used.

Linear Regression Salary Prediction

--> First ML model is constructed using linear regression for the dataset.

--> Then this model can be used directly.

--> The Homepage is designed for steamlit app.

--> After this the user input will be taken.

--> Finally we can run this app in the streamlit Server and get the desired output.

Dataset Used

Salary Dataset

--> Dataset is taken from: Salary Dataset

--> Contains Salary data for Regression.

--> The dataset has 2 columns-Years of Experience and Salary and 30 entries.

--> Column Years of Experience is used to find regression for Salary.

--> Dataset is already cleaned,no preprocessing required.

Algorithm Used

Linear Regression

--> Regression: It predicts the continuous output variables based on the independent input variable. like the prediction of house prices based on different parameters like house age, distance from the main road, location, area, etc.

--> It computes the linear relationship between a dependent variable and one or more independent features.

--> The goal of the algorithm is to find the best linear equation that can predict the value of the dependent variable based on the independent variables.

Naive Bayes Classifier Diabetes Prediction

--> First ML model is constructed using Naive Bayes Classifier for the dataset.

--> Then this model can be used directly.

--> The Homepage is designed for steamlit app.

--> After this the user input will be taken.

--> Finally we can run this app in the streamlit Server and get the desired output.

Dataset Used

Naive bayes classification data

--> Dataset is taken from:

--> Contains diabetes data for classification.

--> The dataset has 3 columns-glucose, blood pressure and diabetes and 995 entries.

--> Column glucose and blood pressure data is to classify whether the patient has diabetes or not.

--> Dataset is already cleaned,no preprocessing required.

Algorithm Used

Naive Bayes Classifiers

--> Naive Bayes classifiers are a collection of classification algorithms based on Bayesโ€™ Theorem.

--> It is not a single algorithm but a family of algorithms where all of them share a common principle, i.e. every pair of features being classified is independent of each other.

--> The fundamental Naive Bayes assumption is that each feature makes an independent and equal contribution to the outcome.

ML Model Inbuilt Datasets

--> In this I applied all supervised learning algorithm on inbuilt datasets in scikit-learn.

--> Then this model can be used directly.

--> The Homepage is designed for steamlit app.

--> After this the user input will be taken.

--> Finally we can run this app in the streamlit Server and get the desired output.

--> Also I made two code files for this. One files contains the implementation of this code using if else and it will run on all versions of python.

--> The second file contains code implementation using match case and will only run in python versions 3.10 and later.


Libraries Used

Short Description about all libraries used in Project.

To install python library this command is used-

pip install library_name
  • NumPy (Numerical Python) โ€“ Enables with collection of mathematical functions to operate on array and matrices.
  • Pandas (Panel Data/ Python Data Analysis) - This library is mostly used for analyzing, cleaning, exploring, and manipulating data.
  • Matplotlib - It is a data visualization and graphical plotting library.
  • Scikit-learn - It is a machine learning library that enables tools for used for many other machine learning algorithms such as classification, prediction, etc.

Additional Resources ๐Ÿงฎ๐Ÿ“š๐Ÿ““๐ŸŒ

  1. To see more of my machine learning models, visit my repository: https://github.com/madhurimarawat/Machine-Learning-Using-Python

  2. I deployed my ML models that I made using streamlit:

    Visit Website from : ML Algorithms on Inbuilt and Kaggle Datasets

    To See codes: https://github.com/madhurimarawat/ML-Model-Datasets-Using-Streamlits

  3. To see my Web Scrapper project made using Streamlit:

    Visit Website from : Web Scrapper

    To See codes: https://github.com/madhurimarawat/Web-Scrapper-Functions


Thanks for Visiting ๐Ÿ˜„

Drop a ๐ŸŒŸ if you find this repository useful.

If you have any doubts or suggestions, feel free to reach me.

๐Ÿ“ซ How to reach me:   Linkedin Badge     Mail Illustration๐Ÿ“ซ