Spaces:
Sleeping
Sleeping
Update app.py
Browse files49 unmodified lines5051525354555610 unmodified lines67686970717273105 unmodified lines17918018118218318418517 unmodified lines20320420520620720820949 unmodified linesst.set_page_config(layout="wide")# Main page - Churn Predictionst.title('CUSTOMER CHURN PREDICTION APP')# Main page - Churn Predictionst.markdown("Churn is a one of the biggest problem in the telecom industry. Research has shown that the average monthly churn rate among the top 4 wireless carriers in the US is 1.9% - 2%")10 unmodified lines}# Allow the user to select a model from the sidebarmodel_name = st.sidebar.selectbox('Select Model', list(models.keys()))# Retrieve the selected model and its type from the dictionarymodel = models[model_name]['Logistic Regression']105 unmodified linesif churn_labels[churn_index] == "Churn":churn_prob = churn_probability[churn_index]with col1:st.error(f"CHURN ALERT! This customer is likely to churn with a probability of {churn_prob * 100:.2f}% 😢")resized_churn_image = Image.open('Churn.jpeg')resized_churn_image = resized_churn_image.resize((350, 300)) # Adjust the width and height as desiredst.image(resized_churn_image)17 unmodified lineselse:churn_prob = churn_probability[churn_index]with col1:st.success(f"This customer is not likely to churn with a probability of {churn_prob * 100:.2f}% 😀")resized_not_churn_image = Image.open('NotChurn.png')resized_not_churn_image = resized_not_churn_image.resize((350, 300)) # Adjust the width and height as desiredst.image(resized_not_churn_image)49 unmodified lines5051525354555610 unmodified lines67686970717273105 unmodified lines17918018118218318418517 unmodified lines20320420520620720820949 unmodified linesst.set_page_config(layout="wide")# Main page - Churn Predictionst.title('CUSTOMER CHURN PREDICTION APP (CCPA)')# Main page - Churn Predictionst.markdown("Churn is a one of the biggest problem in the telecom industry. Research has shown that the average monthly churn rate among the top 4 wireless carriers in the US is 1.9% - 2%")10 unmodified lines}# Allow the user to select a model from the sidebar#model_name = st.sidebar.selectbox('Select Model', list(models.keys()))# Retrieve the selected model and its type from the dictionarymodel = models[model_name]['Logistic Regression']105 unmodified linesif churn_labels[churn_index] == "Churn":churn_prob = churn_probability[churn_index]with col1:st.error(f"DANGER! This customer is likely to churn with a probability of {churn_prob * 100:.2f}% 😢")resized_churn_image = Image.open('Churn.jpeg')resized_churn_image = resized_churn_image.resize((350, 300)) # Adjust the width and height as desiredst.image(resized_churn_image)17 unmodified lineselse:churn_prob = churn_probability[churn_index]with col1:st.success(f"This customer is a loyal (not churn) with a probability of {churn_prob * 100:.2f}% 😀")resized_not_churn_image = Image.open('NotChurn.png')resized_not_churn_image = resized_not_churn_image.resize((350, 300)) # Adjust the width and height as desiredst.image(resized_not_churn_image)
app.py+4-4