This repository is a part of TMLC project with end-to-end machine learning pipeline with deployment using PaaS on streamlit. Here, we have use the concept of Explainable AI in which whatever the ML application predicts, we are able to see real time input values with its feature contributions, its impact on model, behaviour and summary in detail with.
Project title: Machine learning improves predictions of an Agricultural Nitrous Oxide (N2O) emissions from intensively managed cropping systems.
- For N2O predictions, we have used ML model with Xgb regressor algorithm and for user data analysis, wo go with Auto EDA (pandas_profiling tool). Application is integrated using Hydralit package for responsive and animated navbar, theme components in deployment using streamlit.
- An idea with data is taken from a published paper in Environmental Research Research Paper (Paper published 19 January 2021) *C
N2O.predictions.application.with.Explainable.AI.mp4
- Create virtual environment
python -m venv VIRTUAL_ENV_NAME
and activate it.\VIRTUAL_ENV_NAME\Scripts\activate
. - Install necessary library for this project from the file
requirements.txt
or manually install bypip
.To create project library requirements, use below command,pip install -r requirements.txt
pip freeze > requirements.txt
- Libraries that are used in this project (highlighted few)
import pandas as pd import matplotlib.pyplot as plt import streamlit as st import streamlit.components.v1 as components import shap from sklearn.metrics import r2_score, mean_squared_error from pandas_profiling import ProfileReport from streamlit_pandas_profiling import st_profile_report import pybase64, joblib
-
Run app.py using below command to start streamlit API
streamlit run app.py
-
By default, streamlit will run on port 8501 locally.
Local URL: http://localhost:8501
Network URL: http://192.168.0.102:8501
. # Root directory
├── data # Input data directory
│ ├── Dataset.csv # Dataset used for Xgb model
│ ├── sample_data.csv # Sample input data
├── Model # Model directory
│ ├── model_xgb_61_final.joblib.compressed # Model (Xgb regressor)
├── apps # Application directory
│ ├── app1.py # Single prediction with AI
│ ├── app2.py # Predictions on user data with AI
│ ├── app3.py # UI enhancement
│ ├── app4.py # Connect page
├── .streamlit # Streamlit theme param directory
│ ├── config.toml # Configurarion theme file
├── requirements.txt # Project requirements library with versions
├── README.md # Project README file
└── LICENSE # Project License file
Live Aplication is running on streamlit cloud platform, you can access from below.
You say freak, I say unique. Don't wait for an opportunity, create it.
Let’s connect, share the ideas and feel free to ping me...