What Is the San Francisco Neighborhood Polygon Example in Aerosolve?
Updated
The San Francisco neighborhood polygon example is Aerosolve's demonstration of its geo-based feature capability: it generates neighborhood polygons from listing density in San Francisco using a multi-scale Kd-tree model. It matters if you want to see how Aerosolve turns raw location data into model-ready geographic features rather than treating coordinates as plain numbers.
What the example actually shows
According to the Aerosolve site, the example is described as "Neighborhood polygons based on listing density in San Francisco, generated using a multi-scale Kd-tree model." Two things are happening at once:
- Input: point-level location data (listings in San Francisco), where density — not administrative boundaries — defines the shape.
- Method: a multi-scale Kd-tree, which partitions space recursively and can operate at more than one level of granularity.
- Output: polygon regions that reflect where listings cluster, which can then be used as a feature in a model.
The result is not a map of official San Francisco neighborhoods. It is a data-derived partition of the city, so the boundaries follow density patterns in the underlying listings.
Why Aerosolve uses a Kd-tree for this
A Kd-tree splits space by alternating axes, subdividing regions that contain many points and leaving sparse regions coarse. Applied at multiple scales, this lets the model represent both fine-grained clusters (a dense few blocks) and broader regions (a whole district) within the same structure.
That connects directly to the feature Aerosolve advertises: geo-based features. Instead of feeding latitude and longitude into a model and hoping it learns spatial structure, you can encode location as membership in a learned region — a form of controllable quantization.
How this fits Aerosolve's design goals
The example illustrates three stated properties of the package:
| Property | How the example demonstrates it |
|---|---|
| Geo-based features | Location is transformed into polygon membership |
| Controllable quantization | The Kd-tree scale controls how coarse or fine regions are |
| Human-friendly, debuggable models | Polygons can be drawn and inspected, unlike raw embedding dimensions |
Aerosolve describes itself as "a machine learning package built for humans," with a feature transform language giving developers full control over features and general additive models providing capacity with interpretability. A geographic feature you can plot on a map is a concrete case of that philosophy.
What you need to reproduce the idea
The site does not publish a step-by-step tutorial for this example, so treat the following as the general shape of the task rather than documented menu paths:
- Collect point data with coordinates — for the example, listing locations in San Francisco.
- Build a multi-scale Kd-tree over those points so dense areas subdivide further than sparse ones.
- Extract region boundaries as polygons from the tree's partitions.
- Encode each record by which polygon it falls into, producing a categorical or quantized geo feature.
- Feed that feature into training, using Aerosolve's Scala-based feature training and its lightweight Java API for run-time inference.
The expected result is a model input that carries spatial context while remaining inspectable — you can render the polygons and see exactly what the model considers a "neighborhood."
Common sticking points
- Polygons are data-dependent. Change the listing set and the boundaries move; they are not stable geographic identifiers.
- Scale choice is a real decision. Too fine and each region holds too few records to be useful; too coarse and you lose local signal. The multi-scale design exists precisely because one scale rarely fits all.
- JVM integration is assumed. Aerosolve is built on the JVM, uses Scala for feature training, and offers a Java API for inference, so non-JVM pipelines need a bridge.
If your goal is to understand Aerosolve's geographic feature handling, this example is the clearest illustration on the project site: density in, polygons out, with the Kd-tree scale as the knob you control.