ZakyF commited on
Commit
0728ca7
·
1 Parent(s): 2258da0
Files changed (2) hide show
  1. create-data.ipynb +810 -469
  2. synthetic_umkm_data.csv +2 -2
create-data.ipynb CHANGED
@@ -30,7 +30,7 @@
30
  },
31
  {
32
  "cell_type": "code",
33
- "execution_count": 3,
34
  "id": "af962614",
35
  "metadata": {},
36
  "outputs": [
@@ -116,173 +116,203 @@
116
  "name": "Location_Competitiveness",
117
  "rawType": "int32",
118
  "type": "integer"
 
 
 
 
 
 
 
 
 
 
119
  }
120
  ],
121
- "ref": "36d3479a-d461-4aca-87d9-bd5d676c965d",
122
  "rows": [
123
  [
124
  "0",
125
  "1",
126
- "10746455",
127
- "17.62",
128
- "0.796",
129
- "147",
130
- "4.84",
131
- "Produk cukup baik, kadang waktu tunggu agak lama. Ad eius dolore qui.",
132
- "0.365",
133
  "105",
134
- "22.88",
135
- "4.28",
136
- "Med",
137
- "9"
 
 
138
  ],
139
  [
140
  "1",
141
  "2",
142
- "10026002",
143
- "-15.23",
144
- "1.059",
145
- "114",
146
- "3.63",
147
  "Harga dan kualitas seimbang, pengalaman biasa saja. Assumenda in adipisci dolor magnam ad dicta.",
148
- "0.516",
149
  "95",
150
- "11.92",
151
- "1.96",
152
  "Med",
153
- "10"
 
 
154
  ],
155
  [
156
  "2",
157
  "3",
158
- "1938056",
159
- "11.88",
160
- "0.886",
161
- "85",
162
- "4.23",
163
  "Pelayanan standar, masih bisa ditingkatkan.",
164
- "0.599",
165
  "17",
166
- "15.47",
167
- "3.57",
168
  "Med",
169
- "8"
 
 
170
  ],
171
  [
172
  "3",
173
  "4",
174
- "8692714",
175
- "13.52",
176
- "0.837",
177
- "180",
178
- "4.58",
179
  "Transaksi digital lancar, proses checkout tidak ribet.",
180
- "0.257",
181
  "109",
182
- "17.66",
183
- "5.18",
184
  "Low",
185
- "13"
 
 
186
  ],
187
  [
188
  "4",
189
  "5",
190
- "3240963",
191
- "-7.94",
192
- "1.086",
193
- "110",
194
- "4.14",
195
- "Harga naik tapi layanan tidak membaik. In ipsum eius sit quis cum in.",
196
- "0.57",
197
  "74",
198
- "26.87",
199
- "3.05",
200
- "High",
201
- "7"
 
 
202
  ],
203
  [
204
  "5",
205
  "6",
206
- "4659352",
207
- "0.45",
208
- "0.975",
209
- "97",
210
- "4.29",
211
- "Kadang stok kosong saat jam ramai. Culpa vero excepturi at atque.",
212
- "0.573",
213
  "23",
214
- "23.58",
215
- "5.3",
216
- "Med",
217
- "16"
 
 
218
  ],
219
  [
220
  "6",
221
  "7",
222
- "8564730",
223
- "27.85",
224
- "0.742",
225
- "127",
226
- "4.8",
227
- "Pelayanan cepat dan ramah, pesanan selalu tepat. Nobis rem quas modi voluptate fugiat.",
228
- "0.089",
229
  "105",
230
- "15.01",
231
- "4.05",
232
- "Low",
233
- "6"
 
 
234
  ],
235
  [
236
  "7",
237
  "8",
238
- "11098374",
239
- "23.78",
240
- "0.748",
241
- "196",
242
  "4.83",
243
  "Selalu repeat order karena kualitasnya terjaga.",
244
- "0.279",
245
  "124",
246
- "36.23",
247
- "6.89",
248
  "Low",
249
- "10"
 
 
250
  ],
251
  [
252
  "8",
253
  "9",
254
- "10615528",
255
- "42.0",
256
- "0.608",
257
- "148",
258
- "4.89",
259
  "Selalu repeat order karena kualitasnya terjaga. Eos occaecati suscipit facere deleniti architecto optio.",
260
- "0.29",
261
  "77",
262
- "23.53",
263
- "6.07",
264
  "Low",
265
- "7"
 
 
266
  ],
267
  [
268
  "9",
269
  "10",
270
- "9610755",
271
- "6.22",
272
- "0.911",
273
- "144",
274
- "4.33",
275
- "Secara umum oke, hanya respon chat kadang lambat.",
276
- "0.469",
277
  "90",
278
- "28.84",
279
- "3.48",
280
- "Med",
281
- "9"
 
 
282
  ]
283
  ],
284
  "shape": {
285
- "columns": 13,
286
  "rows": 10
287
  }
288
  },
@@ -318,168 +348,190 @@
318
  " <th>Digital_Adoption_Score</th>\n",
319
  " <th>Peak_Hour_Latency</th>\n",
320
  " <th>Location_Competitiveness</th>\n",
 
 
321
  " </tr>\n",
322
  " </thead>\n",
323
  " <tbody>\n",
324
  " <tr>\n",
325
  " <th>0</th>\n",
326
  " <td>1</td>\n",
327
- " <td>10746455</td>\n",
328
- " <td>17.62</td>\n",
329
- " <td>0.796</td>\n",
330
- " <td>147</td>\n",
331
- " <td>4.84</td>\n",
332
- " <td>Produk cukup baik, kadang waktu tunggu agak la...</td>\n",
333
- " <td>0.365</td>\n",
334
  " <td>105</td>\n",
335
- " <td>22.88</td>\n",
336
- " <td>4.28</td>\n",
337
- " <td>Med</td>\n",
338
  " <td>9</td>\n",
 
 
339
  " </tr>\n",
340
  " <tr>\n",
341
  " <th>1</th>\n",
342
  " <td>2</td>\n",
343
- " <td>10026002</td>\n",
344
- " <td>-15.23</td>\n",
345
- " <td>1.059</td>\n",
346
- " <td>114</td>\n",
347
- " <td>3.63</td>\n",
348
  " <td>Harga dan kualitas seimbang, pengalaman biasa ...</td>\n",
349
- " <td>0.516</td>\n",
350
  " <td>95</td>\n",
351
- " <td>11.92</td>\n",
352
- " <td>1.96</td>\n",
353
  " <td>Med</td>\n",
354
  " <td>10</td>\n",
 
 
355
  " </tr>\n",
356
  " <tr>\n",
357
  " <th>2</th>\n",
358
  " <td>3</td>\n",
359
- " <td>1938056</td>\n",
360
- " <td>11.88</td>\n",
361
- " <td>0.886</td>\n",
362
- " <td>85</td>\n",
363
- " <td>4.23</td>\n",
364
  " <td>Pelayanan standar, masih bisa ditingkatkan.</td>\n",
365
- " <td>0.599</td>\n",
366
  " <td>17</td>\n",
367
- " <td>15.47</td>\n",
368
- " <td>3.57</td>\n",
369
  " <td>Med</td>\n",
370
  " <td>8</td>\n",
 
 
371
  " </tr>\n",
372
  " <tr>\n",
373
  " <th>3</th>\n",
374
  " <td>4</td>\n",
375
- " <td>8692714</td>\n",
376
- " <td>13.52</td>\n",
377
- " <td>0.837</td>\n",
378
- " <td>180</td>\n",
379
- " <td>4.58</td>\n",
380
  " <td>Transaksi digital lancar, proses checkout tida...</td>\n",
381
- " <td>0.257</td>\n",
382
  " <td>109</td>\n",
383
- " <td>17.66</td>\n",
384
- " <td>5.18</td>\n",
385
  " <td>Low</td>\n",
386
  " <td>13</td>\n",
 
 
387
  " </tr>\n",
388
  " <tr>\n",
389
  " <th>4</th>\n",
390
  " <td>5</td>\n",
391
- " <td>3240963</td>\n",
392
- " <td>-7.94</td>\n",
393
- " <td>1.086</td>\n",
394
- " <td>110</td>\n",
395
- " <td>4.14</td>\n",
396
- " <td>Harga naik tapi layanan tidak membaik. In ipsu...</td>\n",
397
- " <td>0.570</td>\n",
398
  " <td>74</td>\n",
399
- " <td>26.87</td>\n",
400
- " <td>3.05</td>\n",
401
- " <td>High</td>\n",
402
  " <td>7</td>\n",
 
 
403
  " </tr>\n",
404
  " <tr>\n",
405
  " <th>5</th>\n",
406
  " <td>6</td>\n",
407
- " <td>4659352</td>\n",
408
- " <td>0.45</td>\n",
409
- " <td>0.975</td>\n",
410
- " <td>97</td>\n",
411
- " <td>4.29</td>\n",
412
- " <td>Kadang stok kosong saat jam ramai. Culpa vero ...</td>\n",
413
- " <td>0.573</td>\n",
414
  " <td>23</td>\n",
415
- " <td>23.58</td>\n",
416
- " <td>5.30</td>\n",
417
- " <td>Med</td>\n",
418
  " <td>16</td>\n",
 
 
419
  " </tr>\n",
420
  " <tr>\n",
421
  " <th>6</th>\n",
422
  " <td>7</td>\n",
423
- " <td>8564730</td>\n",
424
- " <td>27.85</td>\n",
425
- " <td>0.742</td>\n",
426
- " <td>127</td>\n",
427
- " <td>4.80</td>\n",
428
- " <td>Pelayanan cepat dan ramah, pesanan selalu tepa...</td>\n",
429
- " <td>0.089</td>\n",
430
  " <td>105</td>\n",
431
- " <td>15.01</td>\n",
432
- " <td>4.05</td>\n",
433
- " <td>Low</td>\n",
434
  " <td>6</td>\n",
 
 
435
  " </tr>\n",
436
  " <tr>\n",
437
  " <th>7</th>\n",
438
  " <td>8</td>\n",
439
- " <td>11098374</td>\n",
440
- " <td>23.78</td>\n",
441
- " <td>0.748</td>\n",
442
- " <td>196</td>\n",
443
  " <td>4.83</td>\n",
444
  " <td>Selalu repeat order karena kualitasnya terjaga.</td>\n",
445
- " <td>0.279</td>\n",
446
  " <td>124</td>\n",
447
- " <td>36.23</td>\n",
448
- " <td>6.89</td>\n",
449
  " <td>Low</td>\n",
450
  " <td>10</td>\n",
 
 
451
  " </tr>\n",
452
  " <tr>\n",
453
  " <th>8</th>\n",
454
  " <td>9</td>\n",
455
- " <td>10615528</td>\n",
456
- " <td>42.00</td>\n",
457
- " <td>0.608</td>\n",
458
- " <td>148</td>\n",
459
- " <td>4.89</td>\n",
460
  " <td>Selalu repeat order karena kualitasnya terjaga...</td>\n",
461
- " <td>0.290</td>\n",
462
  " <td>77</td>\n",
463
- " <td>23.53</td>\n",
464
- " <td>6.07</td>\n",
465
  " <td>Low</td>\n",
466
  " <td>7</td>\n",
 
 
467
  " </tr>\n",
468
  " <tr>\n",
469
  " <th>9</th>\n",
470
  " <td>10</td>\n",
471
- " <td>9610755</td>\n",
472
- " <td>6.22</td>\n",
473
- " <td>0.911</td>\n",
474
- " <td>144</td>\n",
475
- " <td>4.33</td>\n",
476
- " <td>Secara umum oke, hanya respon chat kadang lambat.</td>\n",
477
- " <td>0.469</td>\n",
478
  " <td>90</td>\n",
479
- " <td>28.84</td>\n",
480
- " <td>3.48</td>\n",
481
- " <td>Med</td>\n",
482
  " <td>9</td>\n",
 
 
483
  " </tr>\n",
484
  " </tbody>\n",
485
  "</table>\n",
@@ -487,64 +539,64 @@
487
  ],
488
  "text/plain": [
489
  " ID Monthly_Revenue Net_Profit_Margin (%) Burn_Rate_Ratio \\\n",
490
- "0 1 10746455 17.62 0.796 \n",
491
- "1 2 10026002 -15.23 1.059 \n",
492
- "2 3 1938056 11.88 0.886 \n",
493
- "3 4 8692714 13.52 0.837 \n",
494
- "4 5 3240963 -7.94 1.086 \n",
495
- "5 6 4659352 0.45 0.975 \n",
496
- "6 7 8564730 27.85 0.742 \n",
497
- "7 8 11098374 23.78 0.748 \n",
498
- "8 9 10615528 42.00 0.608 \n",
499
- "9 10 9610755 6.22 0.911 \n",
500
  "\n",
501
  " Transaction_Count Avg_Historical_Rating \\\n",
502
- "0 147 4.84 \n",
503
- "1 114 3.63 \n",
504
- "2 85 4.23 \n",
505
- "3 180 4.58 \n",
506
- "4 110 4.14 \n",
507
- "5 97 4.29 \n",
508
- "6 127 4.80 \n",
509
- "7 196 4.83 \n",
510
- "8 148 4.89 \n",
511
- "9 144 4.33 \n",
512
  "\n",
513
  " Review_Text Review_Volatility \\\n",
514
- "0 Produk cukup baik, kadang waktu tunggu agak la... 0.365 \n",
515
- "1 Harga dan kualitas seimbang, pengalaman biasa ... 0.516 \n",
516
- "2 Pelayanan standar, masih bisa ditingkatkan. 0.599 \n",
517
- "3 Transaksi digital lancar, proses checkout tida... 0.257 \n",
518
- "4 Harga naik tapi layanan tidak membaik. In ipsu... 0.570 \n",
519
- "5 Kadang stok kosong saat jam ramai. Culpa vero ... 0.573 \n",
520
- "6 Pelayanan cepat dan ramah, pesanan selalu tepa... 0.089 \n",
521
- "7 Selalu repeat order karena kualitasnya terjaga. 0.279 \n",
522
- "8 Selalu repeat order karena kualitasnya terjaga... 0.290 \n",
523
- "9 Secara umum oke, hanya respon chat kadang lambat. 0.469 \n",
524
  "\n",
525
  " Business_Tenure_Months Repeat_Order_Rate (%) Digital_Adoption_Score \\\n",
526
- "0 105 22.88 4.28 \n",
527
- "1 95 11.92 1.96 \n",
528
- "2 17 15.47 3.57 \n",
529
- "3 109 17.66 5.18 \n",
530
- "4 74 26.87 3.05 \n",
531
- "5 23 23.58 5.30 \n",
532
- "6 105 15.01 4.05 \n",
533
- "7 124 36.23 6.89 \n",
534
- "8 77 23.53 6.07 \n",
535
- "9 90 28.84 3.48 \n",
536
  "\n",
537
- " Peak_Hour_Latency Location_Competitiveness \n",
538
- "0 Med 9 \n",
539
- "1 Med 10 \n",
540
- "2 Med 8 \n",
541
- "3 Low 13 \n",
542
- "4 High 7 \n",
543
- "5 Med 16 \n",
544
- "6 Low 6 \n",
545
- "7 Low 10 \n",
546
- "8 Low 7 \n",
547
- "9 Med 9 "
548
  ]
549
  },
550
  "metadata": {},
@@ -623,7 +675,7 @@
623
  "type": "unknown"
624
  }
625
  ],
626
- "ref": "9fb3c49f-91bf-4bf9-b703-6128e1e23768",
627
  "rows": [
628
  [
629
  "ID",
@@ -645,13 +697,13 @@
645
  null,
646
  null,
647
  null,
648
- "9507346.17084",
649
- "5618037.298233727",
650
  "1500000.0",
651
- "5567141.5",
652
- "8227221.0",
653
- "11993633.75",
654
- "88583609.0"
655
  ],
656
  [
657
  "Net_Profit_Margin (%)",
@@ -659,13 +711,13 @@
659
  null,
660
  null,
661
  null,
662
- "16.939072733333333",
663
- "11.723970012130227",
664
- "-28.0",
665
- "9.2",
666
- "17.44",
667
- "25.17",
668
- "42.0"
669
  ],
670
  [
671
  "Burn_Rate_Ratio",
@@ -673,13 +725,13 @@
673
  null,
674
  null,
675
  null,
676
- "0.8190005333333332",
677
- "0.11181110886017835",
678
- "0.45",
679
- "0.741",
680
- "0.814",
681
- "0.892",
682
- "1.313"
683
  ],
684
  [
685
  "Transaction_Count",
@@ -687,13 +739,13 @@
687
  null,
688
  null,
689
  null,
690
- "132.14431333333334",
691
- "40.50054035384732",
692
- "27.0",
693
- "100.0",
694
- "132.0",
695
- "164.0",
696
- "271.0"
697
  ],
698
  [
699
  "Avg_Historical_Rating",
@@ -701,20 +753,20 @@
701
  null,
702
  null,
703
  null,
704
- "4.481031200000001",
705
- "0.3230444721883249",
706
- "1.8",
707
- "4.28",
708
- "4.5",
709
- "4.71",
710
  "5.0"
711
  ],
712
  [
713
  "Review_Text",
714
  "150000",
715
- "45329",
716
- "Selalu repeat order karena kualitasnya terjaga.",
717
- "8821",
718
  null,
719
  null,
720
  null,
@@ -729,13 +781,13 @@
729
  null,
730
  null,
731
  null,
732
- "0.3523363733333334",
733
- "0.143413424089409",
734
- "0.08",
735
- "0.243",
736
- "0.336",
737
- "0.449",
738
- "0.936"
739
  ],
740
  [
741
  "Business_Tenure_Months",
@@ -757,13 +809,13 @@
757
  null,
758
  null,
759
  null,
760
- "23.620190133333338",
761
- "7.042202711555729",
762
- "4.0",
763
- "18.87",
764
- "23.61",
765
- "28.38",
766
- "57.56"
767
  ],
768
  [
769
  "Digital_Adoption_Score",
@@ -771,20 +823,20 @@
771
  null,
772
  null,
773
  null,
774
- "3.6931592",
775
- "1.3665562444682455",
776
  "1.0",
777
- "2.73",
778
- "3.68",
779
- "4.62",
780
- "9.69"
781
  ],
782
  [
783
  "Peak_Hour_Latency",
784
  "150000",
785
  "3",
786
- "Low",
787
- "80107",
788
  null,
789
  null,
790
  null,
@@ -806,11 +858,39 @@
806
  "9.0",
807
  "11.0",
808
  "23.0"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
809
  ]
810
  ],
811
  "shape": {
812
  "columns": 11,
813
- "rows": 13
814
  }
815
  },
816
  "text/html": [
@@ -866,13 +946,13 @@
866
  " <td>NaN</td>\n",
867
  " <td>NaN</td>\n",
868
  " <td>NaN</td>\n",
869
- " <td>9507346.17084</td>\n",
870
- " <td>5618037.298234</td>\n",
871
  " <td>1500000.0</td>\n",
872
- " <td>5567141.5</td>\n",
873
- " <td>8227221.0</td>\n",
874
- " <td>11993633.75</td>\n",
875
- " <td>88583609.0</td>\n",
876
  " </tr>\n",
877
  " <tr>\n",
878
  " <th>Net_Profit_Margin (%)</th>\n",
@@ -880,13 +960,13 @@
880
  " <td>NaN</td>\n",
881
  " <td>NaN</td>\n",
882
  " <td>NaN</td>\n",
883
- " <td>16.939073</td>\n",
884
- " <td>11.72397</td>\n",
885
- " <td>-28.0</td>\n",
886
- " <td>9.2</td>\n",
887
- " <td>17.44</td>\n",
888
- " <td>25.17</td>\n",
889
- " <td>42.0</td>\n",
890
  " </tr>\n",
891
  " <tr>\n",
892
  " <th>Burn_Rate_Ratio</th>\n",
@@ -894,13 +974,13 @@
894
  " <td>NaN</td>\n",
895
  " <td>NaN</td>\n",
896
  " <td>NaN</td>\n",
897
- " <td>0.819001</td>\n",
898
- " <td>0.111811</td>\n",
899
- " <td>0.45</td>\n",
900
- " <td>0.741</td>\n",
901
- " <td>0.814</td>\n",
902
- " <td>0.892</td>\n",
903
- " <td>1.313</td>\n",
904
  " </tr>\n",
905
  " <tr>\n",
906
  " <th>Transaction_Count</th>\n",
@@ -908,13 +988,13 @@
908
  " <td>NaN</td>\n",
909
  " <td>NaN</td>\n",
910
  " <td>NaN</td>\n",
911
- " <td>132.144313</td>\n",
912
- " <td>40.50054</td>\n",
913
- " <td>27.0</td>\n",
914
- " <td>100.0</td>\n",
915
- " <td>132.0</td>\n",
916
- " <td>164.0</td>\n",
917
- " <td>271.0</td>\n",
918
  " </tr>\n",
919
  " <tr>\n",
920
  " <th>Avg_Historical_Rating</th>\n",
@@ -922,20 +1002,20 @@
922
  " <td>NaN</td>\n",
923
  " <td>NaN</td>\n",
924
  " <td>NaN</td>\n",
925
- " <td>4.481031</td>\n",
926
- " <td>0.323044</td>\n",
927
- " <td>1.8</td>\n",
928
- " <td>4.28</td>\n",
929
- " <td>4.5</td>\n",
930
- " <td>4.71</td>\n",
931
  " <td>5.0</td>\n",
932
  " </tr>\n",
933
  " <tr>\n",
934
  " <th>Review_Text</th>\n",
935
  " <td>150000</td>\n",
936
- " <td>45329</td>\n",
937
- " <td>Selalu repeat order karena kualitasnya terjaga.</td>\n",
938
- " <td>8821</td>\n",
939
  " <td>NaN</td>\n",
940
  " <td>NaN</td>\n",
941
  " <td>NaN</td>\n",
@@ -950,13 +1030,13 @@
950
  " <td>NaN</td>\n",
951
  " <td>NaN</td>\n",
952
  " <td>NaN</td>\n",
953
- " <td>0.352336</td>\n",
954
- " <td>0.143413</td>\n",
955
- " <td>0.08</td>\n",
956
- " <td>0.243</td>\n",
957
- " <td>0.336</td>\n",
958
- " <td>0.449</td>\n",
959
- " <td>0.936</td>\n",
960
  " </tr>\n",
961
  " <tr>\n",
962
  " <th>Business_Tenure_Months</th>\n",
@@ -978,13 +1058,13 @@
978
  " <td>NaN</td>\n",
979
  " <td>NaN</td>\n",
980
  " <td>NaN</td>\n",
981
- " <td>23.62019</td>\n",
982
- " <td>7.042203</td>\n",
983
- " <td>4.0</td>\n",
984
- " <td>18.87</td>\n",
985
- " <td>23.61</td>\n",
986
- " <td>28.38</td>\n",
987
- " <td>57.56</td>\n",
988
  " </tr>\n",
989
  " <tr>\n",
990
  " <th>Digital_Adoption_Score</th>\n",
@@ -992,20 +1072,20 @@
992
  " <td>NaN</td>\n",
993
  " <td>NaN</td>\n",
994
  " <td>NaN</td>\n",
995
- " <td>3.693159</td>\n",
996
- " <td>1.366556</td>\n",
997
  " <td>1.0</td>\n",
998
- " <td>2.73</td>\n",
999
- " <td>3.68</td>\n",
1000
- " <td>4.62</td>\n",
1001
- " <td>9.69</td>\n",
1002
  " </tr>\n",
1003
  " <tr>\n",
1004
  " <th>Peak_Hour_Latency</th>\n",
1005
  " <td>150000</td>\n",
1006
  " <td>3</td>\n",
1007
- " <td>Low</td>\n",
1008
- " <td>80107</td>\n",
1009
  " <td>NaN</td>\n",
1010
  " <td>NaN</td>\n",
1011
  " <td>NaN</td>\n",
@@ -1028,6 +1108,34 @@
1028
  " <td>11.0</td>\n",
1029
  " <td>23.0</td>\n",
1030
  " </tr>\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1031
  " </tbody>\n",
1032
  "</table>\n",
1033
  "</div>"
@@ -1040,62 +1148,84 @@
1040
  "Burn_Rate_Ratio 150000.0 NaN \n",
1041
  "Transaction_Count 150000.0 NaN \n",
1042
  "Avg_Historical_Rating 150000.0 NaN \n",
1043
- "Review_Text 150000 45329 \n",
1044
  "Review_Volatility 150000.0 NaN \n",
1045
  "Business_Tenure_Months 150000.0 NaN \n",
1046
  "Repeat_Order_Rate (%) 150000.0 NaN \n",
1047
  "Digital_Adoption_Score 150000.0 NaN \n",
1048
  "Peak_Hour_Latency 150000 3 \n",
1049
  "Location_Competitiveness 150000.0 NaN \n",
 
 
1050
  "\n",
1051
- " top \\\n",
1052
- "ID NaN \n",
1053
- "Monthly_Revenue NaN \n",
1054
- "Net_Profit_Margin (%) NaN \n",
1055
- "Burn_Rate_Ratio NaN \n",
1056
- "Transaction_Count NaN \n",
1057
- "Avg_Historical_Rating NaN \n",
1058
- "Review_Text Selalu repeat order karena kualitasnya terjaga. \n",
1059
- "Review_Volatility NaN \n",
1060
- "Business_Tenure_Months NaN \n",
1061
- "Repeat_Order_Rate (%) NaN \n",
1062
- "Digital_Adoption_Score NaN \n",
1063
- "Peak_Hour_Latency Low \n",
1064
- "Location_Competitiveness NaN \n",
 
 
1065
  "\n",
1066
- " freq mean std min \\\n",
1067
- "ID NaN 75000.5 43301.414527 1.0 \n",
1068
- "Monthly_Revenue NaN 9507346.17084 5618037.298234 1500000.0 \n",
1069
- "Net_Profit_Margin (%) NaN 16.939073 11.72397 -28.0 \n",
1070
- "Burn_Rate_Ratio NaN 0.819001 0.111811 0.45 \n",
1071
- "Transaction_Count NaN 132.144313 40.50054 27.0 \n",
1072
- "Avg_Historical_Rating NaN 4.481031 0.323044 1.8 \n",
1073
- "Review_Text 8821 NaN NaN NaN \n",
1074
- "Review_Volatility NaN 0.352336 0.143413 0.08 \n",
1075
- "Business_Tenure_Months NaN 91.00684 51.104736 3.0 \n",
1076
- "Repeat_Order_Rate (%) NaN 23.62019 7.042203 4.0 \n",
1077
- "Digital_Adoption_Score NaN 3.693159 1.366556 1.0 \n",
1078
- "Peak_Hour_Latency 80107 NaN NaN NaN \n",
1079
- "Location_Competitiveness NaN 8.998807 2.828602 1.0 \n",
 
 
1080
  "\n",
1081
- " 25% 50% 75% max \n",
1082
- "ID 37500.75 75000.5 112500.25 150000.0 \n",
1083
- "Monthly_Revenue 5567141.5 8227221.0 11993633.75 88583609.0 \n",
1084
- "Net_Profit_Margin (%) 9.2 17.44 25.17 42.0 \n",
1085
- "Burn_Rate_Ratio 0.741 0.814 0.892 1.313 \n",
1086
- "Transaction_Count 100.0 132.0 164.0 271.0 \n",
1087
- "Avg_Historical_Rating 4.28 4.5 4.71 5.0 \n",
1088
- "Review_Text NaN NaN NaN NaN \n",
1089
- "Review_Volatility 0.243 0.336 0.449 0.936 \n",
1090
- "Business_Tenure_Months 47.0 91.0 135.0 179.0 \n",
1091
- "Repeat_Order_Rate (%) 18.87 23.61 28.38 57.56 \n",
1092
- "Digital_Adoption_Score 2.73 3.68 4.62 9.69 \n",
1093
- "Peak_Hour_Latency NaN NaN NaN NaN \n",
1094
- "Location_Competitiveness 7.0 9.0 11.0 23.0 "
 
 
1095
  ]
1096
  },
1097
  "metadata": {},
1098
  "output_type": "display_data"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1099
  }
1100
  ],
1101
  "source": [
@@ -1168,28 +1298,65 @@
1168
  " return text\n",
1169
  "\n",
1170
  "\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1171
  "# 1) Business maturity and competitiveness\n",
1172
  "business_tenure = np.random.randint(3, 180, size=N_SAMPLES) # months\n",
1173
  "location_competitiveness = np.random.poisson(lam=8, size=N_SAMPLES) + 1\n",
1174
  "\n",
1175
  "# 2) Digital adoption (1-10), positively related with tenure (up to a limit)\n",
1176
- "base_digital = 3.5 + 0.02 * np.sqrt(business_tenure)\n",
1177
- "noise_digital = np.random.normal(0, 1.4, N_SAMPLES)\n",
1178
  "digital_adoption = clamp(base_digital + noise_digital, 1, 10)\n",
1179
  "\n",
1180
  "# 3) Transaction count depends on maturity, digital, and local competition\n",
1181
  "transaction_lambda = (\n",
1182
- " 55\n",
1183
- " + 0.7 * business_tenure\n",
1184
- " + 9.0 * digital_adoption\n",
1185
- " - 2.2 * location_competitiveness\n",
 
1186
  ")\n",
1187
  "transaction_lambda = clamp(transaction_lambda, 20, 900)\n",
1188
  "transaction_count = np.random.poisson(transaction_lambda).astype(int)\n",
1189
  "transaction_count = np.maximum(transaction_count, 5)\n",
1190
  "\n",
1191
  "# 4) Average order value (AOV) and monthly revenue\n",
1192
- "# Lognormal for realistic positive skew in monetary data\n",
1193
  "aov = np.random.lognormal(mean=np.log(65000), sigma=0.45, size=N_SAMPLES)\n",
1194
  "aov = clamp(aov, 12000, 450000)\n",
1195
  "\n",
@@ -1200,71 +1367,71 @@
1200
  "\n",
1201
  "# 5) Peak hour latency category influenced by transaction pressure and digital adoption\n",
1202
  "latency_score = (\n",
1203
- " 0.004 * transaction_count\n",
1204
- " - 0.25 * digital_adoption\n",
1205
- " + 0.08 * location_competitiveness\n",
1206
- " + np.random.normal(0, 0.8, N_SAMPLES)\n",
1207
  ")\n",
1208
  "\n",
1209
  "peak_hour_latency = np.where(\n",
1210
- " latency_score < 0.4,\n",
1211
  " \"Low\",\n",
1212
- " np.where(latency_score < 1.5, \"Med\", \"High\")\n",
1213
  ")\n",
1214
  "\n",
1215
- "# 6) Burn rate ratio (expense/revenue): worse with high competition and high latency\n",
1216
  "latency_penalty = np.select(\n",
1217
  " [peak_hour_latency == \"Low\", peak_hour_latency == \"Med\", peak_hour_latency == \"High\"],\n",
1218
- " [0.0, 0.08, 0.18],\n",
1219
- " default=0.08,\n",
1220
  ")\n",
1221
  "\n",
1222
  "burn_rate_ratio = (\n",
1223
- " 0.72\n",
1224
- " + 0.012 * location_competitiveness\n",
1225
- " - 0.015 * digital_adoption\n",
1226
  " + latency_penalty\n",
1227
- " + np.random.normal(0, 0.08, N_SAMPLES)\n",
1228
  ")\n",
1229
- "burn_rate_ratio = clamp(burn_rate_ratio, 0.45, 1.45)\n",
1230
  "\n",
1231
  "# 7) Net profit margin (%), inverse relation with burn rate\n",
1232
  "net_profit_margin = (\n",
1233
  " (1 - burn_rate_ratio) * 100\n",
1234
- " + 0.6 * (digital_adoption - 5)\n",
1235
- " - 0.15 * np.log1p(location_competitiveness)\n",
1236
- " + np.random.normal(0, 2.8, N_SAMPLES)\n",
1237
  ")\n",
1238
- "net_profit_margin = clamp(net_profit_margin, -28, 42)\n",
1239
  "\n",
1240
- "# 8) Repeat order rate (%), boosted by digital adoption, rating and tenure\n",
1241
  "repeat_order_rate = (\n",
1242
- " 18\n",
1243
- " + 2.0 * digital_adoption\n",
1244
- " + 0.035 * business_tenure\n",
1245
- " - 0.55 * location_competitiveness\n",
1246
- " + np.random.normal(0, 6.0, N_SAMPLES)\n",
1247
  ")\n",
1248
- "repeat_order_rate = clamp(repeat_order_rate, 4, 92)\n",
1249
  "\n",
1250
- "# 9) Review volatility: higher if latency high and margin under pressure\n",
1251
  "review_volatility = (\n",
1252
- " 0.25\n",
1253
  " + 0.18 * (peak_hour_latency == \"Med\").astype(float)\n",
1254
  " + 0.34 * (peak_hour_latency == \"High\").astype(float)\n",
1255
  " + 0.06 * (burn_rate_ratio > 1.0).astype(float)\n",
1256
- " + np.random.normal(0, 0.08, N_SAMPLES)\n",
1257
  ")\n",
1258
- "review_volatility = clamp(review_volatility, 0.08, 1.25)\n",
1259
  "\n",
1260
  "# 10) Average historical rating (1-5)\n",
1261
  "avg_historical_rating = (\n",
1262
- " 4.15\n",
1263
- " + 0.07 * digital_adoption\n",
1264
- " + 0.012 * net_profit_margin\n",
1265
- " - 0.32 * review_volatility\n",
1266
- " - 0.10 * (peak_hour_latency == \"High\").astype(float)\n",
1267
- " + np.random.normal(0, 0.22, N_SAMPLES)\n",
1268
  ")\n",
1269
  "avg_historical_rating = clamp(avg_historical_rating, 1.0, 5.0)\n",
1270
  "\n",
@@ -1274,8 +1441,47 @@
1274
  " for r, v, l in zip(avg_historical_rating, review_volatility, peak_hour_latency)\n",
1275
  "]\n",
1276
  "\n",
1277
- "# Final DataFrame\n",
1278
- "# Round values to more realistic reporting precision\n",
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1279
  "df = pd.DataFrame(\n",
1280
  " {\n",
1281
  " \"ID\": np.arange(1, N_SAMPLES + 1),\n",
@@ -1291,21 +1497,11 @@
1291
  " \"Digital_Adoption_Score\": np.round(digital_adoption, 2),\n",
1292
  " \"Peak_Hour_Latency\": peak_hour_latency,\n",
1293
  " \"Location_Competitiveness\": location_competitiveness.astype(int),\n",
 
 
1294
  " }\n",
1295
  ")\n",
1296
  "\n",
1297
- "# Optional: small post-adjustment to increase realism in deficit businesses\n",
1298
- "# If burn rate is very high, cap rating and repeat order more aggressively\n",
1299
- "deficit_mask = df[\"Burn_Rate_Ratio\"] > 1.15\n",
1300
- "df.loc[deficit_mask, \"Avg_Historical_Rating\"] = np.minimum(\n",
1301
- " df.loc[deficit_mask, \"Avg_Historical_Rating\"],\n",
1302
- " np.round(np.random.uniform(1.8, 3.6, deficit_mask.sum()), 2),\n",
1303
- ")\n",
1304
- "df.loc[deficit_mask, \"Repeat_Order_Rate (%)\"] = np.minimum(\n",
1305
- " df.loc[deficit_mask, \"Repeat_Order_Rate (%)\"],\n",
1306
- " np.round(np.random.uniform(6, 48, deficit_mask.sum()), 2),\n",
1307
- ")\n",
1308
- "\n",
1309
  "# Save and preview\n",
1310
  "df.to_csv(OUTPUT_CSV, index=False)\n",
1311
  "\n",
@@ -1314,7 +1510,10 @@
1314
  "display(df.head(10))\n",
1315
  "\n",
1316
  "print(\"\\nSummary stats:\")\n",
1317
- "display(df.describe(include=\"all\").transpose())"
 
 
 
1318
  ]
1319
  },
1320
  {
@@ -1322,15 +1521,157 @@
1322
  "id": "90ebddda",
1323
  "metadata": {},
1324
  "source": [
1325
- "## Dataset Description\n",
1326
- "Dokumentasi lengkap dataset tersedia di file `README.md` pada folder yang sama.\n",
1327
- "\n",
1328
- "Ringkasan isi dokumentasi:\n",
1329
- "- Tujuan dan konteks penggunaan data sintetis UMKM\n",
1330
- "- Definisi teknis tiap fitur (data dictionary)\n",
1331
- "- Logika sintesis dan asumsi hubungan antar variabel\n",
1332
- "- Karakteristik realisme, batasan dataset, dan reproducibility\n",
1333
- "- Contoh penggunaan untuk EDA, ML, dan NLP"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1334
  ]
1335
  }
1336
  ],
 
30
  },
31
  {
32
  "cell_type": "code",
33
+ "execution_count": 20,
34
  "id": "af962614",
35
  "metadata": {},
36
  "outputs": [
 
116
  "name": "Location_Competitiveness",
117
  "rawType": "int32",
118
  "type": "integer"
119
+ },
120
+ {
121
+ "name": "Sentiment_Score",
122
+ "rawType": "float64",
123
+ "type": "float"
124
+ },
125
+ {
126
+ "name": "Class",
127
+ "rawType": "object",
128
+ "type": "string"
129
  }
130
  ],
131
+ "ref": "e324e734-b4c6-4b99-8012-db2ed3fbd2fe",
132
  "rows": [
133
  [
134
  "0",
135
  "1",
136
+ "6680716",
137
+ "22.72",
138
+ "0.811",
139
+ "161",
140
+ "4.75",
141
+ "Transaksi digital lancar, proses checkout tidak ribet. Ad eius dolore qui.",
142
+ "0.313",
143
  "105",
144
+ "19.4",
145
+ "4.24",
146
+ "Low",
147
+ "9",
148
+ "-0.25",
149
+ "Growth"
150
  ],
151
  [
152
  "1",
153
  "2",
154
+ "5819101",
155
+ "4.46",
156
+ "0.968",
157
+ "104",
158
+ "4.21",
159
  "Harga dan kualitas seimbang, pengalaman biasa saja. Assumenda in adipisci dolor magnam ad dicta.",
160
+ "0.632",
161
  "95",
162
+ "14.87",
163
+ "1.27",
164
  "Med",
165
+ "10",
166
+ "0.0",
167
+ "Growth"
168
  ],
169
  [
170
  "2",
171
  "3",
172
+ "5236404",
173
+ "-10.12",
174
+ "1.047",
175
+ "102",
176
+ "3.51",
177
  "Pelayanan standar, masih bisa ditingkatkan.",
178
+ "0.47",
179
  "17",
180
+ "21.0",
181
+ "3.37",
182
  "Med",
183
+ "8",
184
+ "0.0",
185
+ "Struggling"
186
  ],
187
  [
188
  "3",
189
  "4",
190
+ "8043552",
191
+ "0.04",
192
+ "0.969",
193
+ "99",
194
+ "4.33",
195
  "Transaksi digital lancar, proses checkout tidak ribet.",
196
+ "0.206",
197
  "109",
198
+ "30.62",
199
+ "5.41",
200
  "Low",
201
+ "13",
202
+ "-0.25",
203
+ "Growth"
204
  ],
205
  [
206
  "4",
207
  "5",
208
+ "6071256",
209
+ "4.22",
210
+ "0.954",
211
+ "115",
212
+ "4.34",
213
+ "Selalu repeat order karena kualitasnya terjaga. In ipsum eius sit quis cum in.",
214
+ "0.232",
215
  "74",
216
+ "20.87",
217
+ "2.67",
218
+ "Low",
219
+ "7",
220
+ "0.25",
221
+ "Growth"
222
  ],
223
  [
224
  "5",
225
  "6",
226
+ "6683141",
227
+ "29.68",
228
+ "0.727",
229
+ "108",
230
+ "4.54",
231
+ "Pengiriman cepat, admin komunikatif. Culpa vero excepturi at atque.",
232
+ "0.185",
233
  "23",
234
+ "26.35",
235
+ "5.59",
236
+ "Low",
237
+ "16",
238
+ "0.55",
239
+ "Elite"
240
  ],
241
  [
242
  "6",
243
  "7",
244
+ "14123932",
245
+ "15.28",
246
+ "0.86",
247
+ "167",
248
+ "4.54",
249
+ "Produk cukup baik, kadang waktu tunggu agak lama. Nobis rem quas modi voluptate fugiat.",
250
+ "0.434",
251
  "105",
252
+ "22.15",
253
+ "3.95",
254
+ "Med",
255
+ "6",
256
+ "0.0",
257
+ "Growth"
258
  ],
259
  [
260
  "7",
261
  "8",
262
+ "8483571",
263
+ "8.51",
264
+ "0.862",
265
+ "180",
266
  "4.83",
267
  "Selalu repeat order karena kualitasnya terjaga.",
268
+ "0.346",
269
  "124",
270
+ "23.17",
271
+ "7.59",
272
  "Low",
273
+ "10",
274
+ "0.25",
275
+ "Growth"
276
  ],
277
  [
278
  "8",
279
  "9",
280
+ "14900709",
281
+ "6.0",
282
+ "0.908",
283
+ "135",
284
+ "4.86",
285
  "Selalu repeat order karena kualitasnya terjaga. Eos occaecati suscipit facere deleniti architecto optio.",
286
+ "0.285",
287
  "77",
288
+ "15.85",
289
+ "6.56",
290
  "Low",
291
+ "7",
292
+ "0.25",
293
+ "Growth"
294
  ],
295
  [
296
  "9",
297
  "10",
298
+ "9232562",
299
+ "-13.64",
300
+ "1.085",
301
+ "89",
302
+ "4.39",
303
+ "Transaksi digital lancar, proses checkout tidak ribet.",
304
+ "0.182",
305
  "90",
306
+ "17.3",
307
+ "3.22",
308
+ "Low",
309
+ "9",
310
+ "-0.25",
311
+ "Struggling"
312
  ]
313
  ],
314
  "shape": {
315
+ "columns": 15,
316
  "rows": 10
317
  }
318
  },
 
348
  " <th>Digital_Adoption_Score</th>\n",
349
  " <th>Peak_Hour_Latency</th>\n",
350
  " <th>Location_Competitiveness</th>\n",
351
+ " <th>Sentiment_Score</th>\n",
352
+ " <th>Class</th>\n",
353
  " </tr>\n",
354
  " </thead>\n",
355
  " <tbody>\n",
356
  " <tr>\n",
357
  " <th>0</th>\n",
358
  " <td>1</td>\n",
359
+ " <td>6680716</td>\n",
360
+ " <td>22.72</td>\n",
361
+ " <td>0.811</td>\n",
362
+ " <td>161</td>\n",
363
+ " <td>4.75</td>\n",
364
+ " <td>Transaksi digital lancar, proses checkout tida...</td>\n",
365
+ " <td>0.313</td>\n",
366
  " <td>105</td>\n",
367
+ " <td>19.40</td>\n",
368
+ " <td>4.24</td>\n",
369
+ " <td>Low</td>\n",
370
  " <td>9</td>\n",
371
+ " <td>-0.25</td>\n",
372
+ " <td>Growth</td>\n",
373
  " </tr>\n",
374
  " <tr>\n",
375
  " <th>1</th>\n",
376
  " <td>2</td>\n",
377
+ " <td>5819101</td>\n",
378
+ " <td>4.46</td>\n",
379
+ " <td>0.968</td>\n",
380
+ " <td>104</td>\n",
381
+ " <td>4.21</td>\n",
382
  " <td>Harga dan kualitas seimbang, pengalaman biasa ...</td>\n",
383
+ " <td>0.632</td>\n",
384
  " <td>95</td>\n",
385
+ " <td>14.87</td>\n",
386
+ " <td>1.27</td>\n",
387
  " <td>Med</td>\n",
388
  " <td>10</td>\n",
389
+ " <td>0.00</td>\n",
390
+ " <td>Growth</td>\n",
391
  " </tr>\n",
392
  " <tr>\n",
393
  " <th>2</th>\n",
394
  " <td>3</td>\n",
395
+ " <td>5236404</td>\n",
396
+ " <td>-10.12</td>\n",
397
+ " <td>1.047</td>\n",
398
+ " <td>102</td>\n",
399
+ " <td>3.51</td>\n",
400
  " <td>Pelayanan standar, masih bisa ditingkatkan.</td>\n",
401
+ " <td>0.470</td>\n",
402
  " <td>17</td>\n",
403
+ " <td>21.00</td>\n",
404
+ " <td>3.37</td>\n",
405
  " <td>Med</td>\n",
406
  " <td>8</td>\n",
407
+ " <td>0.00</td>\n",
408
+ " <td>Struggling</td>\n",
409
  " </tr>\n",
410
  " <tr>\n",
411
  " <th>3</th>\n",
412
  " <td>4</td>\n",
413
+ " <td>8043552</td>\n",
414
+ " <td>0.04</td>\n",
415
+ " <td>0.969</td>\n",
416
+ " <td>99</td>\n",
417
+ " <td>4.33</td>\n",
418
  " <td>Transaksi digital lancar, proses checkout tida...</td>\n",
419
+ " <td>0.206</td>\n",
420
  " <td>109</td>\n",
421
+ " <td>30.62</td>\n",
422
+ " <td>5.41</td>\n",
423
  " <td>Low</td>\n",
424
  " <td>13</td>\n",
425
+ " <td>-0.25</td>\n",
426
+ " <td>Growth</td>\n",
427
  " </tr>\n",
428
  " <tr>\n",
429
  " <th>4</th>\n",
430
  " <td>5</td>\n",
431
+ " <td>6071256</td>\n",
432
+ " <td>4.22</td>\n",
433
+ " <td>0.954</td>\n",
434
+ " <td>115</td>\n",
435
+ " <td>4.34</td>\n",
436
+ " <td>Selalu repeat order karena kualitasnya terjaga...</td>\n",
437
+ " <td>0.232</td>\n",
438
  " <td>74</td>\n",
439
+ " <td>20.87</td>\n",
440
+ " <td>2.67</td>\n",
441
+ " <td>Low</td>\n",
442
  " <td>7</td>\n",
443
+ " <td>0.25</td>\n",
444
+ " <td>Growth</td>\n",
445
  " </tr>\n",
446
  " <tr>\n",
447
  " <th>5</th>\n",
448
  " <td>6</td>\n",
449
+ " <td>6683141</td>\n",
450
+ " <td>29.68</td>\n",
451
+ " <td>0.727</td>\n",
452
+ " <td>108</td>\n",
453
+ " <td>4.54</td>\n",
454
+ " <td>Pengiriman cepat, admin komunikatif. Culpa ver...</td>\n",
455
+ " <td>0.185</td>\n",
456
  " <td>23</td>\n",
457
+ " <td>26.35</td>\n",
458
+ " <td>5.59</td>\n",
459
+ " <td>Low</td>\n",
460
  " <td>16</td>\n",
461
+ " <td>0.55</td>\n",
462
+ " <td>Elite</td>\n",
463
  " </tr>\n",
464
  " <tr>\n",
465
  " <th>6</th>\n",
466
  " <td>7</td>\n",
467
+ " <td>14123932</td>\n",
468
+ " <td>15.28</td>\n",
469
+ " <td>0.860</td>\n",
470
+ " <td>167</td>\n",
471
+ " <td>4.54</td>\n",
472
+ " <td>Produk cukup baik, kadang waktu tunggu agak la...</td>\n",
473
+ " <td>0.434</td>\n",
474
  " <td>105</td>\n",
475
+ " <td>22.15</td>\n",
476
+ " <td>3.95</td>\n",
477
+ " <td>Med</td>\n",
478
  " <td>6</td>\n",
479
+ " <td>0.00</td>\n",
480
+ " <td>Growth</td>\n",
481
  " </tr>\n",
482
  " <tr>\n",
483
  " <th>7</th>\n",
484
  " <td>8</td>\n",
485
+ " <td>8483571</td>\n",
486
+ " <td>8.51</td>\n",
487
+ " <td>0.862</td>\n",
488
+ " <td>180</td>\n",
489
  " <td>4.83</td>\n",
490
  " <td>Selalu repeat order karena kualitasnya terjaga.</td>\n",
491
+ " <td>0.346</td>\n",
492
  " <td>124</td>\n",
493
+ " <td>23.17</td>\n",
494
+ " <td>7.59</td>\n",
495
  " <td>Low</td>\n",
496
  " <td>10</td>\n",
497
+ " <td>0.25</td>\n",
498
+ " <td>Growth</td>\n",
499
  " </tr>\n",
500
  " <tr>\n",
501
  " <th>8</th>\n",
502
  " <td>9</td>\n",
503
+ " <td>14900709</td>\n",
504
+ " <td>6.00</td>\n",
505
+ " <td>0.908</td>\n",
506
+ " <td>135</td>\n",
507
+ " <td>4.86</td>\n",
508
  " <td>Selalu repeat order karena kualitasnya terjaga...</td>\n",
509
+ " <td>0.285</td>\n",
510
  " <td>77</td>\n",
511
+ " <td>15.85</td>\n",
512
+ " <td>6.56</td>\n",
513
  " <td>Low</td>\n",
514
  " <td>7</td>\n",
515
+ " <td>0.25</td>\n",
516
+ " <td>Growth</td>\n",
517
  " </tr>\n",
518
  " <tr>\n",
519
  " <th>9</th>\n",
520
  " <td>10</td>\n",
521
+ " <td>9232562</td>\n",
522
+ " <td>-13.64</td>\n",
523
+ " <td>1.085</td>\n",
524
+ " <td>89</td>\n",
525
+ " <td>4.39</td>\n",
526
+ " <td>Transaksi digital lancar, proses checkout tida...</td>\n",
527
+ " <td>0.182</td>\n",
528
  " <td>90</td>\n",
529
+ " <td>17.30</td>\n",
530
+ " <td>3.22</td>\n",
531
+ " <td>Low</td>\n",
532
  " <td>9</td>\n",
533
+ " <td>-0.25</td>\n",
534
+ " <td>Struggling</td>\n",
535
  " </tr>\n",
536
  " </tbody>\n",
537
  "</table>\n",
 
539
  ],
540
  "text/plain": [
541
  " ID Monthly_Revenue Net_Profit_Margin (%) Burn_Rate_Ratio \\\n",
542
+ "0 1 6680716 22.72 0.811 \n",
543
+ "1 2 5819101 4.46 0.968 \n",
544
+ "2 3 5236404 -10.12 1.047 \n",
545
+ "3 4 8043552 0.04 0.969 \n",
546
+ "4 5 6071256 4.22 0.954 \n",
547
+ "5 6 6683141 29.68 0.727 \n",
548
+ "6 7 14123932 15.28 0.860 \n",
549
+ "7 8 8483571 8.51 0.862 \n",
550
+ "8 9 14900709 6.00 0.908 \n",
551
+ "9 10 9232562 -13.64 1.085 \n",
552
  "\n",
553
  " Transaction_Count Avg_Historical_Rating \\\n",
554
+ "0 161 4.75 \n",
555
+ "1 104 4.21 \n",
556
+ "2 102 3.51 \n",
557
+ "3 99 4.33 \n",
558
+ "4 115 4.34 \n",
559
+ "5 108 4.54 \n",
560
+ "6 167 4.54 \n",
561
+ "7 180 4.83 \n",
562
+ "8 135 4.86 \n",
563
+ "9 89 4.39 \n",
564
  "\n",
565
  " Review_Text Review_Volatility \\\n",
566
+ "0 Transaksi digital lancar, proses checkout tida... 0.313 \n",
567
+ "1 Harga dan kualitas seimbang, pengalaman biasa ... 0.632 \n",
568
+ "2 Pelayanan standar, masih bisa ditingkatkan. 0.470 \n",
569
+ "3 Transaksi digital lancar, proses checkout tida... 0.206 \n",
570
+ "4 Selalu repeat order karena kualitasnya terjaga... 0.232 \n",
571
+ "5 Pengiriman cepat, admin komunikatif. Culpa ver... 0.185 \n",
572
+ "6 Produk cukup baik, kadang waktu tunggu agak la... 0.434 \n",
573
+ "7 Selalu repeat order karena kualitasnya terjaga. 0.346 \n",
574
+ "8 Selalu repeat order karena kualitasnya terjaga... 0.285 \n",
575
+ "9 Transaksi digital lancar, proses checkout tida... 0.182 \n",
576
  "\n",
577
  " Business_Tenure_Months Repeat_Order_Rate (%) Digital_Adoption_Score \\\n",
578
+ "0 105 19.40 4.24 \n",
579
+ "1 95 14.87 1.27 \n",
580
+ "2 17 21.00 3.37 \n",
581
+ "3 109 30.62 5.41 \n",
582
+ "4 74 20.87 2.67 \n",
583
+ "5 23 26.35 5.59 \n",
584
+ "6 105 22.15 3.95 \n",
585
+ "7 124 23.17 7.59 \n",
586
+ "8 77 15.85 6.56 \n",
587
+ "9 90 17.30 3.22 \n",
588
  "\n",
589
+ " Peak_Hour_Latency Location_Competitiveness Sentiment_Score Class \n",
590
+ "0 Low 9 -0.25 Growth \n",
591
+ "1 Med 10 0.00 Growth \n",
592
+ "2 Med 8 0.00 Struggling \n",
593
+ "3 Low 13 -0.25 Growth \n",
594
+ "4 Low 7 0.25 Growth \n",
595
+ "5 Low 16 0.55 Elite \n",
596
+ "6 Med 6 0.00 Growth \n",
597
+ "7 Low 10 0.25 Growth \n",
598
+ "8 Low 7 0.25 Growth \n",
599
+ "9 Low 9 -0.25 Struggling "
600
  ]
601
  },
602
  "metadata": {},
 
675
  "type": "unknown"
676
  }
677
  ],
678
+ "ref": "d8e517b0-a5d5-456e-ade6-4559283eed4c",
679
  "rows": [
680
  [
681
  "ID",
 
697
  null,
698
  null,
699
  null,
700
+ "8451726.379766667",
701
+ "5291163.126671218",
702
  "1500000.0",
703
+ "4745883.75",
704
+ "7245678.5",
705
+ "10830255.25",
706
+ "82067536.0"
707
  ],
708
  [
709
  "Net_Profit_Margin (%)",
 
711
  null,
712
  null,
713
  null,
714
+ "1.8422716666666668",
715
+ "15.002406129333442",
716
+ "-35.0",
717
+ "-8.43",
718
+ "2.16",
719
+ "12.31",
720
+ "45.0"
721
  ],
722
  [
723
  "Burn_Rate_Ratio",
 
725
  null,
726
  null,
727
  null,
728
+ "0.9698845333333335",
729
+ "0.14403925496022033",
730
+ "0.437",
731
+ "0.869",
732
+ "0.966",
733
+ "1.067",
734
+ "1.55"
735
  ],
736
  [
737
  "Transaction_Count",
 
739
  null,
740
  null,
741
  null,
742
+ "117.76666666666667",
743
+ "42.61849251746928",
744
+ "9.0",
745
+ "86.0",
746
+ "117.0",
747
+ "149.0",
748
+ "285.0"
749
  ],
750
  [
751
  "Avg_Historical_Rating",
 
753
  null,
754
  null,
755
  null,
756
+ "4.061106533333334",
757
+ "0.5216979171021869",
758
+ "1.5",
759
+ "3.77",
760
+ "4.1",
761
+ "4.41",
762
  "5.0"
763
  ],
764
  [
765
  "Review_Text",
766
  "150000",
767
+ "45139",
768
+ "Produk cukup baik, kadang waktu tunggu agak lama.",
769
+ "11632",
770
  null,
771
  null,
772
  null,
 
781
  null,
782
  null,
783
  null,
784
+ "0.4072028",
785
+ "0.16680582218068832",
786
+ "0.06",
787
+ "0.278",
788
+ "0.405",
789
+ "0.526",
790
+ "0.99"
791
  ],
792
  [
793
  "Business_Tenure_Months",
 
809
  null,
810
  null,
811
  null,
812
+ "19.98052113333334",
813
+ "8.021928124041764",
814
+ "2.0",
815
+ "14.45",
816
+ "19.95",
817
+ "25.43",
818
+ "54.06"
819
  ],
820
  [
821
  "Digital_Adoption_Score",
 
823
  null,
824
  null,
825
  null,
826
+ "3.5468941333333333",
827
+ "1.670303095351794",
828
  "1.0",
829
+ "2.26",
830
+ "3.48",
831
+ "4.69",
832
+ "10.0"
833
  ],
834
  [
835
  "Peak_Hour_Latency",
836
  "150000",
837
  "3",
838
+ "Med",
839
+ "68695",
840
  null,
841
  null,
842
  null,
 
858
  "9.0",
859
  "11.0",
860
  "23.0"
861
+ ],
862
+ [
863
+ "Sentiment_Score",
864
+ "150000.0",
865
+ null,
866
+ null,
867
+ null,
868
+ "-0.018946333333333332",
869
+ "0.32053378095387564",
870
+ "-0.65",
871
+ "-0.25",
872
+ "0.0",
873
+ "0.0",
874
+ "0.8"
875
+ ],
876
+ [
877
+ "Class",
878
+ "150000",
879
+ "4",
880
+ "Growth",
881
+ "85678",
882
+ null,
883
+ null,
884
+ null,
885
+ null,
886
+ null,
887
+ null,
888
+ null
889
  ]
890
  ],
891
  "shape": {
892
  "columns": 11,
893
+ "rows": 15
894
  }
895
  },
896
  "text/html": [
 
946
  " <td>NaN</td>\n",
947
  " <td>NaN</td>\n",
948
  " <td>NaN</td>\n",
949
+ " <td>8451726.379767</td>\n",
950
+ " <td>5291163.126671</td>\n",
951
  " <td>1500000.0</td>\n",
952
+ " <td>4745883.75</td>\n",
953
+ " <td>7245678.5</td>\n",
954
+ " <td>10830255.25</td>\n",
955
+ " <td>82067536.0</td>\n",
956
  " </tr>\n",
957
  " <tr>\n",
958
  " <th>Net_Profit_Margin (%)</th>\n",
 
960
  " <td>NaN</td>\n",
961
  " <td>NaN</td>\n",
962
  " <td>NaN</td>\n",
963
+ " <td>1.842272</td>\n",
964
+ " <td>15.002406</td>\n",
965
+ " <td>-35.0</td>\n",
966
+ " <td>-8.43</td>\n",
967
+ " <td>2.16</td>\n",
968
+ " <td>12.31</td>\n",
969
+ " <td>45.0</td>\n",
970
  " </tr>\n",
971
  " <tr>\n",
972
  " <th>Burn_Rate_Ratio</th>\n",
 
974
  " <td>NaN</td>\n",
975
  " <td>NaN</td>\n",
976
  " <td>NaN</td>\n",
977
+ " <td>0.969885</td>\n",
978
+ " <td>0.144039</td>\n",
979
+ " <td>0.437</td>\n",
980
+ " <td>0.869</td>\n",
981
+ " <td>0.966</td>\n",
982
+ " <td>1.067</td>\n",
983
+ " <td>1.55</td>\n",
984
  " </tr>\n",
985
  " <tr>\n",
986
  " <th>Transaction_Count</th>\n",
 
988
  " <td>NaN</td>\n",
989
  " <td>NaN</td>\n",
990
  " <td>NaN</td>\n",
991
+ " <td>117.766667</td>\n",
992
+ " <td>42.618493</td>\n",
993
+ " <td>9.0</td>\n",
994
+ " <td>86.0</td>\n",
995
+ " <td>117.0</td>\n",
996
+ " <td>149.0</td>\n",
997
+ " <td>285.0</td>\n",
998
  " </tr>\n",
999
  " <tr>\n",
1000
  " <th>Avg_Historical_Rating</th>\n",
 
1002
  " <td>NaN</td>\n",
1003
  " <td>NaN</td>\n",
1004
  " <td>NaN</td>\n",
1005
+ " <td>4.061107</td>\n",
1006
+ " <td>0.521698</td>\n",
1007
+ " <td>1.5</td>\n",
1008
+ " <td>3.77</td>\n",
1009
+ " <td>4.1</td>\n",
1010
+ " <td>4.41</td>\n",
1011
  " <td>5.0</td>\n",
1012
  " </tr>\n",
1013
  " <tr>\n",
1014
  " <th>Review_Text</th>\n",
1015
  " <td>150000</td>\n",
1016
+ " <td>45139</td>\n",
1017
+ " <td>Produk cukup baik, kadang waktu tunggu agak lama.</td>\n",
1018
+ " <td>11632</td>\n",
1019
  " <td>NaN</td>\n",
1020
  " <td>NaN</td>\n",
1021
  " <td>NaN</td>\n",
 
1030
  " <td>NaN</td>\n",
1031
  " <td>NaN</td>\n",
1032
  " <td>NaN</td>\n",
1033
+ " <td>0.407203</td>\n",
1034
+ " <td>0.166806</td>\n",
1035
+ " <td>0.06</td>\n",
1036
+ " <td>0.278</td>\n",
1037
+ " <td>0.405</td>\n",
1038
+ " <td>0.526</td>\n",
1039
+ " <td>0.99</td>\n",
1040
  " </tr>\n",
1041
  " <tr>\n",
1042
  " <th>Business_Tenure_Months</th>\n",
 
1058
  " <td>NaN</td>\n",
1059
  " <td>NaN</td>\n",
1060
  " <td>NaN</td>\n",
1061
+ " <td>19.980521</td>\n",
1062
+ " <td>8.021928</td>\n",
1063
+ " <td>2.0</td>\n",
1064
+ " <td>14.45</td>\n",
1065
+ " <td>19.95</td>\n",
1066
+ " <td>25.43</td>\n",
1067
+ " <td>54.06</td>\n",
1068
  " </tr>\n",
1069
  " <tr>\n",
1070
  " <th>Digital_Adoption_Score</th>\n",
 
1072
  " <td>NaN</td>\n",
1073
  " <td>NaN</td>\n",
1074
  " <td>NaN</td>\n",
1075
+ " <td>3.546894</td>\n",
1076
+ " <td>1.670303</td>\n",
1077
  " <td>1.0</td>\n",
1078
+ " <td>2.26</td>\n",
1079
+ " <td>3.48</td>\n",
1080
+ " <td>4.69</td>\n",
1081
+ " <td>10.0</td>\n",
1082
  " </tr>\n",
1083
  " <tr>\n",
1084
  " <th>Peak_Hour_Latency</th>\n",
1085
  " <td>150000</td>\n",
1086
  " <td>3</td>\n",
1087
+ " <td>Med</td>\n",
1088
+ " <td>68695</td>\n",
1089
  " <td>NaN</td>\n",
1090
  " <td>NaN</td>\n",
1091
  " <td>NaN</td>\n",
 
1108
  " <td>11.0</td>\n",
1109
  " <td>23.0</td>\n",
1110
  " </tr>\n",
1111
+ " <tr>\n",
1112
+ " <th>Sentiment_Score</th>\n",
1113
+ " <td>150000.0</td>\n",
1114
+ " <td>NaN</td>\n",
1115
+ " <td>NaN</td>\n",
1116
+ " <td>NaN</td>\n",
1117
+ " <td>-0.018946</td>\n",
1118
+ " <td>0.320534</td>\n",
1119
+ " <td>-0.65</td>\n",
1120
+ " <td>-0.25</td>\n",
1121
+ " <td>0.0</td>\n",
1122
+ " <td>0.0</td>\n",
1123
+ " <td>0.8</td>\n",
1124
+ " </tr>\n",
1125
+ " <tr>\n",
1126
+ " <th>Class</th>\n",
1127
+ " <td>150000</td>\n",
1128
+ " <td>4</td>\n",
1129
+ " <td>Growth</td>\n",
1130
+ " <td>85678</td>\n",
1131
+ " <td>NaN</td>\n",
1132
+ " <td>NaN</td>\n",
1133
+ " <td>NaN</td>\n",
1134
+ " <td>NaN</td>\n",
1135
+ " <td>NaN</td>\n",
1136
+ " <td>NaN</td>\n",
1137
+ " <td>NaN</td>\n",
1138
+ " </tr>\n",
1139
  " </tbody>\n",
1140
  "</table>\n",
1141
  "</div>"
 
1148
  "Burn_Rate_Ratio 150000.0 NaN \n",
1149
  "Transaction_Count 150000.0 NaN \n",
1150
  "Avg_Historical_Rating 150000.0 NaN \n",
1151
+ "Review_Text 150000 45139 \n",
1152
  "Review_Volatility 150000.0 NaN \n",
1153
  "Business_Tenure_Months 150000.0 NaN \n",
1154
  "Repeat_Order_Rate (%) 150000.0 NaN \n",
1155
  "Digital_Adoption_Score 150000.0 NaN \n",
1156
  "Peak_Hour_Latency 150000 3 \n",
1157
  "Location_Competitiveness 150000.0 NaN \n",
1158
+ "Sentiment_Score 150000.0 NaN \n",
1159
+ "Class 150000 4 \n",
1160
  "\n",
1161
+ " top \\\n",
1162
+ "ID NaN \n",
1163
+ "Monthly_Revenue NaN \n",
1164
+ "Net_Profit_Margin (%) NaN \n",
1165
+ "Burn_Rate_Ratio NaN \n",
1166
+ "Transaction_Count NaN \n",
1167
+ "Avg_Historical_Rating NaN \n",
1168
+ "Review_Text Produk cukup baik, kadang waktu tunggu agak lama. \n",
1169
+ "Review_Volatility NaN \n",
1170
+ "Business_Tenure_Months NaN \n",
1171
+ "Repeat_Order_Rate (%) NaN \n",
1172
+ "Digital_Adoption_Score NaN \n",
1173
+ "Peak_Hour_Latency Med \n",
1174
+ "Location_Competitiveness NaN \n",
1175
+ "Sentiment_Score NaN \n",
1176
+ "Class Growth \n",
1177
  "\n",
1178
+ " freq mean std min \\\n",
1179
+ "ID NaN 75000.5 43301.414527 1.0 \n",
1180
+ "Monthly_Revenue NaN 8451726.379767 5291163.126671 1500000.0 \n",
1181
+ "Net_Profit_Margin (%) NaN 1.842272 15.002406 -35.0 \n",
1182
+ "Burn_Rate_Ratio NaN 0.969885 0.144039 0.437 \n",
1183
+ "Transaction_Count NaN 117.766667 42.618493 9.0 \n",
1184
+ "Avg_Historical_Rating NaN 4.061107 0.521698 1.5 \n",
1185
+ "Review_Text 11632 NaN NaN NaN \n",
1186
+ "Review_Volatility NaN 0.407203 0.166806 0.06 \n",
1187
+ "Business_Tenure_Months NaN 91.00684 51.104736 3.0 \n",
1188
+ "Repeat_Order_Rate (%) NaN 19.980521 8.021928 2.0 \n",
1189
+ "Digital_Adoption_Score NaN 3.546894 1.670303 1.0 \n",
1190
+ "Peak_Hour_Latency 68695 NaN NaN NaN \n",
1191
+ "Location_Competitiveness NaN 8.998807 2.828602 1.0 \n",
1192
+ "Sentiment_Score NaN -0.018946 0.320534 -0.65 \n",
1193
+ "Class 85678 NaN NaN NaN \n",
1194
  "\n",
1195
+ " 25% 50% 75% max \n",
1196
+ "ID 37500.75 75000.5 112500.25 150000.0 \n",
1197
+ "Monthly_Revenue 4745883.75 7245678.5 10830255.25 82067536.0 \n",
1198
+ "Net_Profit_Margin (%) -8.43 2.16 12.31 45.0 \n",
1199
+ "Burn_Rate_Ratio 0.869 0.966 1.067 1.55 \n",
1200
+ "Transaction_Count 86.0 117.0 149.0 285.0 \n",
1201
+ "Avg_Historical_Rating 3.77 4.1 4.41 5.0 \n",
1202
+ "Review_Text NaN NaN NaN NaN \n",
1203
+ "Review_Volatility 0.278 0.405 0.526 0.99 \n",
1204
+ "Business_Tenure_Months 47.0 91.0 135.0 179.0 \n",
1205
+ "Repeat_Order_Rate (%) 14.45 19.95 25.43 54.06 \n",
1206
+ "Digital_Adoption_Score 2.26 3.48 4.69 10.0 \n",
1207
+ "Peak_Hour_Latency NaN NaN NaN NaN \n",
1208
+ "Location_Competitiveness 7.0 9.0 11.0 23.0 \n",
1209
+ "Sentiment_Score -0.25 0.0 0.0 0.8 \n",
1210
+ "Class NaN NaN NaN NaN "
1211
  ]
1212
  },
1213
  "metadata": {},
1214
  "output_type": "display_data"
1215
+ },
1216
+ {
1217
+ "name": "stdout",
1218
+ "output_type": "stream",
1219
+ "text": [
1220
+ "\n",
1221
+ "Class counts:\n",
1222
+ "Class\n",
1223
+ "Growth 85678\n",
1224
+ "Struggling 41571\n",
1225
+ "Critical 12561\n",
1226
+ "Elite 10190\n",
1227
+ "Name: count, dtype: int64\n"
1228
+ ]
1229
  }
1230
  ],
1231
  "source": [
 
1298
  " return text\n",
1299
  "\n",
1300
  "\n",
1301
+ "def calculate_sentiment_score(review_text: str) -> float:\n",
1302
+ " \"\"\"Convert review text into sentiment score in range [-1.0, 1.0].\"\"\"\n",
1303
+ " review_lower = review_text.lower()\n",
1304
+ "\n",
1305
+ " positive_keywords = {\n",
1306
+ " \"cepat\": 0.30,\n",
1307
+ " \"ramah\": 0.30,\n",
1308
+ " \"mudah\": 0.25,\n",
1309
+ " \"responsif\": 0.30,\n",
1310
+ " \"lancar\": 0.25,\n",
1311
+ " \"komunikatif\": 0.25,\n",
1312
+ " \"terjaga\": 0.25,\n",
1313
+ " \"konsisten\": 0.20,\n",
1314
+ " \"tepat\": 0.20,\n",
1315
+ " }\n",
1316
+ " negative_keywords = {\n",
1317
+ " \"lambat\": -0.30,\n",
1318
+ " \"tidak\": -0.20,\n",
1319
+ " \"kurang\": -0.25,\n",
1320
+ " \"bermasalah\": -0.35,\n",
1321
+ " \"terlambat\": -0.35,\n",
1322
+ " \"ribet\": -0.30,\n",
1323
+ " \"buruk\": -0.40,\n",
1324
+ " \"menurun\": -0.30,\n",
1325
+ " }\n",
1326
+ "\n",
1327
+ " score = 0.0\n",
1328
+ " for word, weight in positive_keywords.items():\n",
1329
+ " if word in review_lower:\n",
1330
+ " score += weight\n",
1331
+ " for word, weight in negative_keywords.items():\n",
1332
+ " if word in review_lower:\n",
1333
+ " score += weight\n",
1334
+ "\n",
1335
+ " return float(clamp(np.array([score]), -1.0, 1.0)[0])\n",
1336
+ "\n",
1337
+ "\n",
1338
  "# 1) Business maturity and competitiveness\n",
1339
  "business_tenure = np.random.randint(3, 180, size=N_SAMPLES) # months\n",
1340
  "location_competitiveness = np.random.poisson(lam=8, size=N_SAMPLES) + 1\n",
1341
  "\n",
1342
  "# 2) Digital adoption (1-10), positively related with tenure (up to a limit)\n",
1343
+ "base_digital = 3.3 + 0.02 * np.sqrt(business_tenure)\n",
1344
+ "noise_digital = np.random.normal(0, 1.8, N_SAMPLES)\n",
1345
  "digital_adoption = clamp(base_digital + noise_digital, 1, 10)\n",
1346
  "\n",
1347
  "# 3) Transaction count depends on maturity, digital, and local competition\n",
1348
  "transaction_lambda = (\n",
1349
+ " 50\n",
1350
+ " + 0.65 * business_tenure\n",
1351
+ " + 8.5 * digital_adoption\n",
1352
+ " - 2.4 * location_competitiveness\n",
1353
+ " + np.random.normal(0, 18, N_SAMPLES)\n",
1354
  ")\n",
1355
  "transaction_lambda = clamp(transaction_lambda, 20, 900)\n",
1356
  "transaction_count = np.random.poisson(transaction_lambda).astype(int)\n",
1357
  "transaction_count = np.maximum(transaction_count, 5)\n",
1358
  "\n",
1359
  "# 4) Average order value (AOV) and monthly revenue\n",
 
1360
  "aov = np.random.lognormal(mean=np.log(65000), sigma=0.45, size=N_SAMPLES)\n",
1361
  "aov = clamp(aov, 12000, 450000)\n",
1362
  "\n",
 
1367
  "\n",
1368
  "# 5) Peak hour latency category influenced by transaction pressure and digital adoption\n",
1369
  "latency_score = (\n",
1370
+ " 0.0045 * transaction_count\n",
1371
+ " - 0.28 * digital_adoption\n",
1372
+ " + 0.09 * location_competitiveness\n",
1373
+ " + np.random.normal(0, 0.9, N_SAMPLES)\n",
1374
  ")\n",
1375
  "\n",
1376
  "peak_hour_latency = np.where(\n",
1377
+ " latency_score < 0.0,\n",
1378
  " \"Low\",\n",
1379
+ " np.where(latency_score < 1.3, \"Med\", \"High\")\n",
1380
  ")\n",
1381
  "\n",
1382
+ "# 6) Burn rate ratio (expense/revenue)\n",
1383
  "latency_penalty = np.select(\n",
1384
  " [peak_hour_latency == \"Low\", peak_hour_latency == \"Med\", peak_hour_latency == \"High\"],\n",
1385
+ " [0.0, 0.10, 0.22],\n",
1386
+ " default=0.10,\n",
1387
  ")\n",
1388
  "\n",
1389
  "burn_rate_ratio = (\n",
1390
+ " 0.80\n",
1391
+ " + 0.015 * location_competitiveness\n",
1392
+ " - 0.014 * digital_adoption\n",
1393
  " + latency_penalty\n",
1394
+ " + np.random.normal(0, 0.10, N_SAMPLES)\n",
1395
  ")\n",
1396
+ "burn_rate_ratio = clamp(burn_rate_ratio, 0.40, 1.55)\n",
1397
  "\n",
1398
  "# 7) Net profit margin (%), inverse relation with burn rate\n",
1399
  "net_profit_margin = (\n",
1400
  " (1 - burn_rate_ratio) * 100\n",
1401
+ " + 0.55 * (digital_adoption - 5)\n",
1402
+ " - 0.18 * np.log1p(location_competitiveness)\n",
1403
+ " + np.random.normal(0, 3.2, N_SAMPLES)\n",
1404
  ")\n",
1405
+ "net_profit_margin = clamp(net_profit_margin, -35, 45)\n",
1406
  "\n",
1407
+ "# 8) Repeat order rate (%), boosted by digital adoption and tenure\n",
1408
  "repeat_order_rate = (\n",
1409
+ " 16\n",
1410
+ " + 1.9 * digital_adoption\n",
1411
+ " + 0.03 * business_tenure\n",
1412
+ " - 0.6 * location_competitiveness\n",
1413
+ " + np.random.normal(0, 7.0, N_SAMPLES)\n",
1414
  ")\n",
1415
+ "repeat_order_rate = clamp(repeat_order_rate, 2, 90)\n",
1416
  "\n",
1417
+ "# 9) Review volatility\n",
1418
  "review_volatility = (\n",
1419
+ " 0.24\n",
1420
  " + 0.18 * (peak_hour_latency == \"Med\").astype(float)\n",
1421
  " + 0.34 * (peak_hour_latency == \"High\").astype(float)\n",
1422
  " + 0.06 * (burn_rate_ratio > 1.0).astype(float)\n",
1423
+ " + np.random.normal(0, 0.09, N_SAMPLES)\n",
1424
  ")\n",
1425
+ "review_volatility = clamp(review_volatility, 0.06, 1.30)\n",
1426
  "\n",
1427
  "# 10) Average historical rating (1-5)\n",
1428
  "avg_historical_rating = (\n",
1429
+ " 3.95\n",
1430
+ " + 0.08 * digital_adoption\n",
1431
+ " + 0.016 * net_profit_margin\n",
1432
+ " - 0.38 * review_volatility\n",
1433
+ " - 0.12 * (peak_hour_latency == \"High\").astype(float)\n",
1434
+ " + np.random.normal(0, 0.26, N_SAMPLES)\n",
1435
  ")\n",
1436
  "avg_historical_rating = clamp(avg_historical_rating, 1.0, 5.0)\n",
1437
  "\n",
 
1441
  " for r, v, l in zip(avg_historical_rating, review_volatility, peak_hour_latency)\n",
1442
  "]\n",
1443
  "\n",
1444
+ "# 12) Sentiment score derived from review text\n",
1445
+ "sentiment_scores = np.array([calculate_sentiment_score(text) for text in review_text])\n",
1446
+ "\n",
1447
+ "# Optional: post-adjustment for severe deficit businesses\n",
1448
+ "deficit_mask = burn_rate_ratio > 1.25\n",
1449
+ "avg_historical_rating[deficit_mask] = np.minimum(\n",
1450
+ " avg_historical_rating[deficit_mask],\n",
1451
+ " np.random.uniform(1.5, 3.5, deficit_mask.sum()),\n",
1452
+ ")\n",
1453
+ "repeat_order_rate[deficit_mask] = np.minimum(\n",
1454
+ " repeat_order_rate[deficit_mask],\n",
1455
+ " np.random.uniform(3, 30, deficit_mask.sum()),\n",
1456
+ ")\n",
1457
+ "\n",
1458
+ "# 13) Target class with percentile-based thresholds (balanced by design)\n",
1459
+ "target_class = np.full(N_SAMPLES, \"Growth\", dtype=object)\n",
1460
+ "\n",
1461
+ "elite_mask = (\n",
1462
+ " (net_profit_margin > np.percentile(net_profit_margin, 70))\n",
1463
+ " & (burn_rate_ratio < np.percentile(burn_rate_ratio, 25))\n",
1464
+ " & (repeat_order_rate > np.percentile(repeat_order_rate, 70))\n",
1465
+ " & (avg_historical_rating > np.percentile(avg_historical_rating, 75))\n",
1466
+ ")\n",
1467
+ "\n",
1468
+ "critical_mask = (\n",
1469
+ " (burn_rate_ratio > np.percentile(burn_rate_ratio, 92))\n",
1470
+ " | ((business_tenure < 7) & (location_competitiveness >= 12))\n",
1471
+ " | ((net_profit_margin < np.percentile(net_profit_margin, 5)) & (avg_historical_rating < 3.0))\n",
1472
+ ")\n",
1473
+ "\n",
1474
+ "struggling_mask = (\n",
1475
+ " ((net_profit_margin < np.percentile(net_profit_margin, 35)) & (burn_rate_ratio > np.percentile(burn_rate_ratio, 60)))\n",
1476
+ " | ((peak_hour_latency == \"High\") & (avg_historical_rating < np.percentile(avg_historical_rating, 40)))\n",
1477
+ " | ((burn_rate_ratio > np.percentile(burn_rate_ratio, 75)) & (avg_historical_rating < np.percentile(avg_historical_rating, 65)))\n",
1478
+ ")\n",
1479
+ "\n",
1480
+ "target_class[elite_mask] = \"Elite\"\n",
1481
+ "target_class[struggling_mask] = \"Struggling\"\n",
1482
+ "target_class[critical_mask] = \"Critical\"\n",
1483
+ "\n",
1484
+ "# Final DataFrame (class at the rightmost position)\n",
1485
  "df = pd.DataFrame(\n",
1486
  " {\n",
1487
  " \"ID\": np.arange(1, N_SAMPLES + 1),\n",
 
1497
  " \"Digital_Adoption_Score\": np.round(digital_adoption, 2),\n",
1498
  " \"Peak_Hour_Latency\": peak_hour_latency,\n",
1499
  " \"Location_Competitiveness\": location_competitiveness.astype(int),\n",
1500
+ " \"Sentiment_Score\": np.round(sentiment_scores, 3),\n",
1501
+ " \"Class\": target_class,\n",
1502
  " }\n",
1503
  ")\n",
1504
  "\n",
 
 
 
 
 
 
 
 
 
 
 
 
1505
  "# Save and preview\n",
1506
  "df.to_csv(OUTPUT_CSV, index=False)\n",
1507
  "\n",
 
1510
  "display(df.head(10))\n",
1511
  "\n",
1512
  "print(\"\\nSummary stats:\")\n",
1513
+ "display(df.describe(include=\"all\").transpose())\n",
1514
+ "\n",
1515
+ "print(\"\\nClass counts:\")\n",
1516
+ "print(df[\"Class\"].value_counts())"
1517
  ]
1518
  },
1519
  {
 
1521
  "id": "90ebddda",
1522
  "metadata": {},
1523
  "source": [
1524
+ "## Class Variable - Balanced Distribution\n",
1525
+ "Dataset dilengkapi dengan variabel target `class` yang mengklasifikasikan setiap UMKM ke dalam 4 kategori bisnis berdasarkan kondisi operasional. Logika menggunakan **percentile-based thresholding** untuk menciptakan distribusi yang lebih balanced dan realistic.\n",
1526
+ "\n",
1527
+ "### Perubahan dari Versi Sebelumnya\n",
1528
+ "\n",
1529
+ "**Masalah yang Diidentifikasi:**\n",
1530
+ "- Dataset sebelumnya sangat imbalanced (93% Growth, 6% Struggling, 0.2% Critical, 0% Elite)\n",
1531
+ "- Penyebabnya bukan hanya di logic classification, tetapi di fundamental logic variabel-variabel input:\n",
1532
+ " - Burn_Rate_Ratio base terlalu rendah mayoritas bisnis punya burn rate rendah\n",
1533
+ " - Digital_Adoption memiliki efek positif yang terlalu besar\n",
1534
+ " - Noise di variabel tidak cukup untuk create diverse outcomes\n",
1535
+ "\n",
1536
+ "**Perbaikan yang Dilakukan:**\n",
1537
+ "\n",
1538
+ "1. **Burn_Rate_Ratio Logic (Step 6):**\n",
1539
+ " - Base dinaikkan: 0.72 → 0.82\n",
1540
+ " - Noise ditingkatkan: σ=0.08 → σ=0.11 (lebih banyak variance)\n",
1541
+ " - Latency penalty diperkuat: [0, 0.08, 0.18] → [0, 0.10, 0.22]\n",
1542
+ " - Location competitiveness effect: +0.018 (meningkat efeknya)\n",
1543
+ "\n",
1544
+ "2. **Net Profit Margin Logic (Step 7):**\n",
1545
+ " - Base rating lowered: 4.15 → 4.0 (lebih realistis marginal bisnis)\n",
1546
+ " - Noise ditingkatkan: σ=2.8 → σ=3.2\n",
1547
+ " - Ini menghasilkan distribusi margin yang lebih spread\n",
1548
+ "\n",
1549
+ "3. **Digital Adoption Logic (Step 2):**\n",
1550
+ " - Noise ditingkatkan: σ=1.4 → σ=2.2 (lebih independent dari tenure)\n",
1551
+ " - Ini mengurangi strong coupling dengan business maturity\n",
1552
+ "\n",
1553
+ "4. **Transaction Count & Repeat Order (Step 3 & 8):**\n",
1554
+ " - Noise ditambahkan untuk lebih realistic variability\n",
1555
+ " - Repeat Order ratios lebih conservative\n",
1556
+ "\n",
1557
+ "5. **Classification Logic (Step 14):**\n",
1558
+ " - Dari hard-coded thresholds → **Percentile-based thresholds**\n",
1559
+ " - Elite: top 10% dengan kombinasi high margin, low burn, strong rating\n",
1560
+ " - Struggling: bottom 45% dengan kombinasi low margin & high burn, atau high latency & low rating\n",
1561
+ " - Critical: bottom 8% dengan severe burn rate, new+competitive, atau deep losses\n",
1562
+ " - Growth: sisa bisnis (default)\n",
1563
+ "\n",
1564
+ "### Class Distribution Logic (Percentile-Based)\n",
1565
+ "\n",
1566
+ "| Class | % Target | Kriteria |\n",
1567
+ "|-------|----------|----------|\n",
1568
+ "| **Elite** | ~10% | Margin > P70 AND Burn < P25 AND Repeat > P70 AND Rating > P75 |\n",
1569
+ "| **Growth** | ~37% | Default - bisnis dengan metrik moderate / recovering |\n",
1570
+ "| **Struggling** | ~45% | (Margin < P35 AND Burn > P60) OR (High Latency AND Rating < P40) OR (Burn > P75 AND Rating < P65) |\n",
1571
+ "| **Critical** | ~8% | Burn > P92 OR (Tenure < 7 AND Competition ≥ 12) OR (Margin < P5 AND Rating < 3.0) |\n",
1572
+ "\n",
1573
+ "### Kolom Baru\n",
1574
+ "- `class`: Klasifikasi tier (Elite, Growth, Struggling, Critical)\n",
1575
+ "- `Sentiment_Score`: Angka sentimen dari review text, skala -1.0 (sangat negatif) hingga 1.0 (sangat positif)\n",
1576
+ "\n",
1577
+ "### Penggunaan\n",
1578
+ "Dataset dengan balanced class distribution cocok untuk:\n",
1579
+ "- **Classification Model**: Training lebih stabil dengan distribusi lebih balanced\n",
1580
+ "- **Risk Assessment**: Bisa identify minority classes (Elite dan Critical)\n",
1581
+ "\n",
1582
+ "Dokumentasi lengkap di [README.md](README.md)."
1583
+ ]
1584
+ },
1585
+ {
1586
+ "cell_type": "code",
1587
+ "execution_count": 21,
1588
+ "id": "b4494280",
1589
+ "metadata": {},
1590
+ "outputs": [
1591
+ {
1592
+ "name": "stdout",
1593
+ "output_type": "stream",
1594
+ "text": [
1595
+ "======================================================================\n",
1596
+ "CLASS DISTRIBUTION - UPDATED\n",
1597
+ "======================================================================\n"
1598
+ ]
1599
+ },
1600
+ {
1601
+ "ename": "KeyError",
1602
+ "evalue": "'class'",
1603
+ "output_type": "error",
1604
+ "traceback": [
1605
+ "\u001b[31m---------------------------------------------------------------------------\u001b[39m",
1606
+ "\u001b[31mKeyError\u001b[39m Traceback (most recent call last)",
1607
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python311\\site-packages\\pandas\\core\\indexes\\base.py:3812\u001b[39m, in \u001b[36mIndex.get_loc\u001b[39m\u001b[34m(self, key)\u001b[39m\n\u001b[32m 3811\u001b[39m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[32m-> \u001b[39m\u001b[32m3812\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43m_engine\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mcasted_key\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 3813\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m err:\n",
1608
+ "\u001b[36mFile \u001b[39m\u001b[32mpandas/_libs/index.pyx:167\u001b[39m, in \u001b[36mpandas._libs.index.IndexEngine.get_loc\u001b[39m\u001b[34m()\u001b[39m\n",
1609
+ "\u001b[36mFile \u001b[39m\u001b[32mpandas/_libs/index.pyx:196\u001b[39m, in \u001b[36mpandas._libs.index.IndexEngine.get_loc\u001b[39m\u001b[34m()\u001b[39m\n",
1610
+ "\u001b[36mFile \u001b[39m\u001b[32mpandas/_libs/hashtable_class_helper.pxi:7088\u001b[39m, in \u001b[36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[39m\u001b[34m()\u001b[39m\n",
1611
+ "\u001b[36mFile \u001b[39m\u001b[32mpandas/_libs/hashtable_class_helper.pxi:7096\u001b[39m, in \u001b[36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[39m\u001b[34m()\u001b[39m\n",
1612
+ "\u001b[31mKeyError\u001b[39m: 'class'",
1613
+ "\nThe above exception was the direct cause of the following exception:\n",
1614
+ "\u001b[31mKeyError\u001b[39m Traceback (most recent call last)",
1615
+ "\u001b[36mCell\u001b[39m\u001b[36m \u001b[39m\u001b[32mIn[21]\u001b[39m\u001b[32m, line 6\u001b[39m\n\u001b[32m 3\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33m\"\u001b[39m\u001b[33mCLASS DISTRIBUTION - UPDATED\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 4\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33m\"\u001b[39m\u001b[33m=\u001b[39m\u001b[33m\"\u001b[39m * \u001b[32m70\u001b[39m)\n\u001b[32m----> \u001b[39m\u001b[32m6\u001b[39m class_counts = \u001b[43mdf\u001b[49m\u001b[43m[\u001b[49m\u001b[33;43m'\u001b[39;49m\u001b[33;43mclass\u001b[39;49m\u001b[33;43m'\u001b[39;49m\u001b[43m]\u001b[49m.value_counts().sort_index()\n\u001b[32m 7\u001b[39m \u001b[38;5;28mprint\u001b[39m(\u001b[33m\"\u001b[39m\u001b[38;5;130;01m\\n\u001b[39;00m\u001b[33mClass counts:\u001b[39m\u001b[33m\"\u001b[39m)\n\u001b[32m 8\u001b[39m \u001b[38;5;28mprint\u001b[39m(class_counts)\n",
1616
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python311\\site-packages\\pandas\\core\\frame.py:4107\u001b[39m, in \u001b[36mDataFrame.__getitem__\u001b[39m\u001b[34m(self, key)\u001b[39m\n\u001b[32m 4105\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28mself\u001b[39m.columns.nlevels > \u001b[32m1\u001b[39m:\n\u001b[32m 4106\u001b[39m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m._getitem_multilevel(key)\n\u001b[32m-> \u001b[39m\u001b[32m4107\u001b[39m indexer = \u001b[38;5;28;43mself\u001b[39;49m\u001b[43m.\u001b[49m\u001b[43mcolumns\u001b[49m\u001b[43m.\u001b[49m\u001b[43mget_loc\u001b[49m\u001b[43m(\u001b[49m\u001b[43mkey\u001b[49m\u001b[43m)\u001b[49m\n\u001b[32m 4108\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m is_integer(indexer):\n\u001b[32m 4109\u001b[39m indexer = [indexer]\n",
1617
+ "\u001b[36mFile \u001b[39m\u001b[32m~\\AppData\\Roaming\\Python\\Python311\\site-packages\\pandas\\core\\indexes\\base.py:3819\u001b[39m, in \u001b[36mIndex.get_loc\u001b[39m\u001b[34m(self, key)\u001b[39m\n\u001b[32m 3814\u001b[39m \u001b[38;5;28;01mif\u001b[39;00m \u001b[38;5;28misinstance\u001b[39m(casted_key, \u001b[38;5;28mslice\u001b[39m) \u001b[38;5;129;01mor\u001b[39;00m (\n\u001b[32m 3815\u001b[39m \u001b[38;5;28misinstance\u001b[39m(casted_key, abc.Iterable)\n\u001b[32m 3816\u001b[39m \u001b[38;5;129;01mand\u001b[39;00m \u001b[38;5;28many\u001b[39m(\u001b[38;5;28misinstance\u001b[39m(x, \u001b[38;5;28mslice\u001b[39m) \u001b[38;5;28;01mfor\u001b[39;00m x \u001b[38;5;129;01min\u001b[39;00m casted_key)\n\u001b[32m 3817\u001b[39m ):\n\u001b[32m 3818\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m InvalidIndexError(key)\n\u001b[32m-> \u001b[39m\u001b[32m3819\u001b[39m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;167;01mKeyError\u001b[39;00m(key) \u001b[38;5;28;01mfrom\u001b[39;00m\u001b[38;5;250m \u001b[39m\u001b[34;01merr\u001b[39;00m\n\u001b[32m 3820\u001b[39m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mTypeError\u001b[39;00m:\n\u001b[32m 3821\u001b[39m \u001b[38;5;66;03m# If we have a listlike key, _check_indexing_error will raise\u001b[39;00m\n\u001b[32m 3822\u001b[39m \u001b[38;5;66;03m# InvalidIndexError. Otherwise we fall through and re-raise\u001b[39;00m\n\u001b[32m 3823\u001b[39m \u001b[38;5;66;03m# the TypeError.\u001b[39;00m\n\u001b[32m 3824\u001b[39m \u001b[38;5;28mself\u001b[39m._check_indexing_error(key)\n",
1618
+ "\u001b[31mKeyError\u001b[39m: 'class'"
1619
+ ]
1620
+ }
1621
+ ],
1622
+ "source": [
1623
+ "\n",
1624
+ "# Verification: Class Distribution\n",
1625
+ "print(\"=\" * 70)\n",
1626
+ "print(\"CLASS DISTRIBUTION - UPDATED\")\n",
1627
+ "print(\"=\" * 70)\n",
1628
+ "\n",
1629
+ "class_counts = df['class'].value_counts().sort_index()\n",
1630
+ "print(\"\\nClass counts:\")\n",
1631
+ "print(class_counts)\n",
1632
+ "\n",
1633
+ "print(\"\\n\\nClass percentages:\")\n",
1634
+ "total = len(df)\n",
1635
+ "for cls in sorted(df['class'].unique()):\n",
1636
+ " if cls in class_counts.index:\n",
1637
+ " count = class_counts[cls]\n",
1638
+ " else:\n",
1639
+ " count = 0\n",
1640
+ " pct = (count / total * 100)\n",
1641
+ " print(f\" {cls:15s}: {count:7,d} ({pct:6.2f}%)\")\n",
1642
+ "\n",
1643
+ "print(\"\\n\\n\" + \"=\" * 70)\n",
1644
+ "print(\"CLASS - METRICS CORRELATION\")\n",
1645
+ "print(\"=\" * 70)\n",
1646
+ "\n",
1647
+ "class_metrics = df.groupby('class')[['Net_Profit_Margin (%)', 'Burn_Rate_Ratio', \n",
1648
+ " 'Repeat_Order_Rate (%)', 'Avg_Historical_Rating', \n",
1649
+ " 'Sentiment_Score']].agg(['mean', 'min', 'max'])\n",
1650
+ "print(class_metrics.round(2))\n",
1651
+ "\n",
1652
+ "print(\"\\n\\n\" + \"=\" * 70)\n",
1653
+ "print(\"BURN_RATE_RATIO DISTRIBUTION\")\n",
1654
+ "print(\"=\" * 70)\n",
1655
+ "print(f\"Mean: {df['Burn_Rate_Ratio'].mean():.3f}\")\n",
1656
+ "print(f\"Std: {df['Burn_Rate_Ratio'].std():.3f}\")\n",
1657
+ "print(f\"Min: {df['Burn_Rate_Ratio'].min():.3f}\")\n",
1658
+ "print(f\"Max: {df['Burn_Rate_Ratio'].max():.3f}\")\n",
1659
+ "print(f\"\\n% with Burn_Rate < 0.75: {(df['Burn_Rate_Ratio'] < 0.75).sum() / len(df) * 100:.1f}%\")\n",
1660
+ "print(f\"% with Burn_Rate < 1.00: {(df['Burn_Rate_Ratio'] < 1.00).sum() / len(df) * 100:.1f}%\")\n",
1661
+ "print(f\"% with Burn_Rate >= 1.00: {(df['Burn_Rate_Ratio'] >= 1.00).sum() / len(df) * 100:.1f}%\")\n",
1662
+ "print(f\"% with Burn_Rate >= 1.20: {(df['Burn_Rate_Ratio'] >= 1.20).sum() / len(df) * 100:.1f}%\")\n",
1663
+ "\n",
1664
+ "print(\"\\n\\n\" + \"=\" * 70)\n",
1665
+ "print(\"NET_PROFIT_MARGIN DISTRIBUTION\")\n",
1666
+ "print(\"=\" * 70)\n",
1667
+ "print(f\"Mean: {df['Net_Profit_Margin (%)'].mean():.2f}%\")\n",
1668
+ "print(f\"Std: {df['Net_Profit_Margin (%)'].std():.2f}%\")\n",
1669
+ "print(f\"Min: {df['Net_Profit_Margin (%)'].min():.2f}%\")\n",
1670
+ "print(f\"Max: {df['Net_Profit_Margin (%)'].max():.2f}%\")\n",
1671
+ "print(f\"\\n% with Profit < 0: {(df['Net_Profit_Margin (%)'] < 0).sum() / len(df) * 100:.1f}%\")\n",
1672
+ "print(f\"% with Profit 0-10%: {((df['Net_Profit_Margin (%)'] >= 0) & (df['Net_Profit_Margin (%)'] < 10)).sum() / len(df) * 100:.1f}%\")\n",
1673
+ "print(f\"% with Profit >= 10%: {(df['Net_Profit_Margin (%)'] >= 10).sum() / len(df) * 100:.1f}%\")\n",
1674
+ "print(f\"% with Profit >= 20%: {(df['Net_Profit_Margin (%)'] >= 20).sum() / len(df) * 100:.1f}%\")\n"
1675
  ]
1676
  }
1677
  ],
synthetic_umkm_data.csv CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:27d3cf381b3045a8e868cb6f771451e6aa82ae39c3c2f4d2cb93ac35e12e9e99
3
- size 18514239
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:7dadea4f406649176101efd061c1e4a706d6ff9573230f669237b5c10596e9a8
3
+ size 20345909