Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -52,7 +52,7 @@ with App:
|
|
52 |
avg_transaction_value = st.slider('avg_transaction_value', 0,999999)
|
53 |
avg_frequency_login_days = st.slider('avg_frequency_login_days', 0, 24)
|
54 |
points_in_wallet = st.slider('points_in_wallet',0,9999999)
|
55 |
-
feedback = st.selectbox('
|
56 |
|
57 |
data = {
|
58 |
'user_id': user_id,
|
@@ -68,10 +68,11 @@ with App:
|
|
68 |
model_tf = tf.keras.models.load_model("model_best.hdf5")
|
69 |
preprocess = joblib.load('full_pipeline.pkl')
|
70 |
df = pd.read_csv('churn.csv')
|
|
|
71 |
st.subheader('User Input')
|
72 |
st.write(input)
|
73 |
if st.button('Predict'):
|
74 |
-
process = preprocess.
|
75 |
prediction = model_tf.predict(process)
|
76 |
if prediction == 1:
|
77 |
prediction = 'Churn'
|
|
|
52 |
avg_transaction_value = st.slider('avg_transaction_value', 0,999999)
|
53 |
avg_frequency_login_days = st.slider('avg_frequency_login_days', 0, 24)
|
54 |
points_in_wallet = st.slider('points_in_wallet',0,9999999)
|
55 |
+
feedback = st.selectbox('feedback',['No reason specified', 'Poor Customer Service','Poor Product Quality', 'Poor Website', 'Products always in Stock', 'Quality Customer Care','Reasonable Price', 'Too many ads', 'User Friendly Website'])
|
56 |
|
57 |
data = {
|
58 |
'user_id': user_id,
|
|
|
68 |
model_tf = tf.keras.models.load_model("model_best.hdf5")
|
69 |
preprocess = joblib.load('full_pipeline.pkl')
|
70 |
df = pd.read_csv('churn.csv')
|
71 |
+
result = preprocess.fit_transform(df)
|
72 |
st.subheader('User Input')
|
73 |
st.write(input)
|
74 |
if st.button('Predict'):
|
75 |
+
process = preprocess.transform(input)
|
76 |
prediction = model_tf.predict(process)
|
77 |
if prediction == 1:
|
78 |
prediction = 'Churn'
|