File size: 28,603 Bytes
e198515
6800e39
c08ec08
 
 
 
e198515
f1a751d
 
 
 
 
 
 
 
 
 
 
 
e198515
f1a751d
43c6850
f1a751d
a9f48b6
43c6850
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
a9f48b6
43c6850
 
 
f1a751d
43c6850
9aeb3f0
 
f1a751d
43c6850
 
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
f1a751d
43c6850
 
 
 
 
 
 
f1a751d
43c6850
 
f1a751d
 
 
43c6850
f1a751d
43c6850
 
 
f1a751d
43c6850
f1a751d
43c6850
 
 
f1a751d
43c6850
 
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
f1a751d
43c6850
 
 
 
 
 
 
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
 
 
f1a751d
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
f1a751d
43c6850
 
 
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
f1a751d
43c6850
 
 
f1a751d
43c6850
f1a751d
 
 
43c6850
f1a751d
43c6850
 
 
 
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
 
 
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
 
f1a751d
43c6850
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
 
f1a751d
 
43c6850
 
f1a751d
43c6850
 
 
 
 
 
 
 
 
f1a751d
43c6850
f1a751d
43c6850
 
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
 
f1a751d
43c6850
f1a751d
43c6850
f1a751d
 
 
 
 
 
43c6850
f1a751d
43c6850
f1a751d
 
 
 
 
 
43c6850
f1a751d
43c6850
 
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
f1a751d
10f3635
43c6850
f1a751d
 
 
43c6850
f1a751d
43c6850
 
 
 
f1a751d
43c6850
 
 
 
f1a751d
43c6850
 
 
 
 
f1a751d
43c6850
 
 
 
f1a751d
43c6850
 
 
 
f1a751d
43c6850
 
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
f1a751d
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f1a751d
 
 
43c6850
 
 
 
 
f1a751d
 
43c6850
f1a751d
43c6850
f1a751d
43c6850
 
 
f1a751d
43c6850
 
 
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
 
 
 
 
f1a751d
 
 
 
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f1a751d
43c6850
f1a751d
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f1a751d
 
 
43c6850
f1a751d
43c6850
 
 
 
 
 
 
 
 
 
f1a751d
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
---
configs:
  - config_name: events
    data_files: dataset_a_events.csv
  - config_name: vendors
    data_files: dataset_b_vendors.csv
license: mit
language:
  - en
tags:
  - event-management
  - b2b
  - synthetic
  - recommendation-system
  - nlp
  - embeddings
pretty_name: ProSync AI  B2B Event Management Dataset
size_categories:
  - 1K<n<10K
---

# ProSync AI — The Event Producer's Command Center

> An end-to-end Data Analytics & AI project for professional B2B and private event production.
> ProSync AI turns two synthetic datasets (3,000 past events and 7,000 vendors) into a
> working pipeline for **cost estimation, quotation logic, semantic vendor recommendation,
> and automated supplier outreach**.

---

## Table of Contents

1. [Project Overview](#1-project-overview)
2. [Business Problem](#2-business-problem)
3. [The ProSync AI Solution](#3-the-prosync-ai-solution)
4. [Project Objectives](#4-project-objectives)
5. [Dataset Overview](#5-dataset-overview)
6. [Data Preparation & Methodology](#6-data-preparation--methodology)
7. [Exploratory Data Analysis](#7-exploratory-data-analysis)
8. [Key Findings & Business Insights](#8-key-findings--business-insights)
9. [Metrics & KPIs](#9-metrics--kpis)
10. [Machine Learning / AI Approach](#10-machine-learning--ai-approach)
11. [Business Recommendations](#11-business-recommendations)
12. [Technologies & Tools](#12-technologies--tools)
13. [Project Structure](#13-project-structure)
14. [Limitations](#14-limitations)
15. [Future Work](#15-future-work)
16. [Conclusion](#16-conclusion)

---

## 1. Project Overview

**ProSync AI** is a decision-support concept for professional event producers. Planning a
corporate and private event means estimating a realistic budget, splitting it across seven service
categories, choosing suitable vendors under real constraints (city, season, budget), and
reaching out to those vendors — today largely a manual, experience-driven, error-prone
process.

This project builds the analytical and AI backbone for that workflow. Working from two
synthetic datasets, it profiles historical event economics, models spend and segments the
vendor marketplace.

The work is delivered as a single reproducible notebook covering four stages —
**data preprocessing → exploratory data analysis (9 sections) → embedding evaluation &
semantic retrieval → text generation** — plus the pre-computed vendor embeddings intended
to power a lightweight Gradio application.

---

## 2. Business Problem

Event production is a high-stakes coordination problem with three recurring pain points:

- **Budgets are unreliable.** Planned budgets routinely fail to match final spend, so
  quotes prepared from the original budget alone tend to under-quote the client.
- **Vendor selection is hard to reason about.** Producers juggle price, quality,
  reliability, availability, location and fit across seven categories and thousands of
  potential suppliers — usually from memory and a personal contact list.
- **Outreach is slow and repetitive.** Drafting tailored RFP emails and production
  schedules for each event consumes time that could go into planning.

The project's goal is to replace intuition with **data-driven, auditable logic** wherever
possible, and to automate the repetitive drafting work safely.

---

## 3. The ProSync AI Solution

ProSync AI is organised around four functional capabilities. Two are implemented as working
functions in the notebook; two are delivered as **data-driven parameters and models** that
the EDA derives directly from history.

| Capability | What it does | How it is delivered in this project |
|---|---|---|
| **Cost Estimation** | Base budget estimate for a new event | A per-event-type lookup table of budget-per-guest (median / Q1 / Q3 / P90), plus a Random Forest spend model |
| **Quotation Logic** | Correct systematic under-quoting; split budget by category | A universal correction factor derived from historical utilisation, plus fixed cost-allocation ratios |
| **Vendor Recommender** | Rank suitable vendors per category | `recommend_vendors()` — hard filters (city, season, budget) + blended semantic/quality score |

A key design principle runs through the system: **structured data is the source of truth.**
Wherever the LLM-generated text is unreliable (for example, vendor company names), the
correct value is injected from the structured columns at render time rather than trusted
from generated prose.

---

## 4. Project Objectives

1. Validate the structural integrity of the events and vendors datasets.
2. Identify the dominant driver(s) of event cost per guest.
3. Quantify how systematically events exceed their planned budget and derive a correction factor.
4. Test whether vendor **price** is a reliable proxy for vendor **quality**.
5. Build a composite vendor-quality score usable for ranking within a budget.
6. Map, per budget level, how many vendors in each category are actually affordable.
7. Establish stable per-category cost-allocation ratios for budget splitting.
8. Segment events and vendors into interpretable clusters.
9. Audit the AI-generated text fields for artifacts and hallucinations, and mitigate them.
10. Select an embedding model and build a working semantic recommendation + generation pipeline.

---

## 5. Dataset Overview

Two linked synthetic datasets are analysed. The narrative text fields (`vendor_profile_text`,
`event_narrative`) were produced by a small open language model as part of the project's
data-generation stage; the structured fields were generated programmatically with
business-logic constraints. All data is synthetic — no real companies, events or individuals
are represented.

### Dataset A — Past Events

| Property | Value |
|---|---|
| Rows | 3,000 |
| Event types | 10 |
| Cities | 8 |
| Missing values | 0 |
| Duplicate rows | 0 |

Representative fields: `event_id`, `event_type`, `client_industry`, `city`, `month` /
`season`, `guest_capacity`, `catering_style`, `av_complexity` (1–5), `total_budget_usd`,
`actual_spend_usd`, `margin_pct`, `vendor_ids_used` (JSON list of 7 vendor IDs),
`vendor_cost_breakdown` (JSON `{vendor_id: cost}` that sums to `actual_spend_usd`),
`success_rating` (1–5), and `event_narrative`.

**Event types (10):** Investor Day, Corporate Gala, Award Ceremony, Tech Summit,
Product Launch, Brand Activation, Annual Conference, Trade Show, Team Building,
Workshop Series. Events are roughly evenly distributed (~280–330 per type).

### Dataset B — B2B Vendors

| Property | Value |
|---|---|
| Rows | 7,000 |
| Categories | 7 (exactly 1,000 vendors each) |
| Missing values | 0 |
| Duplicate rows | 0 |

Representative fields: `vendor_id`, `vendor_name`, `category`, `subcategory`, `price_tier`
(1–5), `day_rate_min_usd` / `day_rate_max_usd`, `avg_rating` (1–5), `sla_compliance_rate`
(0–1), `response_time_hours`, `guest_capacity_min` / `_max`, `coverage_cities` (JSON),
`seasonal_availability` (JSON), `specializations` (JSON), `certifications` (JSON),
`years_in_business`, and `vendor_profile_text`.

**Vendor categories (7):** Catering, Venue, AV_Technology, Entertainment,
Photography_Video, Logistics, Security.

### How the datasets connect

Each event references exactly **7 vendors** — one per category — through
`vendor_ids_used` and `vendor_cost_breakdown`. Exploding the breakdown produces an
integrated table of **21,000 rows (3,000 events × 7 vendors)** that is used for the
cost-allocation analysis. The notebook validates referential integrity and confirms the
per-event breakdowns reconcile to `actual_spend_usd`.

---

## 6. Data Preparation & Methodology

The following steps are what the notebook **actually performs** on load.

**Events (Dataset A)**
- Parse the two JSON columns (`vendor_ids_used`, `vendor_cost_breakdown`).
- Validate the `event_id` primary key (no duplicates).
- Consistency-check derived columns: `month_name` and `season` recomputed from `month`;
  `margin_pct` recomputed from budget and spend and asserted to match.
- Drop `vendor_count` (constant = 7, zero variance).
- Feature engineering: `budget_per_guest`, `spend_per_guest`, `util_rate`
  (`actual_spend / total_budget`), `budget_overage_usd`, `is_over_budget` flag, and
  `is_low_quality` flag (`success_rating < 3.0`).

**Vendors (Dataset B)**
- Safe JSON parsing for `coverage_cities`, `seasonal_availability`, `specializations`,
  `certifications` (type-guarded to protect list columns).
- Validate `vendor_id` uniqueness and numeric ranges (`day_rate_min < day_rate_max`,
  `guest_capacity_min < guest_capacity_max`).
- Text cleaning: strip a prompt-leakage prefix (`**Vendor Profile:**`) from affected
  profiles and trim string columns.
- Feature engineering: `n_specializations`, `n_cities`, `n_certifications`,
  `has_certification`, `day_rate_mid`, `rating_norm` (min–max), `value_score`
  (`1 − (price_tier − 1) / 4`), and the **composite vendor score**:

  ```
  composite_score = 0.4 · rating_norm + 0.4 · sla_compliance_rate + 0.2 · value_score
  ```

Both datasets are confirmed complete (zero nulls, zero duplicates) before analysis.

---

## 7. Exploratory Data Analysis

The EDA is organised into nine analytical sections, each tied to one of the four
capabilities. Only the most decision-relevant results are summarised here. The figures below
are the notebook's saved outputs; the image links assume they live in `outputs/figures/`
(adjust the paths if you store the PNGs elsewhere).

### Section 1 — Data Profiling
Confirms 3,000 events / 7,000 vendors, balanced classes, zero nulls, zero duplicates.
Two structural constraints are flagged as **known limitations**: `guest_capacity` takes only
14 discrete values, and `success_rating` is **floored at 2.5** (the data contains no
catastrophic-failure events).

![Section 1 — Data Profiling & Structural Overview](1.png)
*Event-type frequencies, the perfectly balanced vendor categories (1,000 each), the 14-value guest-capacity artifact, the success-rating floor at 2.5, and a zero-nulls / zero-duplicates quality summary.*

### Section 2 — Cost Hierarchy (Cost Estimation)
`event_type` is by far the strongest driver of cost per guest, producing an
**≈5× spread** from the cheapest type (Workshop Series) to the most expensive
(Investor Day) — the notebook's cost-lookup table reports a median budget-per-guest range of
roughly **$124 to $618**. The per-type IQR (Q1–Q3) becomes the quotation confidence interval.

![Section 2 — Cost Hierarchy: The Quotation Lookup Table](2.png)
*Left: budget-per-guest distribution per event type, sorted by median. Right: the median ± IQR "confidence interval" that seeds each quote.*

### Section 3 — The Under-Quoting Problem (Quotation)
**55.0% of events exceed their planned budget.** The mean utilisation rate is ≈**1.02** and
is structurally uniform across event types (no type is meaningfully "safer"), so the
quotation logic applies a single universal correction rather than per-type adjustments. The
P90 utilisation sits near **1.10** (a ~10% buffer covers ~90% of cases); the maximum observed
is **1.50**.

![Section 3 — The Under-Quoting Problem](3.png)
*Utilisation-rate histogram (55% land above break-even), mean utilisation per event type (uniform ≈1.02), and planned-vs-actual spend on a 500-event sample.*

### Section 4 — Price vs. Quality (Recommender Logic)
Across every category, **average rating is essentially flat across price tiers** — the
Pearson correlation between `price_tier` and `avg_rating` is **near zero**. Paying more does
**not** reliably buy higher quality. This is the finding that shapes the recommender: rank on
the composite score and semantic fit, **not** on price.

![Section 4 — Vendor Marketplace Dynamics](4.png)
*Left: composite score by price tier (overlapping distributions). Right: average rating by tier for every category — near-flat lines with a near-zero Pearson r confirm price ≠ quality.*

### Section 5 — Predictive Modelling (Quotation Precision)
A Random Forest predicts `actual_spend_usd` (details in Section 10). It defines the
quotation engine's expected precision band (MAE), with an explicit caveat about feature
leakage.

![Section 5 — Predictive Quotation Optimisation](5.png)
*Predicted vs. actual spend against the ideal-fit diagonal; the tight fit reflects both model accuracy and the mathematical structure of the features (R² ≈ 0.945, MAE ≈ $29,067).*

### Section 6 — Budget Fit Matrix (Supply Constraints)
Affordability by category at three budget levels (P25 ≈ $57K, P50 ≈ $101K, P75 ≈ $207K):

| Budget level | Most constrained categories |
|---|---|
| Median (~$101K) | Venue ≈ 57%, Entertainment ≈ 60% affordable |
| Small (~$57K) | Entertainment & Logistics ≈ 19% affordable (fewer than 1 in 5 vendors) |

Rule derived: if affordable vendors in a category fall below ~30%, warn the user **before**
running the search.

![Section 6 — Budget Fit Matrix](6.png)
*Heatmap of vendor affordability (category × budget level), red→green. Venue and Entertainment are the first categories to become supply-constrained as budgets shrink.*

### Section 7 — Cost Allocation DNA (Cross-Dataset Integration)
Category cost shares vary by **less than 2 percentage points** across all 10 event types —
stable enough to use as budget-split baselines:

| Category | Avg share |
|---|---|
| Catering | 30.4% |
| Venue | 22.8% |
| AV_Technology | 17.5% |
| Entertainment | 10.4% |
| Photography_Video | 7.6% |
| Logistics | 5.7% |
| Security | 5.7% |

Catering + Venue + AV together account for **≈70.6%** of every event budget.

![Section 7 — Cost Allocation DNA](7.png)
*Left: average cost share per category across all 3,000 events. Right: cost share by category × event type — near-identical columns (<2pp variation) validate fixed allocation ratios.*

### Section 8 — K-Means Clustering (Segmentation)
K = 4 clusters for both events and vendors (chosen for interpretability; the elbow is
gradual). The standout segment is **"Budget Champions": 2,263 vendors** offering roughly
Tier-2 pricing with an average rating of **≈4.56** — high quality at low cost — which the
recommender can prioritise for cost-conscious briefs.

![Section 8 — K-Means Clustering & PCA](8.png)
*Six panels — elbow, PCA scatter, and cluster-profile heatmap for events (top) and vendors (bottom). The Budget Champions region stands out in the vendor PCA scatter.*

**Event clusters (K = 4):**

| Cluster | Label | Avg $/guest | Avg guests | Avg success |
|---|---|---|---|---|
| 0 | High-Budget Premium | $547 | 503 | 4.1 |
| 1 | Mid-Scale Underperforming | $231 | 367 | 3.1 |
| 2 | Mid-Scale High-Quality | $220 | 418 | 4.4 |
| 3 | Large-Format Events | $251 | 1,565 | 3.8 |

**Vendor clusters (K = 4):**

| Cluster | Label | Avg tier | Avg rating | Avg $/day |
|---|---|---|---|---|
| 0 | Budget Champions | 2.3 | 4.56 | $4,969 |
| 1 | Budget Underperformers | 2.5 | 3.64 | $5,511 |
| 2 | Mid-Tier Generalists | 2.9 | 4.10 | $8,283 |
| 3 | Premium Tier | 4.8 | 4.10 | $25,861 |

*Cluster labels are defined in the notebook; the "Budget Champions" segment (Tier-2 pricing, ~4.56 rating) is the most actionable — strong quality at a low day rate.*

### Section 9 — LLM Quality Audit
Three classes of issues in the AI-generated text were identified and handled:

| Issue | Extent | Handling |
|---|---|---|
| Prompt-leakage prefix | 384 profiles | Cleaned during preprocessing |
| Vendor-name hallucination | **17.8%** of profiles reference the wrong company | Runtime name injection from the structured `vendor_name` column |
| City hallucination | 0 detected | — |

Text completeness was also verified (no truncated profiles or narratives).

![Section 9 — LLM Quality Audit](9.png)
*Text-length completeness, the 384 prompt-leakage artifacts (pre-cleaning), the 17.8% vendor-name mismatch donut, and sample cases where the model invented a different company name.*

---

## 8. Key Findings & Business Insights

**1. Event type is the master pricing signal.**
*Evidence:* ~5× spread in median budget-per-guest across event types, dwarfing every other
variable. *Implication:* a simple, transparent `event_type → budget/guest` lookup is a
credible foundation for first-pass quoting. *Use:* powers the Cost Estimation lookup table.

**2. Under-quoting is systematic, not situational.**
*Evidence:* 55% of events run over budget with a uniform ≈1.02 mean utilisation across all
types. *Implication:* quotes built from the original budget alone are biased low. *Use:* the
quotation logic applies a universal correction factor plus a documented buffer.

**3. Price does not buy quality.**
*Evidence:* near-zero correlation between price tier and average rating; flat rating curves in
every category. *Implication:* selecting the priciest vendor is not a quality strategy.
*Use:* the recommender ranks on composite quality + semantic fit, and the "Budget Champions"
cluster becomes the go-to pool for value.

**4. Budget allocation is remarkably stable.**
*Evidence:* <2pp variation in category cost shares across all event types. *Implication:*
one allocation formula generalises across the whole portfolio. *Use:* fixed ratios split any
quote into per-category budgets.

**5. Supply is budget-constrained where it matters most.**
*Evidence:* at median budgets only ~57–60% of Venue/Entertainment vendors are reachable, and
as low as ~19% at small budgets. *Implication:* recommendations can silently fail if
affordability isn't checked first. *Use:* a pre-search budget warning per category.

**6. Generated text needs architectural guardrails.**
*Evidence:* 17.8% of vendor profiles name the wrong company. *Implication:* generated prose
cannot be a factual source. *Use:* vendor identities are always injected from structured data
during RFP/Run-of-Show generation.

---

## 9. Metrics & KPIs

The metrics below are the ones **actually computed and used** in the project:

| Metric | Value / definition | Role |
|---|---|---|
| Budget-overrun rate | **55.0%** of events over budget | Quantifies the under-quoting problem |
| Mean utilisation (`util_rate`) | **≈1.02** (P90 ≈ 1.10, max 1.50) | Quotation correction factor + buffer |
| Composite vendor score | `0.4·rating_norm + 0.4·SLA + 0.2·value_score` (~0.13–0.87) | Vendor ranking |
| Category affordability % | Share of vendors within a category's allocated budget | Budget-fit / warning rule |
| Cost-allocation ratios | 30.4 / 22.8 / 17.5 / 10.4 / 7.6 / 5.7 / 5.7 (%) | Budget splitting |
| Model precision (MAE / R²) | See Section 10 | Quotation precision band |
| Retrieval Hit@5 | 100% on 5 targeted queries | Embedding-model selection |
| Name-hallucination rate | 17.8% | Motivates runtime name injection |

> **Note on planned vs. delivered KPIs.** Several KPIs discussed in the original project
> plan — *Quote Accuracy Rate, Supplier Reliability Score, Margin-at-Risk, Vendor
> Concentration Risk, and a Seasonality Index* — are **not implemented** in the final
> notebook. They are listed under [Future Work](#15-future-work) rather than presented as
> completed.

---

## 10. Machine Learning / AI Approach

The project contains four distinct ML/AI components.

### (a) Random Forest spend model — *supervised regression*
- **Target:** `actual_spend_usd`
- **Features:** `guest_capacity`, `budget_per_guest`
- **Split:** 80/20 train/test, `random_state=42`; `RandomForestRegressor(n_estimators=100)`
- **Result:** R² ≈ **0.945**, MAE ≈ **$29,067** on the test set
- **Interpretation:** the high R² is partly structural — `budget_per_guest × guest_capacity`
  is closely related to spend — so the model behaves largely as a scaling/correction function.
  Its value is defining the quotation engine's expected error band, and the notebook flags
  that it should be validated on real, unseen data before production use.

### (b) K-Means segmentation — *unsupervised clustering*
Events and vendors each clustered with K = 4 (StandardScaler → KMeans → PCA for 2-D view).
Surfaces the actionable **"Budget Champions"** vendor segment (2,263 vendors, high rating,
low price).

### (c) Semantic vendor recommender — *embeddings + retrieval*
- **Embedding-model bake-off:** MiniLM (`all-MiniLM-L6-v2`, 384-d), BGE-small, BGE-base,
  evaluated with **Hit@5** over 5 category-targeted queries.
- **Outcome:** all three models scored **100% Hit@5** on the targeted set, so **encode speed
  broke the tie** — MiniLM won (~9s to encode the full corpus vs. over a minute for BGE-base).
  Embeddings are saved to `vendor_embeddings.parquet` (indexed by `vendor_id`) for fast app
  startup.

  ![Section 11 — Embedding Model Comparison](11.png)
  *Encode time, vector dimensions, and Hit@5 for the three candidates. All tie at 100% Hit@5, so MiniLM's speed advantage decides the winner.*

- **`recommend_vendors()` pipeline:** vectorised **hard filters** (city coverage ∩ seasonal
  availability ∩ per-category budget allocation), then rank survivors by a **blended score:**

  ```
  final_score = 0.60 · semantic_similarity + 0.40 · composite_score
  ```

  Returns the top vendor(s) per category. Five targeted sanity tests confirm the expected
  category is surfaced under the specified constraints (with the explicit caveat that this is
  not a guarantee across all possible briefs).
- **PCA check:** on the 384-d embedding space, **119 components explain 90% of variance**, and
  categories occupy distinguishable regions — descriptive evidence of category-discriminative
  structure (retrieval quality is judged separately by Hit@5).

  ![Section 15 — Embedding Analysis (PCA)](15.png)
  *Left: 1,000 vendor embeddings projected to 2-D, coloured by category. Right: per-component and cumulative explained variance, marking the 119 components needed to reach 90%.*

---

## 11. Business Recommendations

1. **Quote from history, not from the client's opening budget.** Apply the ≈1.02 correction
   factor (plus a ~10% buffer for conservative quotes) so that 9 in 10 events land within the
   quoted range instead of exceeding it.
2. **Lead vendor ranking with quality and fit, never price.** Because price and rating are
   uncorrelated, surface the "Budget Champions" pool first for cost-sensitive clients — better
   ratings at lower day rates.
3. **Check affordability before recommending.** Show a category-level budget warning when
   fewer than ~30% of vendors are reachable (especially Venue and Entertainment), so producers
   can reallocate before a search returns thin results.
4. **Split budgets with the stable allocation ratios,** using them as transparent starting
   points (Catering 30% / Venue 23% / AV 18% …) and adjusting only when a brief clearly
   demands it.
5. **Treat generated text as a draft, not a record.** Keep vendor identities and any
   contractual figures sourced from structured data; use the LLM only for tone and structure.
6. **Prioritise Venue and Entertainment sourcing** in the vendor network, since these are the
   categories where affordable supply runs out first.

---

## 12. Technologies & Tools

| Area | Tools |
|---|---|
| Language & environment | Python, Jupyter / Google Colab (T4 GPU) |
| Data & numerics | pandas, NumPy, SciPy |
| Visualisation | Matplotlib, Seaborn |
| Classical ML | scikit-learn — `RandomForestRegressor`, `KMeans`, `PCA`, `StandardScaler`, `train_test_split`, metrics |
| Embeddings / retrieval | `sentence-transformers` (all-MiniLM-L6-v2), PyTorch |
| Text generation | Hugging Face `transformers`, `huggingface_hub` (Mistral-7B-Instruct-v0.2), TinyLlama-1.1B-Chat |
| Storage | Parquet (`vendor_embeddings.parquet`) |
| Data generation (upstream) | Programmatic generation with `Faker`/NumPy + a small open LLM for narrative fields |
| Intended deployment | Gradio app on Hugging Face Spaces (loads the pre-computed embeddings) |

---

## 13. Project Structure

The structure below reflects the artifacts the project actually produces (one combined
analysis notebook, two source datasets, eleven EDA figures, and the pre-computed embeddings).
The upstream data-generation notebook is included per the project documentation.

```
ProSync-AI/

├── README.md

├── data/
│   ├── dataset_a_events.csv          # 3,000 past events
│   └── dataset_b_vendors.csv         # 7,000 B2B vendors

├── notebooks/
│   ├── prosync_analysis.ipynb        # Preprocessing → EDA → embeddings → recommender → generation
│   └── data_generation.ipynb         # Upstream synthetic-data generation (per documentation)

├── outputs/
│   ├── vendor_embeddings.parquet     # MiniLM vectors, indexed by vendor_id
│   └── figures/
│       ├── S1_profiling_overview.png
│       ├── S2_cost_hierarchy.png
│       ├── S3_underquoting_problem.png
│       ├── S4_vendor_dynamics.png
│       ├── S5_predictive_modeling.png
│       ├── S6_budget_fit_matrix.png
│       ├── S7_cost_allocation_dna.png
│       ├── S8_kmeans_clustering.png
│       ├── S9_llm_quality_audit.png
│       ├── S11_model_comparison.png
│       └── S15_embedding_analysis.png
```

---

## 14. Limitations

- **Synthetic data.** All records are generated, so distributions and relationships reflect
  the generation rules rather than a live market; prices are not real-time.
- **`success_rating` is floored at 2.5.** The dataset contains no catastrophic-failure
  events, so the models cannot learn extreme failure behaviour.
- **Low-cardinality fields.** `guest_capacity` (14 discrete values) and
  `response_time_hours` behave more like ordinal categories than continuous measures.
- **Spend-model leakage.** The Random Forest's high R² partly reflects the mathematical
  relationship between its features and the target; it should not be read as independent
  forecasting power.
- **Narrow evaluation of retrieval.** Hit@5 = 100% is measured on just five targeted
  queries; the recommender's five sanity tests likewise validate behaviour only on
  representative scenarios, not universally.
- **LLM name hallucination (17.8%)** means generated profile text is unreliable for factual
  fields; the mitigation reduces but does not eliminate the underlying model limitation.
- **No live deployment in this repo.** The Gradio/Spaces application is the intended target;
  this project delivers the analytics, the recommender, the generation functions, and the
  pre-computed embeddings it would consume.

---

## 15. Future Work

- **Implement the originally planned KPIs** — Quote Accuracy Rate, Supplier Reliability
  Score, Margin-at-Risk, Vendor Concentration Risk, and a Seasonality Index — and surface them
  in a dashboard.
- **Dedicated seasonality and geography analysis.** City and season are currently used only as
  hard filters; a pricing analysis across cities and seasons would add planning value.
- **Stronger spend modelling** with features that avoid target leakage, plus proper
  cross-validation and calibration on out-of-sample data.
- **Learned recommendation weighting.** Replace the fixed 60/40 semantic/quality blend with a
  weighting tuned against real booking or satisfaction outcomes.
- **Broaden retrieval evaluation** to a large, labelled query set for a defensible Recall@k
  benchmark.
- **Validate on real (non-synthetic) data**, including genuine failure cases, before any
  production use.
- **Ship the Gradio application** end-to-end and integrate with real event-management and
  vendor systems.

---

## 16. Conclusion

ProSync AI demonstrates a complete, honest analytics-to-AI pipeline for B2B event
production. The EDA establishes a small set of durable, decision-ready facts — event type
dominates cost, under-quoting is systematic, price is a poor quality signal, and budget
allocation is stable — and each fact maps to a concrete product rule. On top of that
foundation sit two working AI components: a semantic vendor recommender that respects real
city/season/budget constraints, and a grounded LLM generation module for schedules and
outreach. Just as importantly, the project is candid about what it did **not** achieve — the
synthetic ceiling on failure cases, the leakage in the spend model, the narrow retrieval
evaluation, and the KPIs still on the roadmap — which is what makes the parts that do work
trustworthy.

---

*All data is synthetic. No real companies, events, or individuals are represented.*