DIVYANSHI SINGH commited on
Commit ·
6469f7e
1
Parent(s): 9e7b7e8
Polish UI: High-resolution plots and responsive layout improvements
Browse files15 unmodified lines161718192021224 unmodified lines2728293031323334353637383940414238 unmodified lines818283848586878815 unmodified linesSEGMENT_PRODUCTS_PATH = os.path.join(BASE_DIR, "outputs", "segment_products.csv")# Set Page Configst.set_page_config(page_title="SegmentX: Customer Intelligence", layout="wide")# Custom Stylingst.markdown("""4 unmodified lines}.stMetric {background-color: #1f2937;padding: 15px;border-radius: 10px;border: 1px solid #374151;}h1, h2, h3 {color: #60a5fa;}</style>""", unsafe_allow_html=True)@st.cache_datadef load_data():if not os.path.exists(CUSTOMER_SEGMENTS_PATH):38 unmodified lines# Project Overview Sectionst.title("🛍️ SegmentX: E-Commerce Behavioral Intelligence")st.markdown(f"""<div style="background-color: #1a202c; padding: 25px; border-radius: 15px; border-left: 5px solid #60a5fa; margin-bottom: 30px;"><p style="font-size: 1.1em;">SegmentX is a professional behavioral intelligence platform. It transforms e-commerce transactions into actionable segments using RFM and K-Means++. Features include revenue forecasting, Pareto analysis, churn probability, and product affinity mapping to maximize customer retention and mission-critical marketing ROI.</p></div>""", unsafe_allow_html=True)15 unmodified lines1617181920212223242526274 unmodified lines323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777838 unmodified lines11711811912012112212312412512615 unmodified linesSEGMENT_PRODUCTS_PATH = os.path.join(BASE_DIR, "outputs", "segment_products.csv")# Set Page Configst.set_page_config(page_title="SegmentX: Customer Intelligence",page_icon="🛍️",layout="wide",initial_sidebar_state="expanded")# Custom Stylingst.markdown("""4 unmodified lines}.stMetric {background-color: #1f2937;padding: 20px;border-radius: 12px;border: 1px solid #374151;transition: transform 0.3s ease;}.stMetric:hover {transform: translateY(-5px);border-color: #60a5fa;}h1, h2, h3 {color: #60a5fa;font-family: 'Inter', sans-serif;}/* Improve block spacing */.block-container {padding-top: 2rem;padding-bottom: 5rem;}/* Custom Info Box */.info-box {background-color: rgba(96, 165, 250, 0.1);padding: 25px;border-radius: 15px;border-left: 6px solid #60a5fa;margin-bottom: 40px;}</style>""", unsafe_allow_html=True)# Set high-resolution plottingplt.rcParams['figure.dpi'] = 200plt.rcParams['savefig.dpi'] = 200plt.rcParams['axes.facecolor'] = '#0e1117'plt.rcParams['figure.facecolor'] = '#0e1117'plt.rcParams['text.color'] = '#e0e0e0'plt.rcParams['axes.labelcolor'] = '#e0e0e0'plt.rcParams['xtick.color'] = '#e0e0e0'plt.rcParams['ytick.color'] = '#e0e0e0'plt.rcParams['grid.color'] = '#374151'sns.set_palette("viridis")@st.cache_datadef load_data():if not os.path.exists(CUSTOMER_SEGMENTS_PATH):38 unmodified lines# Project Overview Sectionst.title("🛍️ SegmentX: E-Commerce Behavioral Intelligence")st.markdown(f"""<div class="info-box"><p style="font-size: 1.15em; line-height: 1.6; margin: 0;">SegmentX is a professional behavioral intelligence platform. It transforms e-commerce transactions into actionable segments using RFM and K-Means++. Features include revenue forecasting, Pareto analysis, churn probability, and product affinity mapping to maximize customer retention and mission-critical marketing ROI.</p></div>""", unsafe_allow_html=True)
app.py+43-5