-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAPP.py
More file actions
26 lines (20 loc) · 746 Bytes
/
APP.py
File metadata and controls
26 lines (20 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import streamlit as st
import pandas as pd
import joblib
from Preprocessing import full_preprocessing # type: ignore
# Load model
model = joblib.load("Fraud_det.pkl")
st.title("Fraud Detection System")
uploaded_file = st.file_uploader("Upload your Excel file", type=["xlsx"])
if uploaded_file is not None:
data = pd.read_excel(uploaded_file)
processed_data = full_preprocessing(data)
predictions = model.predict(processed_data)
data['Prediction'] = predictions
st.write("Prediction Results:")
st.dataframe(data)
st.download_button(
label="Download Predictions as Excel",
data=data.to_excel(index=False, engine='openpyxl'),
file_name='fraud_predictions.xlsx'
)