import streamlit as st
from ui_shell import (
ensure_session_state,
fetch_backend_overview,
load_css,
render_backend_notice,
render_page_shell,
render_workspace_banner,
)
st.set_page_config(
page_title="AutoML Studio",
page_icon="✨",
layout="wide",
initial_sidebar_state="expanded",
)
load_css()
ensure_session_state()
overview = fetch_backend_overview()
total = overview["total"]
completed = overview["completed"]
running = overview["running"]
failed = overview["failed"]
backend_ok = overview["backend_ok"]
render_page_shell(
title="AutoML Studio",
eyebrow="Machine Learning Command Center",
description="Upload tabular data, orchestrate training, inspect model behavior, monitor drift, and work with AI utilities from one cohesive control surface.",
stats=[
("Tracked Runs", total),
("Completed", completed),
("Training", running),
("Failures", failed),
],
)
render_backend_notice(backend_ok)
render_workspace_banner()
st.markdown(
"""
System interface synced for live dataset, training, and monitoring workflows
""",
unsafe_allow_html=True,
)
c1, c2, c3, c4 = st.columns(4)
with c1:
st.metric("Mission Runs", total)
with c2:
st.metric("Successful", completed)
with c3:
st.metric("In Training", running)
with c4:
st.metric("Faults", failed)
st.markdown(
"""
IngestUniversal file upload and dataset restore
TrainFast, balanced, and deep AutoML execution
InspectResults, drift, explainability, and exports
""",
unsafe_allow_html=True,
)
st.markdown(
"""
Telemetry
Runtime Pulse
Track backend readiness, active runs, and workspace state from a single control layer before you commit compute.
Live mission status
Decisioning
Model Route Map
Move from upload to leakage detection, training, explainability, and drift review with clearer handoff points between pages.
Faster flow between tools
Operator Mode
Futuristic HUD
The new shell uses animated scanlines, orbit rings, glow depth, and stronger contrast so the dark mode feels intentional and premium.
New dark theme activated
""",
unsafe_allow_html=True,
)
# ── Navigation Cards ──────────────────────────────────────────────────────────
st.markdown("### Neural Navigation", unsafe_allow_html=True)
nav_data = [
("🏠 Home", "Upload dataset & configure training", "pages/1_Home.py"),
("🧬 Dataset DNA", "Deep dive into your dataset's structure", "pages/2_Dataset_DNA.py"),
("🔥 Training Lab", "Live training monitor + leaderboard", "pages/3_Training_Lab.py"),
("📊 Results Console", "SHAP, pipeline map, scenario playground, augmentation, and model chat", "pages/4_Results_Console.py"),
("📜 Experiment Tracker", "Run history, archive, battle arena, and experiment comparisons", "pages/5_Experiment_Tracker.py"),
("🌊 Drift Monitor", "Monitor dataset drift against saved baselines", "pages/6_Drift_Monitor.py"),
("🤖 Smart AI Hub", "Synthetic data, ensembles, and NL tooling", "pages/7_Smart_AI_Hub.py"),
]
row1 = st.columns(3)
row2 = st.columns(3)
row3 = st.columns(3)
rows = [row1, row2, row3]
for i, (title, desc, _) in enumerate(nav_data):
row_idx = i // 3
col_idx = i % 3
if row_idx >= len(rows):
rows.append(st.columns(3))
with rows[row_idx][col_idx]:
icon = title.split()[0]
name = " ".join(title.split()[1:])
st.markdown(f"""
{icon}
{name}
{desc}
Open from sidebar and keep your workspace state
""", unsafe_allow_html=True)
st.markdown("""
""", unsafe_allow_html=True)
st.markdown("### Next-Level Features", unsafe_allow_html=True)
st.markdown(
"""
Feature Idea
Scenario Simulator
Let users tweak a few feature values with sliders and watch predicted outcomes, SHAP shifts, and confidence move in real time.
Great for demos and stakeholder buy-in
Feature Idea
Data Anomaly Radar
Add an always-on anomaly watch that highlights strange rows, suspicious spikes, and unstable features before training begins.
Prevents bad runs early
Feature Idea
Experiment Narrator
Auto-write a concise story of why the current winning model beat the field and what changed compared with recent runs.
Useful for handoffs and reviews
""",
unsafe_allow_html=True,
)