Team Ai
Apppublic

DevenmL/business-process-optimization

sourceHugging Faceapache-2.0updated 2y agoView on Hugging Face
0likes
app.py40 linesDownload Raw Back to root
1import streamlit as st
2import pandas as pd
3import joblib
4
5# Load the model
6model = joblib.load('business_process_model.pkl')
7
8# Streamlit app
9st.title("Business Process Optimization AI")
10st.write("Upload your business process data to detect inefficiencies.")
11
12# File upload
13uploaded_file = st.file_uploader("Upload a CSV or Excel file", type=["csv", "xlsx"])
14if uploaded_file is not None:
15    # Load the data
16    if uploaded_file.name.endswith('.csv'):
17        df = pd.read_csv(uploaded_file)
18    else:
19        df = pd.read_excel(uploaded_file)
20
21    # Preprocess the data
22    numeric_columns = df.select_dtypes(include=['number']).columns
23    df[numeric_columns] = df[numeric_columns].fillna(df[numeric_columns].mean())
24    df = pd.get_dummies(df, drop_first=True)
25
26    # Make predictions
27    predictions = model.predict(df)
28    df['Predicted_Inefficiency'] = predictions
29
30    # Show results
31    st.write("Predictions:")
32    st.write(df)
33
34    # Generate recommendations
35    st.write("Recommendations:")
36    if df['Predicted_Inefficiency'].sum() > 0:
37        st.write("1. Automate high-cost processes.")
38        st.write("2. Optimize resource allocation.")
39    else:
40        st.write("No significant inefficiencies detected.")