manoela commited on
Commit
9c5217d
·
verified ·
1 Parent(s): a1a2c04

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

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +679 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Teste
3
- emoji: 📉
4
- colorFrom: indigo
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: teste
3
+ emoji: 🐳
4
+ colorFrom: gray
5
+ colorTo: purple
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,679 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Churn Dashboard</title>
7
+ <script src="https://cdn.tailwindcss.com"></script>
8
+ <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
9
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
10
+ <style>
11
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
12
+
13
+ body {
14
+ font-family: 'Inter', sans-serif;
15
+ -webkit-font-smoothing: antialiased;
16
+ }
17
+
18
+ .sidebar {
19
+ transition: all 0.3s;
20
+ }
21
+
22
+ .chart-container {
23
+ position: relative;
24
+ height: 100%;
25
+ width: 100%;
26
+ }
27
+
28
+ @media (max-width: 768px) {
29
+ .sidebar {
30
+ transform: translateX(-100%);
31
+ position: fixed;
32
+ z-index: 50;
33
+ height: 100vh;
34
+ }
35
+ .sidebar-open {
36
+ transform: translateX(0);
37
+ }
38
+ .overlay {
39
+ position: fixed;
40
+ top: 0;
41
+ left: 0;
42
+ right: 0;
43
+ bottom: 0;
44
+ background-color: rgba(0,0,0,0.5);
45
+ z-index: 40;
46
+ }
47
+ }
48
+ </style>
49
+ </head>
50
+ <body class="bg-gray-50 text-gray-900">
51
+ <!-- Mobile Menu Button -->
52
+ <div class="md:hidden fixed top-4 left-4 z-50">
53
+ <button id="menuBtn" class="p-2 rounded-md bg-white shadow">
54
+ <i class="fas fa-bars text-gray-800"></i>
55
+ </button>
56
+ </div>
57
+
58
+ <!-- Overlay -->
59
+ <div id="overlay" class="overlay hidden"></div>
60
+
61
+ <!-- Sidebar -->
62
+ <div id="sidebar" class="sidebar bg-white w-64 fixed h-full shadow-lg z-30">
63
+ <div class="p-4 border-b border-gray-200">
64
+ <h1 class="text-xl font-bold text-gray-900">Churn Dashboard</h1>
65
+ <p class="text-xs text-gray-500">v2.1.0</p>
66
+ </div>
67
+ <nav class="p-4">
68
+ <ul class="space-y-2">
69
+ <li>
70
+ <a href="#overview" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
71
+ <i class="fas fa-chart-line mr-3"></i>
72
+ <span>Overview</span>
73
+ </a>
74
+ </li>
75
+ <li>
76
+ <a href="#ml-models" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
77
+ <i class="fas fa-brain mr-3"></i>
78
+ <span>ML Models</span>
79
+ </a>
80
+ </li>
81
+ <li>
82
+ <a href="#segmentation" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
83
+ <i class="fas fa-users mr-3"></i>
84
+ <span>Segmentation</span>
85
+ </a>
86
+ </li>
87
+ <li>
88
+ <a href="#forecast" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
89
+ <i class="fas fa-chart-bar mr-3"></i>
90
+ <span>Forecast</span>
91
+ </a>
92
+ </li>
93
+ <li>
94
+ <a href="#alerts" class="flex items-center p-2 text-gray-900 rounded-lg hover:bg-gray-100">
95
+ <i class="fas fa-bell mr-3"></i>
96
+ <span>Alerts</span>
97
+ </a>
98
+ </li>
99
+ </ul>
100
+ </nav>
101
+ <div class="absolute bottom-0 w-full p-4 border-t border-gray-200">
102
+ <div class="flex items-center">
103
+ <div class="w-8 h-8 rounded-full bg-gray-300 flex items-center justify-center">
104
+ <i class="fas fa-user text-gray-600"></i>
105
+ </div>
106
+ <div class="ml-3">
107
+ <p class="text-sm font-medium">Admin User</p>
108
+ <p class="text-xs text-gray-500">admin@company.com</p>
109
+ </div>
110
+ </div>
111
+ </div>
112
+ </div>
113
+
114
+ <!-- Main Content -->
115
+ <div class="md:ml-64 min-h-screen">
116
+ <div class="p-6">
117
+ <!-- Header -->
118
+ <div class="flex justify-between items-center mb-8">
119
+ <h1 class="text-2xl font-bold">Churn Monitoring Dashboard</h1>
120
+ <div class="flex items-center space-x-4">
121
+ <div class="relative">
122
+ <i class="fas fa-search absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"></i>
123
+ <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">
124
+ </div>
125
+ <button class="p-2 rounded-full hover:bg-gray-200">
126
+ <i class="fas fa-cog text-gray-600"></i>
127
+ </button>
128
+ </div>
129
+ </div>
130
+
131
+ <!-- Overview Section -->
132
+ <section id="overview" class="mb-12">
133
+ <div class="flex justify-between items-center mb-6">
134
+ <h2 class="text-xl font-semibold">Churn Overview</h2>
135
+ <div class="flex space-x-2">
136
+ <select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400">
137
+ <option>Last 30 days</option>
138
+ <option>Last 90 days</option>
139
+ <option>Last 12 months</option>
140
+ </select>
141
+ <button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">Export</button>
142
+ </div>
143
+ </div>
144
+
145
+ <div class="grid grid-cols-1 md:grid-cols-4 gap-6 mb-6">
146
+ <!-- Current Churn Rate -->
147
+ <div class="bg-white p-6 rounded-lg shadow">
148
+ <div class="flex justify-between items-start">
149
+ <div>
150
+ <p class="text-sm text-gray-500">Current Churn Rate</p>
151
+ <p class="text-3xl font-bold mt-1">12.4%</p>
152
+ <p class="text-sm mt-2 flex items-center">
153
+ <span class="text-red-500 flex items-center">
154
+ <i class="fas fa-caret-up mr-1"></i> 2.1%
155
+ </span>
156
+ <span class="text-gray-500 ml-1">vs last month</span>
157
+ </p>
158
+ </div>
159
+ <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
160
+ <i class="fas fa-percentage text-gray-600"></i>
161
+ </div>
162
+ </div>
163
+ </div>
164
+
165
+ <!-- Retention Rate -->
166
+ <div class="bg-white p-6 rounded-lg shadow">
167
+ <div class="flex justify-between items-start">
168
+ <div>
169
+ <p class="text-sm text-gray-500">Retention Rate</p>
170
+ <p class="text-3xl font-bold mt-1">87.6%</p>
171
+ <p class="text-sm mt-2 flex items-center">
172
+ <span class="text-red-500 flex items-center">
173
+ <i class="fas fa-caret-down mr-1"></i> 1.8%
174
+ </span>
175
+ <span class="text-gray-500 ml-1">vs last month</span>
176
+ </p>
177
+ </div>
178
+ <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
179
+ <i class="fas fa-lock text-gray-600"></i>
180
+ </div>
181
+ </div>
182
+ </div>
183
+
184
+ <!-- Lost Customers -->
185
+ <div class="bg-white p-6 rounded-lg shadow">
186
+ <div class="flex justify-between items-start">
187
+ <div>
188
+ <p class="text-sm text-gray-500">Lost Customers</p>
189
+ <p class="text-3xl font-bold mt-1">1,248</p>
190
+ <p class="text-sm mt-2 flex items-center">
191
+ <span class="text-red-500 flex items-center">
192
+ <i class="fas fa-caret-up mr-1"></i> 18%
193
+ </span>
194
+ <span class="text-gray-500 ml-1">vs last month</span>
195
+ </p>
196
+ </div>
197
+ <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
198
+ <i class="fas fa-user-slash text-gray-600"></i>
199
+ </div>
200
+ </div>
201
+ </div>
202
+
203
+ <!-- Recovery Rate -->
204
+ <div class="bg-white p-6 rounded-lg shadow">
205
+ <div class="flex justify-between items-start">
206
+ <div>
207
+ <p class="text-sm text-gray-500">Recovery Rate</p>
208
+ <p class="text-3xl font-bold mt-1">23.2%</p>
209
+ <p class="text-sm mt-2 flex items-center">
210
+ <span class="text-green-500 flex items-center">
211
+ <i class="fas fa-caret-up mr-1"></i> 3.4%
212
+ </span>
213
+ <span class="text-gray-500 ml-1">vs last month</span>
214
+ </p>
215
+ </div>
216
+ <div class="w-12 h-12 bg-gray-100 rounded-full flex items-center justify-center">
217
+ <i class="fas fa-undo text-gray-600"></i>
218
+ </div>
219
+ </div>
220
+ </div>
221
+ </div>
222
+
223
+ <!-- Churn Trend Chart -->
224
+ <div class="bg-white p-6 rounded-lg shadow mb-6">
225
+ <div class="flex justify-between items-center mb-4">
226
+ <h3 class="font-medium">Churn Rate Trend (Last 12 Months)</h3>
227
+ <div class="flex space-x-2">
228
+ <button class="px-2 py-1 text-xs border border-gray-300 rounded-md hover:bg-gray-100">Monthly</button>
229
+ <button class="px-2 py-1 text-xs border border-gray-300 rounded-md hover:bg-gray-100">Weekly</button>
230
+ </div>
231
+ </div>
232
+ <div class="chart-container">
233
+ <canvas id="churnTrendChart"></canvas>
234
+ </div>
235
+ </div>
236
+ </section>
237
+
238
+ <!-- ML Models Section -->
239
+ <section id="ml-models" class="mb-12">
240
+ <div class="flex justify-between items-center mb-6">
241
+ <h2 class="text-xl font-semibold">Machine Learning Model Results</h2>
242
+ <button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">Train New Model</button>
243
+ </div>
244
+
245
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
246
+ <!-- Model Metrics -->
247
+ <div class="bg-white p-6 rounded-lg shadow">
248
+ <h3 class="font-medium mb-4">Model Performance Metrics</h3>
249
+ <div class="overflow-x-auto">
250
+ <table class="min-w-full divide-y divide-gray-200">
251
+ <thead class="bg-gray-50">
252
+ <tr>
253
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Model</th>
254
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Accuracy</th>
255
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Precision</th>
256
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Recall</th>
257
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">F1-Score</th>
258
+ </tr>
259
+ </thead>
260
+ <tbody class="bg-white divide-y divide-gray-200">
261
+ <tr>
262
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">XGBoost</td>
263
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.89</td>
264
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.85</td>
265
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.91</td>
266
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.88</td>
267
+ </tr>
268
+ <tr>
269
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Random Forest</td>
270
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.87</td>
271
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.83</td>
272
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.89</td>
273
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.86</td>
274
+ </tr>
275
+ <tr>
276
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Logistic Regression</td>
277
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.82</td>
278
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.78</td>
279
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.84</td>
280
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">0.81</td>
281
+ </tr>
282
+ </tbody>
283
+ </table>
284
+ </div>
285
+ </div>
286
+
287
+ <!-- ROC Curve -->
288
+ <div class="bg-white p-6 rounded-lg shadow">
289
+ <h3 class="font-medium mb-4">ROC Curve (AUC Comparison)</h3>
290
+ <div class="chart-container">
291
+ <canvas id="rocCurveChart"></canvas>
292
+ </div>
293
+ </div>
294
+ </div>
295
+ </section>
296
+
297
+ <!-- Segmentation Section -->
298
+ <section id="segmentation" class="mb-12">
299
+ <div class="flex justify-between items-center mb-6">
300
+ <h2 class="text-xl font-semibold">Customer Segmentation</h2>
301
+ <div class="flex space-x-2">
302
+ <select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400">
303
+ <option>By Signup Date</option>
304
+ <option>By Customer Profile</option>
305
+ <option>By Product</option>
306
+ </select>
307
+ </div>
308
+ </div>
309
+
310
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-6">
311
+ <!-- Cohort Analysis -->
312
+ <div class="bg-white p-6 rounded-lg shadow">
313
+ <h3 class="font-medium mb-4">Cohort Analysis (by Signup Date)</h3>
314
+ <div class="overflow-x-auto">
315
+ <table class="min-w-full divide-y divide-gray-200">
316
+ <thead class="bg-gray-50">
317
+ <tr>
318
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Cohort</th>
319
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Customers</th>
320
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Churn Rate</th>
321
+ <th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Retention</th>
322
+ </tr>
323
+ </thead>
324
+ <tbody class="bg-white divide-y divide-gray-200">
325
+ <tr>
326
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Jan 2023</td>
327
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,245</td>
328
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">14.2%</td>
329
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">85.8%</td>
330
+ </tr>
331
+ <tr>
332
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Feb 2023</td>
333
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,387</td>
334
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">12.8%</td>
335
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">87.2%</td>
336
+ </tr>
337
+ <tr>
338
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Mar 2023</td>
339
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,502</td>
340
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">11.5%</td>
341
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">88.5%</td>
342
+ </tr>
343
+ <tr>
344
+ <td class="px-4 py-2 whitespace-nowrap text-sm font-medium text-gray-900">Apr 2023</td>
345
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">1,678</td>
346
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">10.9%</td>
347
+ <td class="px-4 py-2 whitespace-nowrap text-sm text-gray-500">89.1%</td>
348
+ </tr>
349
+ </tbody>
350
+ </table>
351
+ </div>
352
+ </div>
353
+
354
+ <!-- Churn by Segment -->
355
+ <div class="bg-white p-6 rounded-lg shadow">
356
+ <h3 class="font-medium mb-4">Churn Rate by Customer Segment</h3>
357
+ <div class="chart-container">
358
+ <canvas id="segmentChart"></canvas>
359
+ </div>
360
+ </div>
361
+ </div>
362
+ </section>
363
+
364
+ <!-- Forecast Section -->
365
+ <section id="forecast" class="mb-12">
366
+ <div class="flex justify-between items-center mb-6">
367
+ <h2 class="text-xl font-semibold">Churn Forecast</h2>
368
+ <div class="flex space-x-2">
369
+ <select class="border border-gray-300 rounded-md px-3 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-gray-400">
370
+ <option>Next 3 Months</option>
371
+ <option>Next 6 Months</option>
372
+ <option>Next 12 Months</option>
373
+ </select>
374
+ </div>
375
+ </div>
376
+
377
+ <div class="bg-white p-6 rounded-lg shadow mb-6">
378
+ <h3 class="font-medium mb-4">Expected Churn Rate (Next 6 Months)</h3>
379
+ <div class="chart-container">
380
+ <canvas id="forecastChart"></canvas>
381
+ </div>
382
+ </div>
383
+ </section>
384
+
385
+ <!-- Alerts Section -->
386
+ <section id="alerts">
387
+ <div class="flex justify-between items-center mb-6">
388
+ <h2 class="text-xl font-semibold">Alerts & Insights</h2>
389
+ <button class="px-3 py-1 bg-gray-900 text-white rounded-md text-sm hover:bg-gray-700">View All</button>
390
+ </div>
391
+
392
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
393
+ <!-- Critical Alerts -->
394
+ <div class="bg-white p-6 rounded-lg shadow">
395
+ <div class="flex items-center mb-4">
396
+ <div class="w-8 h-8 rounded-full bg-red-100 flex items-center justify-center mr-3">
397
+ <i class="fas fa-exclamation text-red-500"></i>
398
+ </div>
399
+ <h3 class="font-medium">Critical Alerts</h3>
400
+ </div>
401
+ <div class="space-y-4">
402
+ <div class="p-3 border-l-4 border-red-500 bg-red-50">
403
+ <p class="text-sm font-medium">Churn rate increased by 2.1% in Premium segment</p>
404
+ <p class="text-xs text-gray-500 mt-1">Detected today at 9:42 AM</p>
405
+ </div>
406
+ <div class="p-3 border-l-4 border-red-500 bg-red-50">
407
+ <p class="text-sm font-medium">Retention dropped by 3.2% for customers aged 25-34</p>
408
+ <p class="text-xs text-gray-500 mt-1">Detected yesterday at 4:15 PM</p>
409
+ </div>
410
+ </div>
411
+ </div>
412
+
413
+ <!-- Recommendations -->
414
+ <div class="bg-white p-6 rounded-lg shadow">
415
+ <div class="flex items-center mb-4">
416
+ <div class="w-8 h-8 rounded-full bg-blue-100 flex items-center justify-center mr-3">
417
+ <i class="fas fa-lightbulb text-blue-500"></i>
418
+ </div>
419
+ <h3 class="font-medium">Actionable Recommendations</h3>
420
+ </div>
421
+ <div class="space-y-4">
422
+ <div class="p-3 border-l-4 border-blue-500 bg-blue-50">
423
+ <p class="text-sm font-medium">Offer discount to Premium segment customers with >80% churn probability</p>
424
+ <p class="text-xs text-gray-500 mt-1">Expected impact: Reduce churn by 15-20%</p>
425
+ </div>
426
+ <div class="p-3 border-l-4 border-blue-500 bg-blue-50">
427
+ <p class="text-sm font-medium">Implement loyalty program for customers with 6-12 month tenure</p>
428
+ <p class="text-xs text-gray-500 mt-1">Expected impact: Increase retention by 8-12%</p>
429
+ </div>
430
+ </div>
431
+ </div>
432
+ </div>
433
+ </section>
434
+ </div>
435
+ </div>
436
+
437
+ <script>
438
+ // Mobile menu toggle
439
+ const menuBtn = document.getElementById('menuBtn');
440
+ const sidebar = document.getElementById('sidebar');
441
+ const overlay = document.getElementById('overlay');
442
+
443
+ menuBtn.addEventListener('click', () => {
444
+ sidebar.classList.toggle('sidebar-open');
445
+ overlay.classList.toggle('hidden');
446
+ });
447
+
448
+ overlay.addEventListener('click', () => {
449
+ sidebar.classList.remove('sidebar-open');
450
+ overlay.classList.add('hidden');
451
+ });
452
+
453
+ // Charts
454
+ document.addEventListener('DOMContentLoaded', function() {
455
+ // Churn Trend Chart
456
+ const churnTrendCtx = document.getElementById('churnTrendChart').getContext('2d');
457
+ const churnTrendChart = new Chart(churnTrendCtx, {
458
+ type: 'line',
459
+ data: {
460
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
461
+ datasets: [{
462
+ label: 'Churn Rate',
463
+ 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],
464
+ borderColor: '#000000',
465
+ backgroundColor: 'rgba(0, 0, 0, 0.05)',
466
+ borderWidth: 2,
467
+ tension: 0.4,
468
+ fill: true
469
+ }]
470
+ },
471
+ options: {
472
+ responsive: true,
473
+ plugins: {
474
+ legend: {
475
+ position: 'top',
476
+ },
477
+ tooltip: {
478
+ callbacks: {
479
+ label: function(context) {
480
+ return context.dataset.label + ': ' + context.parsed.y + '%';
481
+ }
482
+ }
483
+ }
484
+ },
485
+ scales: {
486
+ y: {
487
+ beginAtZero: true,
488
+ ticks: {
489
+ callback: function(value) {
490
+ return value + '%';
491
+ }
492
+ }
493
+ }
494
+ }
495
+ }
496
+ });
497
+
498
+ // ROC Curve Chart
499
+ const rocCurveCtx = document.getElementById('rocCurveChart').getContext('2d');
500
+ const rocCurveChart = new Chart(rocCurveCtx, {
501
+ type: 'line',
502
+ data: {
503
+ labels: Array.from({length: 11}, (_, i) => i/10),
504
+ datasets: [
505
+ {
506
+ label: 'XGBoost (AUC = 0.94)',
507
+ data: [0, 0.1, 0.3, 0.45, 0.6, 0.75, 0.85, 0.92, 0.96, 0.98, 1],
508
+ borderColor: '#000000',
509
+ borderWidth: 2,
510
+ tension: 0.3
511
+ },
512
+ {
513
+ label: 'Random Forest (AUC = 0.91)',
514
+ data: [0, 0.08, 0.25, 0.4, 0.55, 0.7, 0.8, 0.88, 0.93, 0.96, 1],
515
+ borderColor: '#555555',
516
+ borderWidth: 2,
517
+ tension: 0.3
518
+ },
519
+ {
520
+ label: 'Logistic Regression (AUC = 0.86)',
521
+ data: [0, 0.05, 0.2, 0.35, 0.5, 0.65, 0.75, 0.83, 0.89, 0.94, 1],
522
+ borderColor: '#999999',
523
+ borderWidth: 2,
524
+ tension: 0.3
525
+ },
526
+ {
527
+ label: 'Random (AUC = 0.50)',
528
+ data: [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1],
529
+ borderColor: '#cccccc',
530
+ borderDash: [5, 5],
531
+ borderWidth: 1,
532
+ tension: 0
533
+ }
534
+ ]
535
+ },
536
+ options: {
537
+ responsive: true,
538
+ plugins: {
539
+ legend: {
540
+ position: 'top',
541
+ }
542
+ },
543
+ scales: {
544
+ x: {
545
+ title: {
546
+ display: true,
547
+ text: 'False Positive Rate'
548
+ }
549
+ },
550
+ y: {
551
+ title: {
552
+ display: true,
553
+ text: 'True Positive Rate'
554
+ }
555
+ }
556
+ }
557
+ }
558
+ });
559
+
560
+ // Segment Chart
561
+ const segmentCtx = document.getElementById('segmentChart').getContext('2d');
562
+ const segmentChart = new Chart(segmentCtx, {
563
+ type: 'bar',
564
+ data: {
565
+ labels: ['Premium', 'Standard', 'Basic', 'Trial', 'Enterprise'],
566
+ datasets: [{
567
+ label: 'Churn Rate',
568
+ data: [14.5, 12.3, 15.8, 18.2, 9.4],
569
+ backgroundColor: [
570
+ 'rgba(0, 0, 0, 0.8)',
571
+ 'rgba(0, 0, 0, 0.6)',
572
+ 'rgba(0, 0, 0, 0.4)',
573
+ 'rgba(0, 0, 0, 0.3)',
574
+ 'rgba(0, 0, 0, 0.2)'
575
+ ],
576
+ borderColor: [
577
+ 'rgba(0, 0, 0, 1)',
578
+ 'rgba(0, 0, 0, 1)',
579
+ 'rgba(0, 0, 0, 1)',
580
+ 'rgba(0, 0, 0, 1)',
581
+ 'rgba(0, 0, 0, 1)'
582
+ ],
583
+ borderWidth: 1
584
+ }]
585
+ },
586
+ options: {
587
+ responsive: true,
588
+ plugins: {
589
+ legend: {
590
+ display: false
591
+ },
592
+ tooltip: {
593
+ callbacks: {
594
+ label: function(context) {
595
+ return context.parsed.y + '%';
596
+ }
597
+ }
598
+ }
599
+ },
600
+ scales: {
601
+ y: {
602
+ beginAtZero: true,
603
+ ticks: {
604
+ callback: function(value) {
605
+ return value + '%';
606
+ }
607
+ }
608
+ }
609
+ }
610
+ }
611
+ });
612
+
613
+ // Forecast Chart
614
+ const forecastCtx = document.getElementById('forecastChart').getContext('2d');
615
+ const forecastChart = new Chart(forecastCtx, {
616
+ type: 'bar',
617
+ data: {
618
+ labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
619
+ datasets: [
620
+ {
621
+ label: 'Forecasted Churn',
622
+ data: [12.8, 13.2, 13.5, 13.9, 14.2, 14.5],
623
+ backgroundColor: 'rgba(0, 0, 0, 0.2)',
624
+ borderColor: 'rgba(0, 0, 0, 1)',
625
+ borderWidth: 1,
626
+ type: 'bar'
627
+ },
628
+ {
629
+ label: 'Upper Bound',
630
+ data: [13.5, 13.9, 14.2, 14.6, 14.9, 15.2],
631
+ borderColor: '#888888',
632
+ backgroundColor: 'rgba(0, 0, 0, 0)',
633
+ borderWidth: 1,
634
+ borderDash: [5, 5],
635
+ type: 'line',
636
+ pointRadius: 0
637
+ },
638
+ {
639
+ label: 'Lower Bound',
640
+ data: [12.1, 12.5, 12.8, 13.2, 13.5, 13.8],
641
+ borderColor: '#888888',
642
+ backgroundColor: 'rgba(0, 0, 0, 0)',
643
+ borderWidth: 1,
644
+ borderDash: [5, 5],
645
+ type: 'line',
646
+ pointRadius: 0
647
+ }
648
+ ]
649
+ },
650
+ options: {
651
+ responsive: true,
652
+ plugins: {
653
+ legend: {
654
+ position: 'top',
655
+ },
656
+ tooltip: {
657
+ callbacks: {
658
+ label: function(context) {
659
+ return context.dataset.label + ': ' + context.parsed.y + '%';
660
+ }
661
+ }
662
+ }
663
+ },
664
+ scales: {
665
+ y: {
666
+ beginAtZero: true,
667
+ ticks: {
668
+ callback: function(value) {
669
+ return value + '%';
670
+ }
671
+ }
672
+ }
673
+ }
674
+ }
675
+ });
676
+ });
677
+ </script>
678
+ <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>
679
+ </html>