Filter Pandas DataFrames: cleaner ways than boolean masks
Nested boolean masks are hard to read and harder to debug. Cleaner ways to filter Pandas DataFrames with .query(), .isin(), .between() and the .str accessor.
Nested boolean masks are hard to read and harder to debug. Cleaner ways to filter Pandas DataFrames with .query(), .isin(), .between() and the .str accessor.
Raw JSON in an embedding model spends your token budget on braces and quotes. Flattening product data into plain sentences gives the model the kind of text it was trained to read.
A notebook demo is not production. This is what sits between the two: an API contract, a container, infrastructure that suits the workload, and monitoring that catches drift before the predictions quietly go bad.
Metadata filters only take music discovery so far. How CNNs read audio as Mel-spectrograms, how contrastive learning with InfoNCE loss shapes the embeddings, and why the inference belongs outside WordPress.
Fastest-route logic says nothing about what a walk is actually like. How the StreetSense project models urban walking risk with Uber’s H3 indexing, sine and cosine time encoding, and XGBoost under a Tweedie objective.
Fourteen years of WordPress work, one recurring problem: everything ends up in functions.php. Here are the five layers I use to separate hooks, workflows, business rules, database access and outside services, plus a before-and-after AJAX handler.
Multi-GPU training usually stalls on communication, not compute. What nvidia-smi topo and Nsight show you about NCCL overhead, and the DDP settings I change: static graph, bucket views, PowerSGD compression and smaller buckets.
Dongxiang has almost no parallel data, so we fine-tuned Meta’s NLLB-200 instead of prompting a general model. Cleaning the bilingual corpus, checking subword fertility, registering a new language tag, and why Adafactor beat AdamW on one GPU.
Prediction models find patterns; they do not tell you what an action will cause. This post walks through the causal toolkit for that: potential outcomes, DAGs, de-biasing with OLS, propensity matching, and difference-in-differences.
Cursor’s indexer is a RAG pipeline: tree-sitter splits code at logical boundaries, embeddings land in Turbopuffer, and Merkle trees keep the index in sync. Here is how the pieces fit together, and what actually leaves your machine.