Spatial Classifier
You recorded a category at scattered points: soil type at sampling pits, habitat at survey plots, land use at field checks. This tool maps the likely class everywhere in between, shows how sure it is about each part of that map, and scores it on whole areas it wasn’t trained on, not just on scattered points next to ones it was.
Upload a point file with a column that labels each point’s class (.geojson, or a shapefile as a single .zip or as .shp/.dbf/.shx selected together), pick that column, and a Random Forest learns which class tends to occur where. The model uses only each point’s position, not the file’s other columns: it answers “given what was found nearby, what’s probably here?” It’s the categorical counterpart of the Kriging Interpolator, which does the same for a numeric value like pH or moisture.
Private by design. Your file is processed entirely in your browser (Python via WebAssembly) — it’s never uploaded to any server, including ours. Nothing to configure, nothing to trust: the code never gets the chance to see your data.
The code itself isn’t shown here — it’s a fixed, non-editable computation using scikit-learn’s RandomForestClassifier underneath. Want to see it built up step by step, in Python and R — including a real gotcha where the two languages disagree on classification vs. regression? Read Predicting Spatial Classes with Random Forest.
First run loads the Python engine — expect about a minute. Instant after that, and again each time you come back to this page.
The filled grid is the model’s prediction; the dots on top are your own labeled points, colored the same way. How solid a cell looks is how much of the forest agrees on its class: solid where nearly every tree votes the same way, faded where they split. On the example, most faded cells sit on the borders between classes, where nearby samples disagree. What the shading can’t flag is distance: a forest can be just as confident far from every sample, simply carrying the nearest class outward, so a solid patch with no dots in it is still a guess. “Uncertain cells” above counts the ones where fewer than 60% of the trees agree.
By default the test points are whole blocks of the map (dashed), not points scattered at random. Scattered test points flatter a map: their neighbours usually stay in training, so the model can copy the point next door instead of predicting somewhere new. The “5-fold CV accuracy” row scores both ways, every point tested once: on the built-in example, random points score about 76% and spatial blocks about 57%.
Which one describes the map? The row below it answers that: a score only holds for predictions made about as far from the data as its test points were. On the example, random test points sit 27 m from the nearest training point (a site-mate), the map’s cells about 73 m, and block test points 193 m. So the random score flatters the map and the blocks score is on the cautious side, but closer: blocks sized to match the map’s distances score about 61-65%. On your own file, if the block distance is far above the map’s, the blocks score is pessimistic; if it’s close, it’s about right.
The map itself is drawn from a forest trained on every point; the held-out points are left out only of the separate forest that scores it. The held-out points are the ones inside the dashed blocks, or, with “Random points”, the dots with a thicker outline (the legend shows whichever applies), and their predictions in the table and the matrix below come from that scoring forest, the one that never saw them. A dot of a different color from the cell under it is a point the map gets wrong even though it was trained on it.
The matrix reads actual class down the side, predicted class across the bottom, so the diagonal is what the model got right and everything off it is where the mistakes went. Click any cell to put those points on the map and the table: unlike the bar chart above it, which selects every point of a class, a cell selects only the held-out points behind that cell — an off-diagonal click is therefore the shortest way to see exactly which points were misclassified, and where they are.
Second tool in the GeoML family. Want to see the actual code, or the real gotcha where R’s randomForest() silently switches from classification to regression if you forget one step? Read the full article.