Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -29,24 +29,23 @@ avg_frequency_login_days = st.number_input('Input Average Frequency Login Days :
|
|
29 |
points_in_wallet = st.number_input('Input Points in Wallet : ',0.0,2069.069760814851)
|
30 |
used_special_discount = st.radio('Used Special Discount? ',('Yes','No'))
|
31 |
offer_application_preference = st.radio('Offer Application Preference : ',('Yes','No'))
|
32 |
-
feedback = st.selectbox('Select Feedback : ','Too many ads', 'No reason specified', 'Reasonable Price',
|
33 |
'Quality Customer Care', 'Poor Website', 'Poor Customer Service',
|
34 |
-
'Poor Product Quality', 'User Friendly Website', 'Products always in Stock')
|
35 |
|
36 |
if st.button('Predict'):
|
37 |
data_inf = pd.DataFrame({'region_category' : region_category,
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
hasil = 'Not Churn' if func_imp.predict(data_inf) == 0 else 'Churn'
|
52 |
st.header(f'Prediksi = {hasil}')
|
|
|
29 |
points_in_wallet = st.number_input('Input Points in Wallet : ',0.0,2069.069760814851)
|
30 |
used_special_discount = st.radio('Used Special Discount? ',('Yes','No'))
|
31 |
offer_application_preference = st.radio('Offer Application Preference : ',('Yes','No'))
|
32 |
+
feedback = st.selectbox('Select Feedback : ',('Too many ads', 'No reason specified', 'Reasonable Price',
|
33 |
'Quality Customer Care', 'Poor Website', 'Poor Customer Service',
|
34 |
+
'Poor Product Quality', 'User Friendly Website', 'Products always in Stock'))
|
35 |
|
36 |
if st.button('Predict'):
|
37 |
data_inf = pd.DataFrame({'region_category' : region_category,
|
38 |
+
'membership_category' : membership_category,
|
39 |
+
'joined_through_referral' : joined_through_referral,
|
40 |
+
'preferred_offer_types' : preferred_offer_types,
|
41 |
+
'medium_of_operation' : medium_of_operation,
|
42 |
+
'days_since_last_login' : days_since_last_login,
|
43 |
+
'avg_time_spent' : avg_time_spent,
|
44 |
+
'avg_transaction_value' : avg_transaction_value,
|
45 |
+
'avg_frequency_login_days' : avg_frequency_login_days,
|
46 |
+
'points_in_wallet' : points_in_wallet,
|
47 |
+
'used_special_discount' : used_special_discount,
|
48 |
+
'offer_application_preference' : offer_application_preference,
|
49 |
+
'feedback' : feedback}, index=[0])
|
50 |
+
hasil = 'Not Churn' if np.round(func_imp.predict(pipeline.transform(data_inf))) == 0 else 'Churn'
|
|
|
51 |
st.header(f'Prediksi = {hasil}')
|