Create a responsive black-and-white website with a minimalist and elegant layout. The main page should be a dashboard for monitoring churn in my company, including the following sections: 1. **Churn Overview** - Current churn rate (percentage and historical trend) - Line chart showing churn over time (monthly or weekly) - Key indicators: retention rate, number of lost customers, recovery rate 2. **Machine Learning Model Results** - Metrics: accuracy, precision, recall, f1-score - ROC curve and AUC - Comparison chart or table showing performance of multiple models (e.g., Random Forest vs XGBoost vs Logistic Regression) 3. **Customer Segmentation** - Table or chart showing cohort analysis (e.g., by signup date or customer profile) - Churn metrics per segment 4. **Churn Forecast** - Visual forecast (e.g., bar chart showing expected churn percentage by month) - Confidence intervals or error bars 5. **Alerts and Insights** - Automatically highlighted insights (e.g., “Churn rate increased by X% in Segment Y this month”) - Actionable recommendations generated by the ML model Additional requirements: - Fully responsive for desktop and mobile - Clean typography (modern sans-serif fonts) - Simple, clean UI with sidebar or fixed top navigation - Prioritize clarity and usability Generate the full HTML/CSS/JS or template code to implement this dashboard, preferably using libraries like D3.js or Chart.js for the visualizations. - Initial Deployment
9c5217d
verified
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Churn Dashboard</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/chart.js"></script> | |
| <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
| <style> | |
| @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap'); | |
| body { | |
| font-family: 'Inter', sans-serif; | |
| -webkit-font-smoothing: antialiased; | |
| } | |
| .sidebar { | |
| transition: all 0.3s; | |
| } | |
| .chart-container { | |
| position: relative; | |
| height: 100%; | |
| width: 100%; | |
| } | |
| @media (max-width: 768px) { | |
| .sidebar { | |
| transform: translateX(-100%); | |
| position: fixed; | |
| z-index: 50; | |
| height: 100vh; | |
| } | |
| .sidebar-open { | |
| transform: translateX(0); | |
| } | |
| .overlay { | |
| position: fixed; | |
| top: 0; | |
| left: 0; | |
| right: 0; | |
| bottom: 0; | |
| background-color: rgba(0,0,0,0.5); | |
| z-index: 40; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 text-gray-900"> | |
| <!-- Mobile Menu Button --> | |
| <div class="md:hidden fixed top-4 left-4 z-50"> | |
| <button id="menuBtn" class="p-2 rounded-md bg-white shadow"> | |
| <i class="fas fa-bars text-gray-800"></i> | |
| </button> | |
| </div> | |
| <!-- Overlay --> | |
| <div id="overlay" class="overlay hidden"></div> | |
| <!-- Sidebar --> | |
| <div id="sidebar" class="sidebar bg-white w-64 fixed h-full shadow-lg z-30"> | |
| <div class="p-4 border-b border-gray-200"> | |
| <h1 class="text-xl font-bold text-gray-900">Churn Dashboard</h1> | |
| <p class="text-xs text-gray-500">v2.1.0</p> | |
| </div> | |
| <nav class="p-4"> | |
| <ul class="space-y-2"> | |
| <li> | |
| <a href="#overview" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100"> | |
| <i class="fas fa-chart-line mr-3"></i> | |
| <span>Overview</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#ml-models" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100"> | |
| <i class="fas fa-brain mr-3"></i> | |
| <span>ML Models</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#segmentation" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100"> | |
| <i class="fas fa-users mr-3"></i> | |
| <span>Segmentation</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#forecast" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100"> | |
| <i class="fas fa-chart-bar mr-3"></i> | |
| <span>Forecast</span> | |
| </a> | |
| </li> | |
| <li> | |
| <a href="#alerts" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100"> | |
| <i class="fas fa-bell mr-3"></i> | |
| <span>Alerts</span> | |
| </a> | |
| </li> | |
| </ul> | |
| </nav> | |
| <div class="absolute bottom-0 w-full p-4 border-t border-gray-200"> | |
| <div class="flex items-center"> | |
| <div class="w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center"> | |
| <i class="fas fa-user text-gray-600"></i> | |
| </div> | |
| <div class="ml-3"> | |
| <p class="text-sm font-medium">Admin User</p> | |
| <p class="text-xs text-gray-500">admin@company.com</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Main Content --> | |
| <div class="md:ml-64 min-h-screen"> | |
| <div class="p-6"> | |
| <!-- Header --> | |
| <div class="flex justify-between items-center mb-8"> | |
| <h1 class="text-2xl font-bold">Churn Monitoring Dashboard</h1> | |
| <div class="flex items-center space-x-4"> | |
| <div class="relative"> | |
| <i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i> | |
| <input type="text" placeholder="Search..." class="pl-10 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-gray-400"> | |
| </div> | |
| <button class="p-2 rounded-full hover:bg-gray-200"> | |
| <i class="fas fa-cog text-gray-600"></i> | |
| </button> | |
| </div> | |
| </div> | |
| <!-- Overview Section --> | |
| <section id="overview" class="mb-12"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-xl font-semibold">Churn Overview</h2> | |
| <div class="flex space-x-2"> | |
| <select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400"> | |
| <option>Last 30 days</option> | |
| <option>Last 90 days</option> | |
| <option>Last 12 months</option> | |
| </select> | |
| <button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">Export</button> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6"> | |
| <!-- Current Churn Rate --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-sm text-gray-500">Current Churn Rate</p> | |
| <p class="text-3xl font-bold mt-1">12.4%</p> | |
| <p class="text-sm mt-2 flex items-center"> | |
| <span class="text-red-500 flex items-center"> | |
| <i class="fas fa-caret-up mr-1"></i> 2.1% | |
| </span> | |
| <span class="text-gray-500 ml-1">vs last month</span> | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center"> | |
| <i class="fas fa-percentage text-gray-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Retention Rate --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-sm text-gray-500">Retention Rate</p> | |
| <p class="text-3xl font-bold mt-1">87.6%</p> | |
| <p class="text-sm mt-2 flex items-center"> | |
| <span class="text-red-500 flex items-center"> | |
| <i class="fas fa-caret-down mr-1"></i> 1.8% | |
| </span> | |
| <span class="text-gray-500 ml-1">vs last month</span> | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center"> | |
| <i class="fas fa-lock text-gray-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Lost Customers --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-sm text-gray-500">Lost Customers</p> | |
| <p class="text-3xl font-bold mt-1">1,248</p> | |
| <p class="text-sm mt-2 flex items-center"> | |
| <span class="text-red-500 flex items-center"> | |
| <i class="fas fa-caret-up mr-1"></i> 18% | |
| </span> | |
| <span class="text-gray-500 ml-1">vs last month</span> | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center"> | |
| <i class="fas fa-user-slash text-gray-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Recovery Rate --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <div class="flex justify-between items-start"> | |
| <div> | |
| <p class="text-sm text-gray-500">Recovery Rate</p> | |
| <p class="text-3xl font-bold mt-1">23.2%</p> | |
| <p class="text-sm mt-2 flex items-center"> | |
| <span class="text-green-500 flex items-center"> | |
| <i class="fas fa-caret-up mr-1"></i> 3.4% | |
| </span> | |
| <span class="text-gray-500 ml-1">vs last month</span> | |
| </p> | |
| </div> | |
| <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center"> | |
| <i class="fas fa-undo text-gray-600"></i> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Churn Trend Chart --> | |
| <div class="bg-white p-6 rounded-lg shadow mb-6"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="font-medium">Churn Rate Trend (Last 12 Months)</h3> | |
| <div class="flex space-x-2"> | |
| <button class="px-2 py-1 text-xs border border-gray-300 rounded-md hover:bg-gray-100">Monthly</button> | |
| <button class="px-2 py-1 text-xs border border-gray-300 rounded-md hover:bg-gray-100">Weekly</button> | |
| </div> | |
| </div> | |
| <div class="chart-container"> | |
| <canvas id="churnTrendChart"></canvas> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- ML Models Section --> | |
| <section id="ml-models" class="mb-12"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-xl font-semibold">Machine Learning Model Results</h2> | |
| <button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">Train New Model</button> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"> | |
| <!-- Model Metrics --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <h3 class="font-medium mb-4">Model Performance Metrics</h3> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Model</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Accuracy</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Precision</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Recall</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">F1-Score</th> | |
| </tr> | |
| </thead> | |
| <tbody class="bg-white divide-y divide-gray-200"> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">XGBoost</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.89</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.85</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.91</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.88</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Random Forest</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.87</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.83</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.89</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.86</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Logistic Regression</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.82</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.78</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.84</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.81</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| <!-- ROC Curve --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <h3 class="font-medium mb-4">ROC Curve (AUC Comparison)</h3> | |
| <div class="chart-container"> | |
| <canvas id="rocCurveChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Segmentation Section --> | |
| <section id="segmentation" class="mb-12"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-xl font-semibold">Customer Segmentation</h2> | |
| <div class="flex space-x-2"> | |
| <select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400"> | |
| <option>By Signup Date</option> | |
| <option>By Customer Profile</option> | |
| <option>By Product</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6"> | |
| <!-- Cohort Analysis --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <h3 class="font-medium mb-4">Cohort Analysis (by Signup Date)</h3> | |
| <div class="overflow-x-auto"> | |
| <table class="min-w-full divide-y divide-gray-200"> | |
| <thead class="bg-gray-50"> | |
| <tr> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Cohort</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customers</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Churn Rate</th> | |
| <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Retention</th> | |
| </tr> | |
| </thead> | |
| <tbody class="bg-white divide-y divide-gray-200"> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Jan 2023</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,245</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">14.2%</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">85.8%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Feb 2023</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,387</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">12.8%</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">87.2%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Mar 2023</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,502</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">11.5%</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">88.5%</td> | |
| </tr> | |
| <tr> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Apr 2023</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,678</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">10.9%</td> | |
| <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">89.1%</td> | |
| </tr> | |
| </tbody> | |
| </table> | |
| </div> | |
| </div> | |
| <!-- Churn by Segment --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <h3 class="font-medium mb-4">Churn Rate by Customer Segment</h3> | |
| <div class="chart-container"> | |
| <canvas id="segmentChart"></canvas> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Forecast Section --> | |
| <section id="forecast" class="mb-12"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-xl font-semibold">Churn Forecast</h2> | |
| <div class="flex space-x-2"> | |
| <select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400"> | |
| <option>Next 3 Months</option> | |
| <option>Next 6 Months</option> | |
| <option>Next 12 Months</option> | |
| </select> | |
| </div> | |
| </div> | |
| <div class="bg-white p-6 rounded-lg shadow mb-6"> | |
| <h3 class="font-medium mb-4">Expected Churn Rate (Next 6 Months)</h3> | |
| <div class="chart-container"> | |
| <canvas id="forecastChart"></canvas> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Alerts Section --> | |
| <section id="alerts"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-xl font-semibold">Alerts & Insights</h2> | |
| <button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">View All</button> | |
| </div> | |
| <div class="grid grid-cols-1 md:grid-cols-2 gap-6"> | |
| <!-- Critical Alerts --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <div class="flex items-center mb-4"> | |
| <div class="w-8 h-8 rounded-full bg-red-100 flex items-center justify-center mr-3"> | |
| <i class="fas fa-exclamation text-red-500"></i> | |
| </div> | |
| <h3 class="font-medium">Critical Alerts</h3> | |
| </div> | |
| <div class="space-y-4"> | |
| <div class="p-3 border-l-4 border-red-500 bg-red-50"> | |
| <p class="text-sm font-medium">Churn rate increased by 2.1% in Premium segment</p> | |
| <p class="text-xs text-gray-500 mt-1">Detected today at 9:42 AM</p> | |
| </div> | |
| <div class="p-3 border-l-4 border-red-500 bg-red-50"> | |
| <p class="text-sm font-medium">Retention dropped by 3.2% for customers aged 25-34</p> | |
| <p class="text-xs text-gray-500 mt-1">Detected yesterday at 4:15 PM</p> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Recommendations --> | |
| <div class="bg-white p-6 rounded-lg shadow"> | |
| <div class="flex items-center mb-4"> | |
| <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3"> | |
| <i class="fas fa-lightbulb text-blue-500"></i> | |
| </div> | |
| <h3 class="font-medium">Actionable Recommendations</h3> | |
| </div> | |
| <div class="space-y-4"> | |
| <div class="p-3 border-l-4 border-blue-500 bg-blue-50"> | |
| <p class="text-sm font-medium">Offer discount to Premium segment customers with >80% churn probability</p> | |
| <p class="text-xs text-gray-500 mt-1">Expected impact: Reduce churn by 15-20%</p> | |
| </div> | |
| <div class="p-3 border-l-4 border-blue-500 bg-blue-50"> | |
| <p class="text-sm font-medium">Implement loyalty program for customers with 6-12 month tenure</p> | |
| <p class="text-xs text-gray-500 mt-1">Expected impact: Increase retention by 8-12%</p> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| </div> | |
| </div> | |
| <script> | |
| // Mobile menu toggle | |
| const menuBtn = document.getElementById('menuBtn'); | |
| const sidebar = document.getElementById('sidebar'); | |
| const overlay = document.getElementById('overlay'); | |
| menuBtn.addEventListener('click', () => { | |
| sidebar.classList.toggle('sidebar-open'); | |
| overlay.classList.toggle('hidden'); | |
| }); | |
| overlay.addEventListener('click', () => { | |
| sidebar.classList.remove('sidebar-open'); | |
| overlay.classList.add('hidden'); | |
| }); | |
| // Charts | |
| document.addEventListener('DOMContentLoaded', function() { | |
| // Churn Trend Chart | |
| const churnTrendCtx = document.getElementById('churnTrendChart').getContext('2d'); | |
| const churnTrendChart = new Chart(churnTrendCtx, { | |
| type: 'line', | |
| data: { | |
| labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], | |
| datasets: [{ | |
| label: 'Churn Rate', | |
| data: [12.5, 11.8, 10.9, 11.2, 11.5, 11.9, 12.1, 12.4, 12.8, 13.1, 12.9, 12.4], | |
| borderColor: '#000000', | |
| backgroundColor: 'rgba(0, 0, 0, 0.05)', | |
| borderWidth: 2, | |
| tension: 0.4, | |
| fill: true | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| plugins: { | |
| legend: { | |
| position: 'top', | |
| }, | |
| tooltip: { | |
| callbacks: { | |
| label: function(context) { | |
| return context.dataset.label + ': ' + context.parsed.y + '%'; | |
| } | |
| } | |
| } | |
| }, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| ticks: { | |
| callback: function(value) { | |
| return value + '%'; | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| // ROC Curve Chart | |
| const rocCurveCtx = document.getElementById('rocCurveChart').getContext('2d'); | |
| const rocCurveChart = new Chart(rocCurveCtx, { | |
| type: 'line', | |
| data: { | |
| labels: Array.from({length: 11}, (_, i) => i/10), | |
| datasets: [ | |
| { | |
| label: 'XGBoost (AUC = 0.94)', | |
| data: [0, 0.1, 0.3, 0.45, 0.6, 0.75, 0.85, 0.92, 0.96, 0.98, 1], | |
| borderColor: '#000000', | |
| borderWidth: 2, | |
| tension: 0.3 | |
| }, | |
| { | |
| label: 'Random Forest (AUC = 0.91)', | |
| data: [0, 0.08, 0.25, 0.4, 0.55, 0.7, 0.8, 0.88, 0.93, 0.96, 1], | |
| borderColor: '#555555', | |
| borderWidth: 2, | |
| tension: 0.3 | |
| }, | |
| { | |
| label: 'Logistic Regression (AUC = 0.86)', | |
| data: [0, 0.05, 0.2, 0.35, 0.5, 0.65, 0.75, 0.83, 0.89, 0.94, 1], | |
| borderColor: '#999999', | |
| borderWidth: 2, | |
| tension: 0.3 | |
| }, | |
| { | |
| label: 'Random (AUC = 0.50)', | |
| data: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], | |
| borderColor: '#cccccc', | |
| borderDash: [5, 5], | |
| borderWidth: 1, | |
| tension: 0 | |
| } | |
| ] | |
| }, | |
| options: { | |
| responsive: true, | |
| plugins: { | |
| legend: { | |
| position: 'top', | |
| } | |
| }, | |
| scales: { | |
| x: { | |
| title: { | |
| display: true, | |
| text: 'False Positive Rate' | |
| } | |
| }, | |
| y: { | |
| title: { | |
| display: true, | |
| text: 'True Positive Rate' | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| // Segment Chart | |
| const segmentCtx = document.getElementById('segmentChart').getContext('2d'); | |
| const segmentChart = new Chart(segmentCtx, { | |
| type: 'bar', | |
| data: { | |
| labels: ['Premium', 'Standard', 'Basic', 'Trial', 'Enterprise'], | |
| datasets: [{ | |
| label: 'Churn Rate', | |
| data: [14.5, 12.3, 15.8, 18.2, 9.4], | |
| backgroundColor: [ | |
| 'rgba(0, 0, 0, 0.8)', | |
| 'rgba(0, 0, 0, 0.6)', | |
| 'rgba(0, 0, 0, 0.4)', | |
| 'rgba(0, 0, 0, 0.3)', | |
| 'rgba(0, 0, 0, 0.2)' | |
| ], | |
| borderColor: [ | |
| 'rgba(0, 0, 0, 1)', | |
| 'rgba(0, 0, 0, 1)', | |
| 'rgba(0, 0, 0, 1)', | |
| 'rgba(0, 0, 0, 1)', | |
| 'rgba(0, 0, 0, 1)' | |
| ], | |
| borderWidth: 1 | |
| }] | |
| }, | |
| options: { | |
| responsive: true, | |
| plugins: { | |
| legend: { | |
| display: false | |
| }, | |
| tooltip: { | |
| callbacks: { | |
| label: function(context) { | |
| return context.parsed.y + '%'; | |
| } | |
| } | |
| } | |
| }, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| ticks: { | |
| callback: function(value) { | |
| return value + '%'; | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| // Forecast Chart | |
| const forecastCtx = document.getElementById('forecastChart').getContext('2d'); | |
| const forecastChart = new Chart(forecastCtx, { | |
| type: 'bar', | |
| data: { | |
| labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'], | |
| datasets: [ | |
| { | |
| label: 'Forecasted Churn', | |
| data: [12.8, 13.2, 13.5, 13.9, 14.2, 14.5], | |
| backgroundColor: 'rgba(0, 0, 0, 0.2)', | |
| borderColor: 'rgba(0, 0, 0, 1)', | |
| borderWidth: 1, | |
| type: 'bar' | |
| }, | |
| { | |
| label: 'Upper Bound', | |
| data: [13.5, 13.9, 14.2, 14.6, 14.9, 15.2], | |
| borderColor: '#888888', | |
| backgroundColor: 'rgba(0, 0, 0, 0)', | |
| borderWidth: 1, | |
| borderDash: [5, 5], | |
| type: 'line', | |
| pointRadius: 0 | |
| }, | |
| { | |
| label: 'Lower Bound', | |
| data: [12.1, 12.5, 12.8, 13.2, 13.5, 13.8], | |
| borderColor: '#888888', | |
| backgroundColor: 'rgba(0, 0, 0, 0)', | |
| borderWidth: 1, | |
| borderDash: [5, 5], | |
| type: 'line', | |
| pointRadius: 0 | |
| } | |
| ] | |
| }, | |
| options: { | |
| responsive: true, | |
| plugins: { | |
| legend: { | |
| position: 'top', | |
| }, | |
| tooltip: { | |
| callbacks: { | |
| label: function(context) { | |
| return context.dataset.label + ': ' + context.parsed.y + '%'; | |
| } | |
| } | |
| } | |
| }, | |
| scales: { | |
| y: { | |
| beginAtZero: true, | |
| ticks: { | |
| callback: function(value) { | |
| return value + '%'; | |
| } | |
| } | |
| } | |
| } | |
| } | |
| }); | |
| }); | |
| </script> | |
| <p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=manoela/teste" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |