Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import tensorflow as tf
|
| 3 |
+
|
| 4 |
+
# Load your model
|
| 5 |
+
model = tf.keras.models.load_model('best_dnn_model.h5')
|
| 6 |
+
|
| 7 |
+
# Define a function to make predictions
|
| 8 |
+
def predict(input_data):
|
| 9 |
+
prediction = model.predict(input_data)
|
| 10 |
+
return prediction
|
| 11 |
+
|
| 12 |
+
# Streamlit app
|
| 13 |
+
st.title('Bank Churn Prediction')
|
| 14 |
+
|
| 15 |
+
user_input = st.text_input('Enter your input data')
|
| 16 |
+
|
| 17 |
+
if st.button('Predict'):
|
| 18 |
+
input_data = preprocess_user_input(user_input) # Implementing the function based on preprocessing logic
|
| 19 |
+
prediction = predict(input_data)
|
| 20 |
+
st.write('Prediction:', prediction)
|