Skip to content

Reverse Analysis of the Repository

This page records what was verified in the repository, what external sources establish, and what can reasonably be inferred. Proposed models and unresolved modeling choices are kept separately in Model Conjectures.

Readers who are new to advertising measurement should start with Definitions.

How the legacy dataset is created

amazonTestData/generate_sk2_mock_data.py is the only Python script outside ZheyuanWu/. It creates two files for a July 2025 United States and Canada SK-II campaign:

  • generate_ads_report_data() loops through 31 dates, two marketplaces, and four advertising products. It samples impressions, clicks, cost, purchases, and sales from hard-coded uniform ranges.
  • generate_mta_paths_data() emits five fixed customer-path scenarios plus three randomly sized variants per date and marketplace.
  • save_csv() collects the union of every row's keys, sorts the keys alphabetically, fills absent values with empty strings, and writes a file in the process's current working directory.
  • The main block calls those functions and prints row counts.

The generated files currently contain 1,358 Amazon Ads rows and 496 path rows.

Material problems in the legacy generator

  1. It never calls random.seed(), so identical commands do not reproduce identical data.
  2. Its Amazon Ads output has 20 columns, not the finalized 16.
  3. It omits finalized unitsSold.
  4. It writes UNSPECIFIED into raw dimension columns instead of preserving structural null values.
  5. It creates five-segment keys that include interaction type; the finalized contract requires a four-segment normalized touchpoint key.
  6. It uses inconsistent product namespaces: performance paths use values such as SP, while Amazon Marketing Cloud paths use values such as AMAZON_SP.
  7. It writes separate traffic and conversion rows for the same date and touchpoint. Summing clicks over both row types double-counts part of the click volume.
  8. MARKETPLACE_WEIGHTS and PRODUCT_NAME are declared but unused.
  9. Core path conversions are deterministic truncations of fixed rates, including 40 percent to 80 percent conversion. A model can memorize the scenario labels instead of learning a realistic response.
  10. save_csv() derives and alphabetically sorts columns, so it cannot enforce a finalized schema or stable business ordering.

The script remains useful as a historical prototype, but it is not a valid generator for the finalized contract.

How the maintained dataset is created

The maintained code now has two explicit versions. Peer-compatible baseline version 1.0.0 is under ZheyuanWu/simulations/baseline/. Regional extension version 0.1.0 is under ZheyuanWu/simulations/regional/. Both use a configuration file and fixed random seed, and both generate the Amazon-like tables from one shared touchpoint catalog:

  1. configuration.py resolves optional inheritance and touchpoint overrides, loads typed behavior, marketplace, touchpoint, and path parameters, and rejects invalid configurations.

  2. Baseline behavior.py uses only the peer-compatible traffic multiplier and global conversion-noise spread. Regional behavior.py owns optional internet reach, target audience density, economic willingness, and Gini coefficient adjustments.

  3. simulation.py generates one daily performance row per marketplace and normalized touchpoint. Weekly seasonality, a small trend, marketplace scaling, and seeded random noise control volume.

  4. Path conversion follows an explicit logistic response:

    conversion log odds=baseline log odds+marketplace adjustment+active touchpointtouchpoint effect+daily noise+active adjacent pairinteraction effect
  5. Exact Shapley marginal contributions of the known response function become simulation-only ground truth.

  6. validation.py checks exact schemas, numeric ranges, structural nulls, four-segment keys, path-to-performance matching, unique daily keys, and ground-truth credit conservation.

  7. storage.py writes deterministic Comma-Separated Values files or the same logical tables to SQLite.

  8. pipeline.py orchestrates loading, simulation, validation, storage, hashes, and the manifest.

  9. command.py exposes the autonomous command.

The simulator intentionally generates Amazon Ads purchases and Amazon Marketing Cloud path outcomes as separate reporting views. They are correlated through common parameters but are not identical and must not be summed.

Exact formulas are documented in Dataset Generation Flow. Baseline parameters are linked from Peer-Compatible Baseline, while regional provenance and confidence are in Regional Simulation.

What Amazon-like tables can represent

Amazon Marketing Cloud allows advertisers to query event-level records but export only aggregated, pseudonymized outputs that satisfy privacy thresholds. It provides custom path and attribution analysis through a Structured Query Language-like environment.

Amazon has supported configurable first-touch, last-touch, equal-weight, and position-based attribution queries. Amazon's newer Multi-Touch Attribution system uses randomized controlled trials, an ensemble of attribution models, machine learning, and shopping signals. Its published architecture separates a ground-truth system, attribution system, and decision system.

Primary and official sources

How to interpret the two finalized tables

The project expects:

  • one 9-column aggregated Amazon Marketing Cloud path table;
  • one 16-column Amazon Ads daily touchpoint performance table.

These are plausible observational inputs:

  • amc_path_report.csv imitates aggregated journey outcomes;
  • amazon_ads_daily_touchpoint_performance.csv imitates daily cost, traffic, and platform-attributed diagnostic conversions.

They do not contain provably correct causal effects for each path. Without an independent truth label, different allocation methods can be compared, but their disagreement does not reveal which method found true incremental impact.

simulation_ground_truth.csv supplies a synthetic benchmark label. It is not Amazon data and must never become a training feature. Real production evaluation should eventually use randomized holdouts, Amazon multi-touch metrics when eligible, or another credible incrementality design.

What each context area does

amazonTestData/

FileVerified function
generate_sk2_mock_data.pyLegacy two-file simulator described above. It is the folder's only executable Python script.
amazon_ads_report_sample.csv6,205 business rows plus one Chinese description row; 17 legacy columns; five-segment touchpoint keys.
amc_mta_path_report_raw_sample.csv144 business rows plus one Chinese description row; finalized nine path columns but legacy five-segment path elements.
amazon_ads_report_sk2.csvLegacy generator output; 1,358 rows and 20 columns.
amc_mta_paths_sk2.csvLegacy generator output; 496 rows and nine columns.
README.mdNavigation document for the SK-II prototype material.
README_SK2_IMPLEMENTATION.mdProposed collection, cleaning, validation, and analysis snippets. Most snippets are documentation, not installed executable modules.
Amazon_AMS_16_Datasets_DataStructure.mdNarrative version of the 16 Amazon Marketing Stream dataset reference. It states that its field lists are not complete official schemas.
数据采集方案.mdEarlier collection architecture, priority levels, data warehouse model, and cloud examples.
快速参考.mdOne-page summary of priorities, flow, storage, and checks.
实现指南.mdPrototype fragments for cleaning paths and simple attribution. They are not separate tested scripts.
字段映射对照表.mdLegacy mapping from the two samples to performance and path concepts.
SK2_场景数据采集方案.mdCampaign assumptions, target volumes, rates, and schedule used by the legacy generator.
SK2_数据分析快速手册.mdAnalysis examples and expected metrics.
对话记录_SK2_数据采集方案.mdHistorical delivery summary. Its completion claims are not test evidence.

QingyanLi/

This directory contains smaller legacy examples of the same two concepts. The Amazon Ads sample has 1,037 business rows plus one description row and 17 columns. The Amazon Marketing Cloud sample has 12 business rows plus one description row and nine columns. Both use five-segment touchpoints.

Winnie/

The directory contains three campaign-plan Markdown files and three 3,000-row workbooks for North America, Europe, and Asia. Each workbook contains only a daily performance sheet; none contains an Amazon Marketing Cloud path table.

The workbook schemas are systematically shifted:

Final fieldWorkbook content
adProductProduct name
adTypeActual advertising product
creativeTypeActual advertising type
inventoryTypeActual placement
placementActual creative or inventory value

They also use 17 legacy columns, omit unitsSold, and use five-segment keys. The Europe workbook uses marketplace UK with currency EUR; pound sterling would normally be expected for the United Kingdom. These workbooks are scenario references, not finalized training inputs.

AMS_16_Datasets_Detailed.xlsx

The workbook documents 16 proposed Amazon Marketing Stream subscriptions:

  • eight traffic and conversion performance datasets for Sponsored Products, Sponsored Brands, Sponsored Display, and the Amazon Demand-Side Platform;
  • two Amazon Demand-Side Platform funnel and rich-media datasets;
  • four Sponsored Ads management snapshot datasets;
  • one campaign diagnostic recommendation dataset;
  • one Sponsored Products budget recommendation dataset.

Its own notice says the listed dimensions and metrics are analytical summaries rather than complete official schemas. It also states that Amazon Marketing Stream alone cannot reconstruct user-level cross-channel paths.

What amazonTestData/ really is

The folder name sounds like an automated test suite, but its contents indicate that it is a prototype and documentation bundle demonstrating a proposed Amazon data-collection flow. It contains only one executable Python generator and no automated tests.

Current model-training status

No model-training script exists in the repository at the time of this analysis. The legacy script generates data only. The maintained ZheyuanWu/simulations/baseline/ implementation also generates and validates data only.

The project documents mention five heuristic baselines plus a Markov removal-effect model. A Markov chain is an attribution estimator; it is not by itself a strategy-optimization model. Neither the baseline nor regional package trains a model.

Model proposals requiring team review are documented in Model Conjectures.

Current schema limitation

The finalized four-segment touchpoint key does not encode whether a touch was an impression or a click. The path table also contains ordering but no event timestamps.

Therefore:

  • a click-versus-view model cannot distinguish those two behaviors;
  • a true time-decay model cannot measure elapsed time;
  • inventing timestamps would create assumptions that are not present in the source data.

If interaction type or timing matters, the team must add a separate path-event attribute or create a versioned schema. The implementation must not silently return to the legacy five-segment format.

Continue reading

Keep facts, inferences, and recommendations distinct.