Charlie Cooper me (j) projects (k) paintings (l)
🅱️uni ↗ A live San Francisco Muni tracker for iPhone. A collector on a Raspberry Pi archives every 511 vehicle-position feed (every 65 seconds), and an API serves live buses, routes and stops as GeoJSON to an Expo and MapLibre app. Next — gradient-boosted trees to predict travel times on each route segment. Expo · MapLibre · Python · GTFS-realtime · Docker
  1. day 3: training the first tree Oct 18, 2026
  2. day 2: developing a feature set Oct 18, 2026
  3. day 1: looking at and cleaning the data Oct 11, 2026
  4. predictions Oct 11, 2026
  5. decision trees Oct 11, 2026
image
llm extraction evals An evaluation harness for LLMs extracting structured data from securities-litigation filings, built for Stanford Securities Litigation Analytics. A validation set sampled from ~25k human-labeled filings, stratified by event type, and a recall-weighted F-β score (β = 1.5), since a human reviewer can drop a false positive faster than find a miss. Models compared on accuracy against cost. Python · LLM evals
image
paint club ↗ A social app for a ~40-member Bay Area art club, live on the App Store. I built and run the whole stack — a React Native iOS app shipped with over-the-air updates, a React web app, and a FastAPI and PostgreSQL backend in Docker, self-hosted on a Raspberry Pi behind Cloudflare. React Native · Expo · FastAPI · PostgreSQL · Docker
  1. claude can design, but if you pick up the batton it is more paralyzing than freeing Oct 10, 2026
image
sae interp ↗ With three Berkeley collaborators, how the vision encoder of Microsoft's Florence-2 represents race, gender and age. Linear probes recover race from its activations at 62% accuracy across seven groups (chance is 14%); a patch-level sparse autoencoder then breaks those activations into interpretable features, filtered for the ones tied to each group. Results being finalized. PyTorch · sparse autoencoders · interpretability · FairFace
image
sec filing tagger In progress. Teaching a small model to tag SEC financial statements with their official XBRL accounting concepts, scored against the tags companies actually filed and optimized with DSPy and GEPA. Python · DSPy · GEPA · XBRL
  1. driving questions Oct 12, 2026
← back Oct 11, 2026 · 🅱️uni

decision trees

the goal - take tabular data and create a tree where columns’ values decide the path an unclassified datapoint follows.

the tree ends in terminal nodes where the new data point is classified.

there are two types of decision trees -

classifiers and regression trees.

these types are almost identical except for the way that they build the tree. the algorithm for each of them chooses which node to put next in each branch of the tree using a different split scoring method.

**classification trees **

  • def: lead to nodes with discrete outcomes (e.g. occupancy: empty, sparse, busy, full)
  • the algorithm: examine each column as a potential root node. each node can only answer yes or no, so it results in two child nodes in the tree. for our example of occupancy, it could split on a yes/no question like “is this route N?”, “is the time >8am”. we don’t pick the split nodes, the algorithm does. and it does so by split scoring (almost) all possible splitting nodes (some options, especially in columns with many possible values, cannot check all - think “all possible splites of 70 routes into two sets = 2^69”). this process repeats again and again until reaching the **stopping condition.
  • split scoring:
  • stopping condition:

regression

  • def: lead to nodes with numeric outcomes (e.g. segment travel time: 10s, 20s, 23s, 70s, etc.)
  • the algorithm:
  • split scoring:
  • stopping condition:

← back Oct 11, 2026 · 🅱️uni

predictions

I built the frontend and backend of this app while searching for a job as a fullstack engineer at a startup in SF. Since working at that start up, vibe-engineering has significantly usurped this space.

I returned to the project, rebooted it on my raspberry pi and had opus 5.5 give it a once over — which resulted mostly in updated polling frequencies, polish on UX and porting it to RN for ios. It looks basically the same.

The problem with coding nowadays is the speed expectation. You can go lightning fast, so why haven’t you pushed several new fullstack features this week? It’s a wonderful time to be alive, but it takes away the joy, the sense of accomplishment and the learning of slowly wrestling an amorphous idea into effective lines of code.

So, in my long-winded way, I am saying that I am rebooting this project as a place to slowly explore something that interests me: training small ML models to serve accurate arrival-time predictions of SF’s public transit vehicles.

The goal now is to use the public data available every day since 2022 to train some different decision tree variants, with the aim of predicting travel times between each bus stop, respective of route, time of day, other features, etc.

← back Oct 11, 2026 · 🅱️uni

day 1: looking at and cleaning the data

I haven’t used pandas since college ML classes, so I had to shake off the dust first.

I imported all of the observed vehicle stop times from September 2026 (about 10 million records), and then narrowed in on only the N on 09/24/2026.

Initial hurdles:

  1. the calculated time (\(arrival\_at\_next\_stop - departure\_at\_previous\_stop\)) contained a significant amount of negative numbers… as in negative travel times from stop A to stop B. It wasn’t terribly widespread, but did account for ~4% of the data,

  2. sometimes 511 sends the hour of the day as 24:MM:SS when it is past midnight on the same trip originatingthe day before, sometimes they send it as 00:MM:SS. It is unpredictable. This messed with segment_travel_time calculations when, for example, stop A says 24:05:00 and stop B says 24:07:00.

I dropped the negative values and made the after-midnight times uniform using the latest time recorded in the trip. then I called it a day.

← back Oct 18, 2026 · 🅱️uni

day 2: developing a feature set

While contemplating my initial feature set, I began to wonder what would be better: a single tree for all routes in SF, or a distinct tree for each route.

My initial compulsion to consider this was based on the possibility of more explicit feature sets upon knowing the precise stops and number of stops per route. I imagined a certain number of new features. What becomes clear after deeper exploration, however, is that even trips on the same route use different stops unpredictably. With that said, it is still worth comparing the two methods even with the same feature set to begin with.

My hypothesis is that the natural splitting on route id inside the single tree will account almost fully for the predictions based on route. Additionally, if some relation between routes’ behavior exists, then the single tree will be more able to account for that.

initial features = [“from_stop_id”, “to_stop_id”, “route_id”, “start_time”, “day_of_week”, “sched_seg_secs”, “prev_seg_1_secs”, “prev_seg_2_secs”]

  • from_stop_id - origin stop
  • to_stop_id - dest stop
  • route_id
  • start_time - time the bus leaves the origin station
  • day_of_week
  • sched_seg_secs - the scheduled arrival published by 511 for this trip
  • prev_seg_1_secs - the time the current vehicle took on the previous segment
  • prev_seg_2_secs - the time the current vehicle took two segments ago

with these features as a jumping off point, and the data decently cleaned, we can begin training tomorrow

← back Oct 18, 2026 · 🅱️uni

day 3: training the first tree

training the first tree

← back Oct 10, 2026 · paint club

claude can design, but if you pick up the batton it is more paralyzing than freeing

test

← back Oct 12, 2026 · sec filing tagger

driving questions

  1. how good are dspy and gepa?
  2. is it worth hiding the prompt?
  3. can it help small/opensource models outperform larger frontier models on rote doc processing tasks?