import streamlit as st import pandas as pd import PIL from bokeh.models.widgets import Div def url_button(button_name,url): if st.button(button_name): js = """window.open('{url}')""".format(url=url) # New tab or window html = ''.format(js) div = Div(text=html) st.bokeh_chart(div) st.markdown("# Character Counter: Email Industry") col1, col2, col3 = st.columns([1,1,1]) with col2: img = PIL.Image.open("figures/ModelCC.png") st.image(img) stats_col1, stats_col2, stats_col3, stats_col4 = st.columns([1,1,1,1]) with stats_col1: st.metric(label="Production", value="Ready") with stats_col2: st.metric(label="Accuracy", value="85%") with stats_col3: st.metric(label="Speed", value="3.86 ms") with stats_col4: st.metric(label="Industry", value="Email") with st.sidebar: with st.expander('Model Description', expanded=False): st.markdown('Finding the correct length for an email campaign to maximize user engagement can be an ambiguous task. The Loxz Character Count Model allows you to predict the correct length of your emails for a particular industry and a particular type of email. Using these inputs and trained on an extensive proprietary data set from the Loxz family digital archive, the models incorporate real-world and synthetic data to find the optimized character counts. We applied the random forest algorithm in this model. Bootstrapping was also ensembled in the algorithm which effectively prevents overfitting by reducing variance. The model achieves an 86% accuracy on the test set. This inference-based ML model will help the campaign engineers start with an acceptable length and zero in on the best character count, maximizing engagement in their campaign.') url_button('Model Homepage','https://www.loxz.com/#/models/CC') url_button('Full Report','https://resources.loxz.com/reports/realtime-ml-character-count-model') url_button('Amazon Market Place','https://aws.amazon.com/marketplace') industry_lists = [ 'Retail', 'Software and Technology', 'Hospitality', 'Adacemic and Education', 'Healthcare', 'Energy', 'Real Estate', 'Entertainment', 'Fianance and Banking' ] campaign_types = [ 'Promotional', 'Transactional', 'Webinar', 'Survey', 'Newsletter', 'Engagement', 'Curated_Content', 'Review_Request', 'Product_Announcement', 'Abandoned_Cart' ] target_variables = [ 'open_rate', 'click_through_rate', 'abandoned_cart', 'unsubscribe_rate' ] industry = st.selectbox( 'Please select your industry', industry_lists ) campaign = st.selectbox( 'Please select your industry', campaign_types ) target = st.selectbox( 'Please select your target variable', target_variables )