← Selected work
CASE STUDY · P&G · 2020 TO 2024
Revenue contributed to
Shelf analytics program result that my 2020 to 2021 model productionization work contributed to. I rebuilt the model for production; category teams and the service owned its commercial use.
Shelf data processing, from a week
80%+ less processing time after I led the move to the cloud in 2022 to 2023. Building each data batch later went from about two weeks to minutes, 98%+ less time, once I directed its automation with the service’s teams.
Estimated shelf value I helped generate
My batching system enabled analyses supporting shelf-space commitments and shelf-layout decisions; category teams made the final shelf decisions.
Data batches delivered a year, Europe then Europe and the US
Each batch packages one week of store shelf data for the analytics service. 40 a year in Europe, more than 250 after process changes I led, then 500+ once the US joined in 2023 to 2024: more than 12 times the starting volume, an increase of over 1,100%.
MY ROLES
Senior Software Engineering Manager, Machine Learning, on the service, 2020 to 2021. Senior Technical Product Manager and business and technical owner of the shelf-data pipeline that feeds it, 2022 to 2024. Before both, the analytics partner who used the model as a data scientist, 2019 to 2020.
TEAM
A fellow data scientist designed the original two-stage model; I rebuilt it for production. On the pipeline I directed five vendor developers and worked with the analytics service’s product and engineering team and the shelf-planning tool team. Category teams and the service owned the commercial results.
STACK
Azure Databricks · ADLS Gen2 · PySpark · Koalas · pandas · scikit-learn · XGBoost · random forest · statsmodels · Jupyter · SQL · Git and GitHub · Scrum
MY PART
Tuned the model with a holdout and cross-validation, then rebuilt its code as object-oriented PySpark for data prep, training and scoring. Then owned the pipeline: added data-quality checks, led the cloud move, created the finalized US schema, directed five vendor developers, wrote SQL, and aligned three teams on automated batch generation and ingestion.
From store shelf to shelf decision
Store shelf records flow through the pipeline I owned as Senior Technical Product Manager in 2022 to 2024: cloud processing, then data batches that each hold a week of shelf data in an agreed schema. The analytics service ingests each batch and runs the two-stage model I rebuilt for production as Senior Software Engineering Manager, Machine Learning, in 2020 to 2021. Its analytics files inform the shelf-space commitments and layout changes category teams agree with retailers.
Two roles, one system
The problem
Shelf analytics are only as current as the store data that reaches them. P&G’s shelf analytics service turns store shelf records, data on what actually sits on each store’s shelves, into analytics files. Category teams used those files to judge what each shelf position was worth, plan shelf changes and make the case for shelf space with retailers. A late or wrong answer meant a shelf change planned on stale data or a negotiation without evidence.
Part 1: Taking the model to production (2020 to 2021)
I came in knowing the problem. As a data scientist in 2019 and 2020, I was the analytics partner for a shelf analytics program across two beauty categories. I ran shelf analyses for several retailers and outlined the standard readout: a shelf-position index, the best shelf layouts and the drivers that proved significant. In one beauty-category analysis, I examined whether a display fixture improved the performance of a weak shelf position. Shelf layouts with the fixture scored lower on the shelf-position index than those without it at both category and brand level. The comparison challenged the assumption that the fixture compensated for the shelf position.
A fellow data scientist designed the two-stage model, and I adapted it for new categories. It measured how a product’s sales changed after a shelf-layout change, with views at product, brand and category level. Tree-based models explored nonlinear relationships among shelf, price and store features. I compared feature importance with random-noise features and selected drivers for a regression with interactions. The regression produced the standardized coefficients behind the shelf-position index, a relative score for each shelf position that category teams could explain when discussing shelf space with retailers.
During my time as a data scientist, before I became Senior Software Engineering Manager, Machine Learning, the model ran as copied Jupyter notebooks on a laptop, one per category and year, with hard-coded paths and no scheduler. A product-level grid search over hundreds of thousands of rows and about 100 features stalled on a single machine. By mid-2020 I had lifted the modeling notebooks onto Azure Databricks, but training still ran on one node, and every new category meant another hand-edited copy.
Earlier that year I had written an internal talk on software engineering for data scientists, covering refactoring, object-oriented design and regression testing. As Senior Software Engineering Manager, Machine Learning, I applied it: I rebuilt the pipeline as object-oriented code with shared modules instead of copied notebooks, and moved data prep, training and scoring onto Azure Databricks with PySpark, Koalas (pandas on Spark) and Python. The work contributed to $10M in revenue for the shelf analytics program.
Inside the two-stage shelf model
I validated the tree stage with a 20% holdout and five-fold cross-validated tuning. Holdout error ended about a third lower than the starting point at the brand-and-store level, and only a few percent lower at the product-and-store level, where a single product’s sales in a single store are noisier. That is a tuning result on the feature-screening stage, not a measured production lift. The split was by row, so the same stores appeared in training and holdout data, and the same holdout also guided early stopping and regression pruning, so it was not an untouched test set. I treat the gains as optimistic.
Before moving into product management, I coded new features into the service, including sales matching and the retailer’s analytics file.
Part 2: Moving upstream to the data that feeds it (2022 to 2024)
As Senior Technical Product Manager, I became business and technical owner of the European and US shelf-data pipeline that feeds the service. I directed five vendor developers and wrote SQL myself. Data batches set the pace of everything downstream: no batch, no analytics file, no current answer for the next shelf change.
Data quality
The pipeline had no data-quality checks. I added them, including checks for missing data and aggregation errors, to catch problems before data reached the service.
Compute
I led the move of European shelf-data processing to the cloud, cutting processing time from a week to under a day, 80%+ less.
Backfill
During the European expansion, older data batches had to be backfilled. I implemented the temporary, flexible standard a business unit asked for, with a new backfill approach. 50+ batches were backfilled, and developer need fell from 90% to 35% of an FTE.
Volume
Process improvements I led during the European expansion grew data batches delivered from 40 a year to more than 250, and adding the US took deliveries past 500 a year: more than 12 times the starting volume, an increase of over 1,100%.
US proof of concept
Reusing the European practices, I led the load of 12M+ US shelf records into the shelf-planning tool, the system that holds the planned shelf layouts, in three months and within budget, and created the finalized US schema for the service’s first US analytics file. After the proof of concept, production moved to a different architecture outside the tool.
Automation
In 2023 to 2024, I directed the automation of batch generation and ingestion. Building a batch went from about two weeks to minutes, more than 98% less time, and delivery became same-day. That made monthly US shelf analyses possible. Getting there needed three teams to change how they worked: the analytics service’s product and engineering team, the shelf-planning tool team and my vendor developers. I met each team on its own first, explained the change at its level of familiarity and what it would gain, then brought everyone together to agree on one hand-off. I kept a shared roadmap and followed each meeting with written next steps and progress updates. I delivered 500+ batches a year on time across Europe and the US. By my estimate, the flexible batching system helped generate $500M+ in shelf value through shelf-space commitments and shelf-layout changes.
The diagram below shows the data-batch hand-off before and after the automation, with a lane for each team.
The strip below places each change in its year, from the starting point to the automation.
The engineering underneath
Six parts that explain the results: the model and its evaluation, how it reached production, the data-batch contract, data quality and the platform call.
01
Model and features
Two stages. Tree-based models created and screened 100+ shelf, price and store features against random-noise benchmarks; a regression with interactions then estimated the sales change associated with each shelf position. The target was the change in a product’s sales after a shelf-layout change, with brand and category views above it.
02
Model productionization
From copied laptop notebooks and a grid search that stalled on one machine to object-oriented PySpark, Koalas and Python on Azure Databricks: shared modules for data prep, training and scoring, Spark-based data preparation instead of a single machine, one code path for every category.
03
Evaluation
I tuned the tree stage with five-fold cross-validation and reported error on a 20% holdout, which also decided early stopping. The story explains what those numbers do and do not establish.
04
The hand-off contract
The data batch is the contract between pipeline and service: one week of store shelf data in an agreed schema. I created the finalized US schema, then directed automated generation and ingestion with the service’s own product and development teams.
05
Data quality
The pipeline started with no data-quality checks. I added checks for missing data and aggregation errors so bad batches were caught before the service ingested them, directed five vendor developers, and wrote SQL myself.
06
Platform choice
The US proof of concept ran inside the existing shelf-planning tool and reused European practices. Production then moved to a different architecture outside the tool.
Three calls I made
01
Rebuild the notebook model for production
CONTEXT
A fellow data scientist’s two-stage shelf model ran as copied Jupyter notebooks on a laptop, one per category and year, and could not keep up with more data. The alternative was another hand-edited copy for every new category.
WHAT I DID
Tuned the notebook model against a holdout first. Then rebuilt it as object-oriented code with shared modules, moved data prep, training and scoring to Azure Databricks with PySpark and Koalas, and coded new features into the service.
RESULT
Contributed to $10M in revenue and gave every category the same code path.
02
Build a faster way to backfill older data batches
CONTEXT
During the European expansion, older data batches had to be backfilled, and a business unit needed results faster than the existing standard allowed.
WHAT I DID
Implemented the temporary, flexible standard the business unit requested, together with a new technical approach to backfills, rather than keep rebuilding each older batch under the existing standard.
RESULT
50+ batches backfilled, and developer need down from 90% to 35% of an FTE.
03
Prove the US feed before building for production
CONTEXT
The US had no shelf-data feed into the service and no US analytics file, and nobody had run US shelf data through the European process.
WHAT I DID
Ran a proof of concept inside the existing shelf-planning tool, reusing the European practices, and created the finalized US schema, instead of funding a production build on unproven data.
RESULT
12M+ US shelf records loaded in three months, within budget. Production then moved to a different architecture outside the tool, and the US schema was set for the service’s first US analytics file.
What I would do differently
Automate the hand-off before scaling volume
Data batches grew from 40 to more than 250 a year, more than six times the volume (an increase of over 500%), before generation and ingestion were automated. I would start that automation with the service’s teams in year one.
Define the metrics before launch
I would track turnaround as median and worst case per batch, and tie value to the shelf decision each analytics file informed.
Validate the way the model is used
The holdout mixed rows from the same stores, and early stopping used that same holdout. I would hold out whole stores or a later shelf change, keep a separate early-stopping set, and report a second metric beside error.