Commit ·
2258da0
0
Parent(s):
first
Browse files- .gitattributes +1 -0
- README.md +92 -0
- create-data.ipynb +1358 -0
- synthetic_umkm_data.csv +3 -0
.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
*.csv filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Synthetic UMKM Dataset Documentation
|
| 2 |
+
|
| 3 |
+
## Ringkasan
|
| 4 |
+
Dataset ini adalah **data sintetis** yang dirancang untuk meniru karakteristik operasional bisnis UMKM secara realistis pada level bulanan. Data dibuat untuk kebutuhan eksplorasi data, pemodelan machine learning, simulasi analitik, dan latihan NLP pada kolom ulasan.
|
| 5 |
+
|
| 6 |
+
## Latar Belakang
|
| 7 |
+
Dalam praktik operasional UMKM, pengambilan keputusan sering dilakukan tanpa dukungan data yang terstruktur dan terintegrasi. Banyak bisnis hanya memantau omzet secara umum, tetapi belum menghubungkan metrik penting lain seperti margin laba bersih, burn rate, retensi pelanggan, kualitas layanan, dan adopsi teknologi digital dalam satu kerangka analisis yang utuh.
|
| 8 |
+
|
| 9 |
+
Kondisi ini menimbulkan beberapa permasalahan utama:
|
| 10 |
+
|
| 11 |
+
- Sulit mendeteksi dini risiko defisit ketika biaya operasional tumbuh lebih cepat daripada pendapatan.
|
| 12 |
+
- Sulit membedakan apakah pertumbuhan bisnis didorong oleh volume transaksi yang sehat atau hanya kenaikan nilai transaksi sesaat.
|
| 13 |
+
- Sulit mengevaluasi dampak kualitas layanan (rating, volatilitas review, latency) terhadap retensi pelanggan.
|
| 14 |
+
- Sulit mengukur kontribusi adopsi digital terhadap efisiensi operasional dan profitabilitas.
|
| 15 |
+
- Sulit menilai tekanan pasar lokal akibat tingkat kompetisi pada area bisnis.
|
| 16 |
+
|
| 17 |
+
Di sisi lain, data riil UMKM sering memiliki kendala akses, privasi, kerahasiaan bisnis, dan kualitas pencatatan yang tidak konsisten. Karena itu, dataset sintetis ini disusun sebagai pendekatan praktis untuk menyediakan data yang aman, terkontrol, dan tetap realistis secara statistik agar dapat digunakan dalam eksplorasi analitik, pengembangan model, serta simulasi pengambilan keputusan berbasis data.
|
| 18 |
+
|
| 19 |
+
## Tujuan Dataset
|
| 20 |
+
Dataset ini memodelkan hubungan antar metrik penting bisnis, termasuk:
|
| 21 |
+
|
| 22 |
+
- Skala ekonomi (pendapatan dan volume transaksi)
|
| 23 |
+
- Efisiensi profitabilitas (margin laba bersih dan burn rate)
|
| 24 |
+
- Kualitas layanan (rating, volatilitas review, latency)
|
| 25 |
+
- Maturitas bisnis (lama operasional)
|
| 26 |
+
- Retensi pelanggan (repeat order rate)
|
| 27 |
+
- Adopsi teknologi (digital adoption score)
|
| 28 |
+
- Tekanan pasar (location competitiveness)
|
| 29 |
+
|
| 30 |
+
## Struktur Kolom
|
| 31 |
+
|
| 32 |
+
| Fitur | Tipe Data | Skala/Satuan | Deskripsi Teknis |
|
| 33 |
+
|---|---|---|---|
|
| 34 |
+
| `ID` | Integer | Bilangan bulat | Identitas unik baris data sintetis. |
|
| 35 |
+
| `Monthly_Revenue` | Integer | IDR | Akumulasi nilai transaksi penjualan kotor dalam satu bulan kalender. |
|
| 36 |
+
| `Net_Profit_Margin (%)` | Float | Persentase (%) | Rasio laba bersih terhadap total pendapatan setelah seluruh beban operasional. |
|
| 37 |
+
| `Burn_Rate_Ratio` | Float | Rasio | Perbandingan total pengeluaran operasional terhadap pendapatan. Nilai `> 1.0` mengindikasikan defisit. |
|
| 38 |
+
| `Transaction_Count` | Integer | Frekuensi | Jumlah nota/transaksi unik pada periode observasi. |
|
| 39 |
+
| `Avg_Historical_Rating` | Float | Skala 1-5 | Rata-rata skor penilaian pelanggan. |
|
| 40 |
+
| `Review_Text` | String | Teks | Umpan balik tekstual sintetis untuk analisis sentimen/NLP. |
|
| 41 |
+
| `Review_Volatility` | Float | Indeks | Tingkat fluktuasi/ketidakkonsistenan kualitas (proxy deviasi rating). |
|
| 42 |
+
| `Business_Tenure_Months` | Integer | Bulan | Lama operasional bisnis sejak berdiri. |
|
| 43 |
+
| `Repeat_Order_Rate (%)` | Float | Persentase (%) | Rasio transaksi pelanggan lama terhadap total transaksi. |
|
| 44 |
+
| `Digital_Adoption_Score` | Float | Skala 1-10 | Indeks adopsi teknologi pembayaran, inventaris, dan kanal digital. |
|
| 45 |
+
| `Peak_Hour_Latency` | Categorical | `Low`/`Med`/`High` | Kategori waktu tunggu/keterlambatan proses saat jam sibuk. |
|
| 46 |
+
| `Location_Competitiveness` | Integer | Jumlah | Densitas kompetitor sejenis pada area geografis tertentu. |
|
| 47 |
+
|
| 48 |
+
## Logika Sintesis Data
|
| 49 |
+
Generator tidak membuat nilai secara acak murni, tetapi memodelkan hubungan yang masuk akal secara bisnis.
|
| 50 |
+
|
| 51 |
+
1. `Business_Tenure_Months` dan `Location_Competitiveness` dibangkitkan terlebih dahulu sebagai faktor dasar.
|
| 52 |
+
2. `Digital_Adoption_Score` dipengaruhi positif oleh maturitas bisnis (dengan noise).
|
| 53 |
+
3. `Transaction_Count` dipengaruhi oleh maturitas, adopsi digital, dan kompetisi lokasi.
|
| 54 |
+
4. `Monthly_Revenue` dihitung dari `Transaction_Count` x AOV lognormal + noise musiman.
|
| 55 |
+
5. `Peak_Hour_Latency` diturunkan dari tekanan volume transaksi, adopsi digital, dan kompetisi.
|
| 56 |
+
6. `Burn_Rate_Ratio` memburuk ketika kompetisi dan latency tinggi.
|
| 57 |
+
7. `Net_Profit_Margin (%)` berelasi terbalik dengan `Burn_Rate_Ratio`.
|
| 58 |
+
8. `Repeat_Order_Rate (%)` meningkat dengan adopsi digital dan maturitas, turun saat kompetisi tinggi.
|
| 59 |
+
9. `Review_Volatility` naik ketika latency tinggi dan burn rate buruk.
|
| 60 |
+
10. `Avg_Historical_Rating` dipengaruhi positif digital/profitabilitas dan negatif volatilitas/latency tinggi.
|
| 61 |
+
11. `Review_Text` dipilih dari template sentimen yang disejajarkan dengan sinyal kualitas (rating, volatilitas, latency), lalu diberi variasi kalimat tambahan.
|
| 62 |
+
|
| 63 |
+
## Karakteristik Realisme
|
| 64 |
+
- Distribusi pendapatan menggunakan lognormal agar mencerminkan skew ekonomi nyata.
|
| 65 |
+
- Hubungan antar variabel dibuat konsisten secara kausal-operasional (bukan random independent).
|
| 66 |
+
- Terdapat noise untuk menghindari data terlalu sempurna.
|
| 67 |
+
- Ada post-adjustment untuk bisnis dengan defisit berat agar rating/retensi lebih realistis.
|
| 68 |
+
|
| 69 |
+
## Contoh Use Case
|
| 70 |
+
- EDA: distribusi revenue, margin, burn rate, segmentasi risiko.
|
| 71 |
+
- Machine Learning: prediksi `Net_Profit_Margin (%)`, klasifikasi `Peak_Hour_Latency`.
|
| 72 |
+
- NLP: sentiment analysis pada `Review_Text`.
|
| 73 |
+
- Simulasi bisnis: evaluasi dampak adopsi digital terhadap retensi dan profitabilitas.
|
| 74 |
+
|
| 75 |
+
## Batasan Dataset
|
| 76 |
+
- Ini **bukan data riil** dan tidak merepresentasikan entitas bisnis tertentu.
|
| 77 |
+
- Distribusi dan hubungan variabel tetap merupakan asumsi desain generator.
|
| 78 |
+
- Tidak cocok untuk inferensi kausal kebijakan nyata tanpa kalibrasi ke data empiris.
|
| 79 |
+
- Template `Review_Text` masih semi-terstruktur, bukan hasil percakapan pengguna asli.
|
| 80 |
+
|
| 81 |
+
## Panduan Pemakaian Cepat
|
| 82 |
+
|
| 83 |
+
```python
|
| 84 |
+
import pandas as pd
|
| 85 |
+
|
| 86 |
+
df = pd.read_csv("synthetic_umkm_data.csv")
|
| 87 |
+
print(df.shape)
|
| 88 |
+
print(df.head())
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## Reproducibility
|
| 92 |
+
Generator menggunakan seed tetap (`SEED = 42`), sehingga data dapat direproduksi selama parameter generator tidak diubah.
|
create-data.ipynb
ADDED
|
@@ -0,0 +1,1358 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cells": [
|
| 3 |
+
{
|
| 4 |
+
"cell_type": "markdown",
|
| 5 |
+
"id": "faad7818",
|
| 6 |
+
"metadata": {},
|
| 7 |
+
"source": [
|
| 8 |
+
"# Synthetic Dummy Data Generator (UMKM)\n",
|
| 9 |
+
"Notebook ini membuat data sintetis yang meniru pola data bisnis riil untuk fitur:\n",
|
| 10 |
+
"\n",
|
| 11 |
+
"- Monthly_Revenue (IDR)\n",
|
| 12 |
+
"- Net_Profit_Margin (%)\n",
|
| 13 |
+
"- Burn_Rate_Ratio\n",
|
| 14 |
+
"- Transaction_Count\n",
|
| 15 |
+
"- Avg_Historical_Rating\n",
|
| 16 |
+
"- Review_Text\n",
|
| 17 |
+
"- Review_Volatility\n",
|
| 18 |
+
"- Business_Tenure_Months\n",
|
| 19 |
+
"- Repeat_Order_Rate (%)\n",
|
| 20 |
+
"- Digital_Adoption_Score\n",
|
| 21 |
+
"- Peak_Hour_Latency\n",
|
| 22 |
+
"- Location_Competitiveness\n",
|
| 23 |
+
"\n",
|
| 24 |
+
"Karakteristik realistis yang dimodelkan:\n",
|
| 25 |
+
"- Korelasi antar fitur (contoh: adopsi digital cenderung meningkatkan repeat order dan rating)\n",
|
| 26 |
+
"- Trade-off operasional (kompetisi tinggi dan latency tinggi dapat menekan margin)\n",
|
| 27 |
+
"- Noise terkontrol agar data tidak terlalu \"rapi\"\n",
|
| 28 |
+
"- Review teks yang selaras dengan rating/sentimen"
|
| 29 |
+
]
|
| 30 |
+
},
|
| 31 |
+
{
|
| 32 |
+
"cell_type": "code",
|
| 33 |
+
"execution_count": 3,
|
| 34 |
+
"id": "af962614",
|
| 35 |
+
"metadata": {},
|
| 36 |
+
"outputs": [
|
| 37 |
+
{
|
| 38 |
+
"name": "stdout",
|
| 39 |
+
"output_type": "stream",
|
| 40 |
+
"text": [
|
| 41 |
+
"Generated 150000 rows -> synthetic_umkm_data.csv\n",
|
| 42 |
+
"\n",
|
| 43 |
+
"Preview:\n"
|
| 44 |
+
]
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"data": {
|
| 48 |
+
"application/vnd.microsoft.datawrangler.viewer.v0+json": {
|
| 49 |
+
"columns": [
|
| 50 |
+
{
|
| 51 |
+
"name": "index",
|
| 52 |
+
"rawType": "int64",
|
| 53 |
+
"type": "integer"
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
"name": "ID",
|
| 57 |
+
"rawType": "int32",
|
| 58 |
+
"type": "integer"
|
| 59 |
+
},
|
| 60 |
+
{
|
| 61 |
+
"name": "Monthly_Revenue",
|
| 62 |
+
"rawType": "int32",
|
| 63 |
+
"type": "integer"
|
| 64 |
+
},
|
| 65 |
+
{
|
| 66 |
+
"name": "Net_Profit_Margin (%)",
|
| 67 |
+
"rawType": "float64",
|
| 68 |
+
"type": "float"
|
| 69 |
+
},
|
| 70 |
+
{
|
| 71 |
+
"name": "Burn_Rate_Ratio",
|
| 72 |
+
"rawType": "float64",
|
| 73 |
+
"type": "float"
|
| 74 |
+
},
|
| 75 |
+
{
|
| 76 |
+
"name": "Transaction_Count",
|
| 77 |
+
"rawType": "int32",
|
| 78 |
+
"type": "integer"
|
| 79 |
+
},
|
| 80 |
+
{
|
| 81 |
+
"name": "Avg_Historical_Rating",
|
| 82 |
+
"rawType": "float64",
|
| 83 |
+
"type": "float"
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
"name": "Review_Text",
|
| 87 |
+
"rawType": "object",
|
| 88 |
+
"type": "string"
|
| 89 |
+
},
|
| 90 |
+
{
|
| 91 |
+
"name": "Review_Volatility",
|
| 92 |
+
"rawType": "float64",
|
| 93 |
+
"type": "float"
|
| 94 |
+
},
|
| 95 |
+
{
|
| 96 |
+
"name": "Business_Tenure_Months",
|
| 97 |
+
"rawType": "int32",
|
| 98 |
+
"type": "integer"
|
| 99 |
+
},
|
| 100 |
+
{
|
| 101 |
+
"name": "Repeat_Order_Rate (%)",
|
| 102 |
+
"rawType": "float64",
|
| 103 |
+
"type": "float"
|
| 104 |
+
},
|
| 105 |
+
{
|
| 106 |
+
"name": "Digital_Adoption_Score",
|
| 107 |
+
"rawType": "float64",
|
| 108 |
+
"type": "float"
|
| 109 |
+
},
|
| 110 |
+
{
|
| 111 |
+
"name": "Peak_Hour_Latency",
|
| 112 |
+
"rawType": "object",
|
| 113 |
+
"type": "string"
|
| 114 |
+
},
|
| 115 |
+
{
|
| 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 |
+
},
|
| 289 |
+
"text/html": [
|
| 290 |
+
"<div>\n",
|
| 291 |
+
"<style scoped>\n",
|
| 292 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 293 |
+
" vertical-align: middle;\n",
|
| 294 |
+
" }\n",
|
| 295 |
+
"\n",
|
| 296 |
+
" .dataframe tbody tr th {\n",
|
| 297 |
+
" vertical-align: top;\n",
|
| 298 |
+
" }\n",
|
| 299 |
+
"\n",
|
| 300 |
+
" .dataframe thead th {\n",
|
| 301 |
+
" text-align: right;\n",
|
| 302 |
+
" }\n",
|
| 303 |
+
"</style>\n",
|
| 304 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 305 |
+
" <thead>\n",
|
| 306 |
+
" <tr style=\"text-align: right;\">\n",
|
| 307 |
+
" <th></th>\n",
|
| 308 |
+
" <th>ID</th>\n",
|
| 309 |
+
" <th>Monthly_Revenue</th>\n",
|
| 310 |
+
" <th>Net_Profit_Margin (%)</th>\n",
|
| 311 |
+
" <th>Burn_Rate_Ratio</th>\n",
|
| 312 |
+
" <th>Transaction_Count</th>\n",
|
| 313 |
+
" <th>Avg_Historical_Rating</th>\n",
|
| 314 |
+
" <th>Review_Text</th>\n",
|
| 315 |
+
" <th>Review_Volatility</th>\n",
|
| 316 |
+
" <th>Business_Tenure_Months</th>\n",
|
| 317 |
+
" <th>Repeat_Order_Rate (%)</th>\n",
|
| 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",
|
| 486 |
+
"</div>"
|
| 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": {},
|
| 551 |
+
"output_type": "display_data"
|
| 552 |
+
},
|
| 553 |
+
{
|
| 554 |
+
"name": "stdout",
|
| 555 |
+
"output_type": "stream",
|
| 556 |
+
"text": [
|
| 557 |
+
"\n",
|
| 558 |
+
"Summary stats:\n"
|
| 559 |
+
]
|
| 560 |
+
},
|
| 561 |
+
{
|
| 562 |
+
"data": {
|
| 563 |
+
"application/vnd.microsoft.datawrangler.viewer.v0+json": {
|
| 564 |
+
"columns": [
|
| 565 |
+
{
|
| 566 |
+
"name": "index",
|
| 567 |
+
"rawType": "object",
|
| 568 |
+
"type": "string"
|
| 569 |
+
},
|
| 570 |
+
{
|
| 571 |
+
"name": "count",
|
| 572 |
+
"rawType": "object",
|
| 573 |
+
"type": "unknown"
|
| 574 |
+
},
|
| 575 |
+
{
|
| 576 |
+
"name": "unique",
|
| 577 |
+
"rawType": "object",
|
| 578 |
+
"type": "unknown"
|
| 579 |
+
},
|
| 580 |
+
{
|
| 581 |
+
"name": "top",
|
| 582 |
+
"rawType": "object",
|
| 583 |
+
"type": "unknown"
|
| 584 |
+
},
|
| 585 |
+
{
|
| 586 |
+
"name": "freq",
|
| 587 |
+
"rawType": "object",
|
| 588 |
+
"type": "unknown"
|
| 589 |
+
},
|
| 590 |
+
{
|
| 591 |
+
"name": "mean",
|
| 592 |
+
"rawType": "object",
|
| 593 |
+
"type": "unknown"
|
| 594 |
+
},
|
| 595 |
+
{
|
| 596 |
+
"name": "std",
|
| 597 |
+
"rawType": "object",
|
| 598 |
+
"type": "unknown"
|
| 599 |
+
},
|
| 600 |
+
{
|
| 601 |
+
"name": "min",
|
| 602 |
+
"rawType": "object",
|
| 603 |
+
"type": "unknown"
|
| 604 |
+
},
|
| 605 |
+
{
|
| 606 |
+
"name": "25%",
|
| 607 |
+
"rawType": "object",
|
| 608 |
+
"type": "unknown"
|
| 609 |
+
},
|
| 610 |
+
{
|
| 611 |
+
"name": "50%",
|
| 612 |
+
"rawType": "object",
|
| 613 |
+
"type": "unknown"
|
| 614 |
+
},
|
| 615 |
+
{
|
| 616 |
+
"name": "75%",
|
| 617 |
+
"rawType": "object",
|
| 618 |
+
"type": "unknown"
|
| 619 |
+
},
|
| 620 |
+
{
|
| 621 |
+
"name": "max",
|
| 622 |
+
"rawType": "object",
|
| 623 |
+
"type": "unknown"
|
| 624 |
+
}
|
| 625 |
+
],
|
| 626 |
+
"ref": "9fb3c49f-91bf-4bf9-b703-6128e1e23768",
|
| 627 |
+
"rows": [
|
| 628 |
+
[
|
| 629 |
+
"ID",
|
| 630 |
+
"150000.0",
|
| 631 |
+
null,
|
| 632 |
+
null,
|
| 633 |
+
null,
|
| 634 |
+
"75000.5",
|
| 635 |
+
"43301.414526548666",
|
| 636 |
+
"1.0",
|
| 637 |
+
"37500.75",
|
| 638 |
+
"75000.5",
|
| 639 |
+
"112500.25",
|
| 640 |
+
"150000.0"
|
| 641 |
+
],
|
| 642 |
+
[
|
| 643 |
+
"Monthly_Revenue",
|
| 644 |
+
"150000.0",
|
| 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 (%)",
|
| 658 |
+
"150000.0",
|
| 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",
|
| 672 |
+
"150000.0",
|
| 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",
|
| 686 |
+
"150000.0",
|
| 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",
|
| 700 |
+
"150000.0",
|
| 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,
|
| 721 |
+
null,
|
| 722 |
+
null,
|
| 723 |
+
null,
|
| 724 |
+
null
|
| 725 |
+
],
|
| 726 |
+
[
|
| 727 |
+
"Review_Volatility",
|
| 728 |
+
"150000.0",
|
| 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",
|
| 742 |
+
"150000.0",
|
| 743 |
+
null,
|
| 744 |
+
null,
|
| 745 |
+
null,
|
| 746 |
+
"91.00684",
|
| 747 |
+
"51.10473615861304",
|
| 748 |
+
"3.0",
|
| 749 |
+
"47.0",
|
| 750 |
+
"91.0",
|
| 751 |
+
"135.0",
|
| 752 |
+
"179.0"
|
| 753 |
+
],
|
| 754 |
+
[
|
| 755 |
+
"Repeat_Order_Rate (%)",
|
| 756 |
+
"150000.0",
|
| 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",
|
| 770 |
+
"150000.0",
|
| 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,
|
| 791 |
+
null,
|
| 792 |
+
null,
|
| 793 |
+
null,
|
| 794 |
+
null
|
| 795 |
+
],
|
| 796 |
+
[
|
| 797 |
+
"Location_Competitiveness",
|
| 798 |
+
"150000.0",
|
| 799 |
+
null,
|
| 800 |
+
null,
|
| 801 |
+
null,
|
| 802 |
+
"8.998806666666667",
|
| 803 |
+
"2.8286024669263194",
|
| 804 |
+
"1.0",
|
| 805 |
+
"7.0",
|
| 806 |
+
"9.0",
|
| 807 |
+
"11.0",
|
| 808 |
+
"23.0"
|
| 809 |
+
]
|
| 810 |
+
],
|
| 811 |
+
"shape": {
|
| 812 |
+
"columns": 11,
|
| 813 |
+
"rows": 13
|
| 814 |
+
}
|
| 815 |
+
},
|
| 816 |
+
"text/html": [
|
| 817 |
+
"<div>\n",
|
| 818 |
+
"<style scoped>\n",
|
| 819 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
| 820 |
+
" vertical-align: middle;\n",
|
| 821 |
+
" }\n",
|
| 822 |
+
"\n",
|
| 823 |
+
" .dataframe tbody tr th {\n",
|
| 824 |
+
" vertical-align: top;\n",
|
| 825 |
+
" }\n",
|
| 826 |
+
"\n",
|
| 827 |
+
" .dataframe thead th {\n",
|
| 828 |
+
" text-align: right;\n",
|
| 829 |
+
" }\n",
|
| 830 |
+
"</style>\n",
|
| 831 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
| 832 |
+
" <thead>\n",
|
| 833 |
+
" <tr style=\"text-align: right;\">\n",
|
| 834 |
+
" <th></th>\n",
|
| 835 |
+
" <th>count</th>\n",
|
| 836 |
+
" <th>unique</th>\n",
|
| 837 |
+
" <th>top</th>\n",
|
| 838 |
+
" <th>freq</th>\n",
|
| 839 |
+
" <th>mean</th>\n",
|
| 840 |
+
" <th>std</th>\n",
|
| 841 |
+
" <th>min</th>\n",
|
| 842 |
+
" <th>25%</th>\n",
|
| 843 |
+
" <th>50%</th>\n",
|
| 844 |
+
" <th>75%</th>\n",
|
| 845 |
+
" <th>max</th>\n",
|
| 846 |
+
" </tr>\n",
|
| 847 |
+
" </thead>\n",
|
| 848 |
+
" <tbody>\n",
|
| 849 |
+
" <tr>\n",
|
| 850 |
+
" <th>ID</th>\n",
|
| 851 |
+
" <td>150000.0</td>\n",
|
| 852 |
+
" <td>NaN</td>\n",
|
| 853 |
+
" <td>NaN</td>\n",
|
| 854 |
+
" <td>NaN</td>\n",
|
| 855 |
+
" <td>75000.5</td>\n",
|
| 856 |
+
" <td>43301.414527</td>\n",
|
| 857 |
+
" <td>1.0</td>\n",
|
| 858 |
+
" <td>37500.75</td>\n",
|
| 859 |
+
" <td>75000.5</td>\n",
|
| 860 |
+
" <td>112500.25</td>\n",
|
| 861 |
+
" <td>150000.0</td>\n",
|
| 862 |
+
" </tr>\n",
|
| 863 |
+
" <tr>\n",
|
| 864 |
+
" <th>Monthly_Revenue</th>\n",
|
| 865 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 879 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 893 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 907 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 921 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 942 |
+
" <td>NaN</td>\n",
|
| 943 |
+
" <td>NaN</td>\n",
|
| 944 |
+
" <td>NaN</td>\n",
|
| 945 |
+
" <td>NaN</td>\n",
|
| 946 |
+
" </tr>\n",
|
| 947 |
+
" <tr>\n",
|
| 948 |
+
" <th>Review_Volatility</th>\n",
|
| 949 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 963 |
+
" <td>150000.0</td>\n",
|
| 964 |
+
" <td>NaN</td>\n",
|
| 965 |
+
" <td>NaN</td>\n",
|
| 966 |
+
" <td>NaN</td>\n",
|
| 967 |
+
" <td>91.00684</td>\n",
|
| 968 |
+
" <td>51.104736</td>\n",
|
| 969 |
+
" <td>3.0</td>\n",
|
| 970 |
+
" <td>47.0</td>\n",
|
| 971 |
+
" <td>91.0</td>\n",
|
| 972 |
+
" <td>135.0</td>\n",
|
| 973 |
+
" <td>179.0</td>\n",
|
| 974 |
+
" </tr>\n",
|
| 975 |
+
" <tr>\n",
|
| 976 |
+
" <th>Repeat_Order_Rate (%)</th>\n",
|
| 977 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 991 |
+
" <td>150000.0</td>\n",
|
| 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",
|
| 1012 |
+
" <td>NaN</td>\n",
|
| 1013 |
+
" <td>NaN</td>\n",
|
| 1014 |
+
" <td>NaN</td>\n",
|
| 1015 |
+
" <td>NaN</td>\n",
|
| 1016 |
+
" </tr>\n",
|
| 1017 |
+
" <tr>\n",
|
| 1018 |
+
" <th>Location_Competitiveness</th>\n",
|
| 1019 |
+
" <td>150000.0</td>\n",
|
| 1020 |
+
" <td>NaN</td>\n",
|
| 1021 |
+
" <td>NaN</td>\n",
|
| 1022 |
+
" <td>NaN</td>\n",
|
| 1023 |
+
" <td>8.998807</td>\n",
|
| 1024 |
+
" <td>2.828602</td>\n",
|
| 1025 |
+
" <td>1.0</td>\n",
|
| 1026 |
+
" <td>7.0</td>\n",
|
| 1027 |
+
" <td>9.0</td>\n",
|
| 1028 |
+
" <td>11.0</td>\n",
|
| 1029 |
+
" <td>23.0</td>\n",
|
| 1030 |
+
" </tr>\n",
|
| 1031 |
+
" </tbody>\n",
|
| 1032 |
+
"</table>\n",
|
| 1033 |
+
"</div>"
|
| 1034 |
+
],
|
| 1035 |
+
"text/plain": [
|
| 1036 |
+
" count unique \\\n",
|
| 1037 |
+
"ID 150000.0 NaN \n",
|
| 1038 |
+
"Monthly_Revenue 150000.0 NaN \n",
|
| 1039 |
+
"Net_Profit_Margin (%) 150000.0 NaN \n",
|
| 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": [
|
| 1102 |
+
"import random\n",
|
| 1103 |
+
"from typing import List\n",
|
| 1104 |
+
"\n",
|
| 1105 |
+
"import numpy as np\n",
|
| 1106 |
+
"import pandas as pd\n",
|
| 1107 |
+
"from faker import Faker\n",
|
| 1108 |
+
"\n",
|
| 1109 |
+
"# Reproducibility\n",
|
| 1110 |
+
"SEED = 42\n",
|
| 1111 |
+
"np.random.seed(SEED)\n",
|
| 1112 |
+
"random.seed(SEED)\n",
|
| 1113 |
+
"fake = Faker(\"id_ID\")\n",
|
| 1114 |
+
"Faker.seed(SEED)\n",
|
| 1115 |
+
"\n",
|
| 1116 |
+
"# Config\n",
|
| 1117 |
+
"N_SAMPLES = 150000\n",
|
| 1118 |
+
"OUTPUT_CSV = \"synthetic_umkm_data.csv\"\n",
|
| 1119 |
+
"\n",
|
| 1120 |
+
"# Review templates aligned with sentiment\n",
|
| 1121 |
+
"POSITIVE_REVIEWS = [\n",
|
| 1122 |
+
" \"Pelayanan cepat dan ramah, pesanan selalu tepat.\",\n",
|
| 1123 |
+
" \"Kualitas produk konsisten, harga masih masuk akal.\",\n",
|
| 1124 |
+
" \"Aplikasi pemesanan mudah dipakai dan responsif.\",\n",
|
| 1125 |
+
" \"Pengiriman cepat, admin komunikatif.\",\n",
|
| 1126 |
+
" \"Selalu repeat order karena kualitasnya terjaga.\",\n",
|
| 1127 |
+
" \"Transaksi digital lancar, proses checkout tidak ribet.\",\n",
|
| 1128 |
+
"]\n",
|
| 1129 |
+
"\n",
|
| 1130 |
+
"NEUTRAL_REVIEWS = [\n",
|
| 1131 |
+
" \"Produk cukup baik, kadang waktu tunggu agak lama.\",\n",
|
| 1132 |
+
" \"Pelayanan standar, masih bisa ditingkatkan.\",\n",
|
| 1133 |
+
" \"Harga dan kualitas seimbang, pengalaman biasa saja.\",\n",
|
| 1134 |
+
" \"Kadang stok kosong saat jam ramai.\",\n",
|
| 1135 |
+
" \"Secara umum oke, hanya respon chat kadang lambat.\",\n",
|
| 1136 |
+
"]\n",
|
| 1137 |
+
"\n",
|
| 1138 |
+
"NEGATIVE_REVIEWS = [\n",
|
| 1139 |
+
" \"Pesanan sering terlambat saat jam sibuk.\",\n",
|
| 1140 |
+
" \"Kualitas tidak konsisten, kadang bagus kadang kurang.\",\n",
|
| 1141 |
+
" \"Respons admin lambat dan informasi kurang jelas.\",\n",
|
| 1142 |
+
" \"Proses pembayaran sering bermasalah.\",\n",
|
| 1143 |
+
" \"Harga naik tapi layanan tidak membaik.\",\n",
|
| 1144 |
+
" \"Sudah beberapa kali order, pengalaman makin menurun.\",\n",
|
| 1145 |
+
"]\n",
|
| 1146 |
+
"\n",
|
| 1147 |
+
"\n",
|
| 1148 |
+
"def clamp(x: np.ndarray, low: float, high: float) -> np.ndarray:\n",
|
| 1149 |
+
" return np.clip(x, low, high)\n",
|
| 1150 |
+
"\n",
|
| 1151 |
+
"\n",
|
| 1152 |
+
"def pick_review(rating: float, volatility: float, latency: str) -> str:\n",
|
| 1153 |
+
" \"\"\"Generate review text coherent with quality signal.\"\"\"\n",
|
| 1154 |
+
" base_pool: List[str]\n",
|
| 1155 |
+
"\n",
|
| 1156 |
+
" if rating >= 4.2 and volatility < 0.45 and latency == \"Low\":\n",
|
| 1157 |
+
" base_pool = POSITIVE_REVIEWS\n",
|
| 1158 |
+
" elif rating < 3.4 or latency == \"High\":\n",
|
| 1159 |
+
" base_pool = NEGATIVE_REVIEWS\n",
|
| 1160 |
+
" else:\n",
|
| 1161 |
+
" base_pool = NEUTRAL_REVIEWS\n",
|
| 1162 |
+
"\n",
|
| 1163 |
+
" text = random.choice(base_pool)\n",
|
| 1164 |
+
"\n",
|
| 1165 |
+
" # Add slight random variation so reviews don't look templated\n",
|
| 1166 |
+
" if random.random() < 0.3:\n",
|
| 1167 |
+
" text += \" \" + fake.sentence(nb_words=6)\n",
|
| 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",
|
| 1196 |
+
"monthly_revenue = transaction_count * aov\n",
|
| 1197 |
+
"seasonality_noise = np.random.normal(1.0, 0.08, N_SAMPLES)\n",
|
| 1198 |
+
"monthly_revenue = monthly_revenue * seasonality_noise\n",
|
| 1199 |
+
"monthly_revenue = clamp(monthly_revenue, 1_500_000, 850_000_000)\n",
|
| 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",
|
| 1271 |
+
"# 11) Review text generation coherent with rating/volatility/latency\n",
|
| 1272 |
+
"review_text = [\n",
|
| 1273 |
+
" pick_review(rating=r, volatility=v, latency=l)\n",
|
| 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",
|
| 1282 |
+
" \"Monthly_Revenue\": np.round(monthly_revenue, 0).astype(int),\n",
|
| 1283 |
+
" \"Net_Profit_Margin (%)\": np.round(net_profit_margin, 2),\n",
|
| 1284 |
+
" \"Burn_Rate_Ratio\": np.round(burn_rate_ratio, 3),\n",
|
| 1285 |
+
" \"Transaction_Count\": transaction_count.astype(int),\n",
|
| 1286 |
+
" \"Avg_Historical_Rating\": np.round(avg_historical_rating, 2),\n",
|
| 1287 |
+
" \"Review_Text\": review_text,\n",
|
| 1288 |
+
" \"Review_Volatility\": np.round(review_volatility, 3),\n",
|
| 1289 |
+
" \"Business_Tenure_Months\": business_tenure.astype(int),\n",
|
| 1290 |
+
" \"Repeat_Order_Rate (%)\": np.round(repeat_order_rate, 2),\n",
|
| 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",
|
| 1312 |
+
"print(f\"Generated {len(df)} rows -> {OUTPUT_CSV}\")\n",
|
| 1313 |
+
"print(\"\\nPreview:\")\n",
|
| 1314 |
+
"display(df.head(10))\n",
|
| 1315 |
+
"\n",
|
| 1316 |
+
"print(\"\\nSummary stats:\")\n",
|
| 1317 |
+
"display(df.describe(include=\"all\").transpose())"
|
| 1318 |
+
]
|
| 1319 |
+
},
|
| 1320 |
+
{
|
| 1321 |
+
"cell_type": "markdown",
|
| 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 |
+
],
|
| 1337 |
+
"metadata": {
|
| 1338 |
+
"kernelspec": {
|
| 1339 |
+
"display_name": "Python 3",
|
| 1340 |
+
"language": "python",
|
| 1341 |
+
"name": "python3"
|
| 1342 |
+
},
|
| 1343 |
+
"language_info": {
|
| 1344 |
+
"codemirror_mode": {
|
| 1345 |
+
"name": "ipython",
|
| 1346 |
+
"version": 3
|
| 1347 |
+
},
|
| 1348 |
+
"file_extension": ".py",
|
| 1349 |
+
"mimetype": "text/x-python",
|
| 1350 |
+
"name": "python",
|
| 1351 |
+
"nbconvert_exporter": "python",
|
| 1352 |
+
"pygments_lexer": "ipython3",
|
| 1353 |
+
"version": "3.11.9"
|
| 1354 |
+
}
|
| 1355 |
+
},
|
| 1356 |
+
"nbformat": 4,
|
| 1357 |
+
"nbformat_minor": 5
|
| 1358 |
+
}
|
synthetic_umkm_data.csv
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:27d3cf381b3045a8e868cb6f771451e6aa82ae39c3c2f4d2cb93ac35e12e9e99
|
| 3 |
+
size 18514239
|