Grocery Store Classifier Results Under Review

Part of the AI for Applied Researchers series · Step 3: Data cleaning

The article documents a 400-label classification exercise. Its reported accuracy, spot-check rates, and feature-importance values are not publicly reproduced.

Google Places API returns thousands of results for "grocery store" across California counties. The results include supermarkets like Safeway and Trader Joe's, but also 7-Eleven locations, gas station minimarts, liquor stores, and restaurants with incidental grocery items.

For food access research, this distinction matters. A convenience store does not provide equivalent food security value to a full-service supermarket. Manual validation of thousands of locations is not feasible. Automated classification becomes necessary.


The Training Data

400 labeled locations (200 confirmed grocery stores, 200 confirmed non-grocery: convenience stores, liquor stores, miscategorized restaurants) provide enough training data for a binary classifier. The labeling takes about two hours: checking each location against its business website and Google Street View imagery.

Google Places provides several features for each location:

The Training Data
Feature Example Values
Business name "Safeway" vs. "QuickStop"
Type tags "supermarket," "convenience_store"
User rating 1-5 scale
Review count 12 vs. 847
Price level $ to $$$$

Our hypothesis: real grocery stores tend to have certain type tags, higher review counts, and names containing words like "market" or "foods" rather than "liquor" or "gas."


Model Iteration

With a labeled dataset, Claude Code can iterate through classifier specifications rapidly. Each cycle (write code, run it, evaluate accuracy, propose modifications) takes minutes rather than hours.

Article-reported iterations (not publicly reproduced):

Iteration 1: Logistic regression, raw features
→ 78% accuracy

Iteration 2: Added text features from business names
  (name_has_market, name_has_liquor, name_has_gas)
→ 84% accuracy

Iteration 3: Parsed Google type tags into binary indicators
→ 88% accuracy

Iteration 4: Added review count interaction terms
→ 91% accuracy

Iteration 5: XGBoost with tuned hyperparameters
→ 94% balanced accuracy

The jump from 78% to 84% came from a simple observation: business names contain signal. "Safeway" and "Trader Joe's" differ systematically from "7-Eleven" and "Chevron Food Mart." Extracting indicator variables for common substrings captures this.

The article attributes the reported final jump to 94% to switching to XGBoost and proposes feature interactions as the explanation. Neither the model output nor that interpretation is publicly reproduced.


What the Model Learned

The article reports the following feature-importance values. No saved public model output currently reproduces the ranking or magnitudes.

Article-reported feature importance, not publicly reproduced
type_supermarket
0.31
type_convenience_store
0.22
log_review_count
0.15
name_has_liquor
0.09
name_has_market
0.08
price_level
0.06
user_rating
0.05
name_has_gas
0.04
Article-reported XGBoost feature importance. The ranking and values are not publicly reproduced and should not be read as verified model evidence.

Within the article-reported ranking, Google type tags receive the largest importance values and name-based features receive smaller values. That descriptive reading remains provisional until a saved output reproduces the model.


Validation

The article reports a spot-check of 50 predictions from each category. The labeled spot-check sample and output are not public, so the 94% and 96% rates are not independently reproduced.

Article-reported spot-check, not publicly reproduced
Grocery → grocery 47/50 · 94%
Non-grocery → non-grocery 48/50 · 96%
False negatives (missed grocery) 3
False positives (wrongly grocery) 2
The article reports 47 of 50 grocery predictions (94%) and 48 of 50 non-grocery predictions (96%) matching the manual review. The sample and results are not publicly reproduced.

The article describes three false negatives as ethnic markets with non-English names and two false positives as a Walgreens and a CVS. Those case labels are article-reported and not publicly reproduced.


Results

The article reports applying the classifier to 6,613 API records, with 4,847 classified as grocery stores and 1,766 as non-grocery. That full-population result is under reconciliation with the related policy articles.

Published classification output under reconciliation
6,613 API records in the published output
4,847 grocery stores (73%)
1,766 non-grocery (27%)

The article reports that classification changes the store count by approximately 27% and that the spot-check implies roughly 6% residual misclassification. Those full-population implications remain provisional until the source populations are reconciled.


Time Investment

Article-reported time investment
2h Manual labeling (400 locations)
1.5h Model iteration with Claude Code
1h Validation spot-checks
4.5h Total
The article reports about 4.5 hours end to end. No public run record reproduces the timing comparison.

Without agent-assisted iteration, this work would require 2-3 days: learning the scikit-learn API, debugging feature engineering code, manual hyperparameter tuning. The agent compresses the implementation bottleneck; the human time investment is almost entirely labeling and validation.

This classify-and-validate loop is the worked example behind the data cleaning step of our Start Here guide, where every transformation is encoded so the agent can run, log, and repeat it.

The workflow is documented in this article. A related folder at the pinned public commit is available for inspection, but it is not designated as evidence for the full 6,613-record classification while that population is under reconciliation.

How to Cite This Research

Cholette, V. (2025, October 29). Grocery store classifier results under review. Too Early To Say. https://tooearlytosay.com/research/methodology/grocery-store-classifier-validation/
Copy citation