here you goThings I’ve made, read and saved — shared here.

Archive

9,633 entries: 60 from X, 8,926 from Pinboard, saved 1998 to 2026.

Browse by tag, site, author, folder or language

Tags

Sites

Authors

Folders

Languages

Showing 1,051–1,100 of 9,633

2025

SHAP & LIME Coding Example

Note: AI Generated, and augmented by me.

pip install scikit-learn xgboost shap lime matplotlib pandas
import numpy as np
import pandas as pd
import shap
import lime
import lime.lime_tabular
import matplotlib.pyplot as plt
from sklearn.datasets import load_diabetes
from sklearn.model_selection import train_test_split
from xgboost import XGBRegressor

# ✅ Load dataset
data = load_diabetes()
X = pd.DataFrame(data.data, columns=data.feature_names)
y = data.target

# ✅ Train-test split
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)

# ✅ Train XGBoost regressor
model = XGBRegressor(n_estimators=100, random_state=42)
model.fit(X_train, y_train)

# ✅ Predict on test set
preds = model.predict(X_test)

# ==============================================
# 🔷 Part A: SHAP Values
# ==============================================

# ✅ Initialize SHAP explainer
explainer = shap.Explainer(model, X_train)

# ✅ Explain predictions on test set
shap_values = explainer(X_test)

# ✅ Visualize feature importance (global)
shap.plots.beeswarm(shap_values)

# ✅ Explain a single prediction (local)
shap.plots.waterfall(shap_values[0])

# ==============================================
# 🔷 Part B: LIME
# ==============================================

# ✅ Initialize LIME explainer
lime_explainer = lime.lime_tabular.LimeTabularExplainer(
    X_train.values,
    feature_names=X_train.columns.tolist(),
    verbose=True,
    mode='regression'
)

# ✅ Explain a single instance
i = 0  # index of sample to explain
lime_exp = lime_explainer.explain_instance(
    X_test.values[i],
    model.predict,
    num_features=5
)

# ✅ Visualize LIME explanation
lime_exp.show_in_notebook(show_table=True)
# If running in script, use
# lime_exp.as_pyplot_figure()
# plt.show()

- SHAP provides both global and local explanations with theoretical guarantees based on Shapley values (fair feature attribution). - LIME builds a local surrogate model to approximate the black-box behavior near a specific prediction, giving intuitive explanations quickly. - Limitations: SHAP can be computationally heavy; LIME explanations may vary due to random perturbations.

  • Both are widely used for model interpretability in regulated industries like life sciences, where explainability is critical for compliance and stakeholder trust.

notes

A non-anthropomorphized view of LLMs

addxorrol.blogspot.com

We should think in terms of "this is a function to generate sequences" and "by providing prefixes we can steer the sequence generation around in the space of words and change the probabilities for output sequences". And for every possible undesirable output sequence of a length smaller than , we can pick a context that maximizes the probability of this undesirable output sequence.

A much clearer formulation, which helps more clearly articulate the problems to solve.

kannada-hangul

Here is a concise Kannada-Hangul alphabet chart mapping roughly equivalent sounds. Note: Korean lacks many exact equivalents, so these are approximate phonetic mappings.

Kannada Sound Hangul Example
ಅ a 아 아빠 (appa)
ಆ aa 아 (long) -
ಇ i 이 이 (i)
ಈ ii 이 (long) -
ಉ u 우 우유 (uyu)
ಊ uu 우 (long) -
ಋ ru 르 르노 (Reno)
ಎ e 에 에어 (aeo)
ಏ ee 에 (long) -
ಐ ai 아이 아이 (ai)
ಒ o 오 오이 (oi)
ಓ oo 오 (long) -
ಔ au 아우 아우 (au)
ಅಂ am 암 암 (am)
ಅಃ ah 아ㅎ -
Kannada Sound Hangul Example
ಕ ka 카 카메라 (kamera)
ಖ kha 카 (aspirated) -
ಗ ga 가 가방 (gabang)
ಘ gha 가 (strong) -
ಙ nga 응 응 (eung)
ಚ cha 차 차 (cha)
ಛ chha 차 (aspirated) -
ಜ ja 자 자 (ja)
ಝ jha 자 (strong) -
ಞ nya 냐 냐 (nya)
ಟ Ta 타 타 (ta)
ಠ Tha 타 (aspirated) -
ಡ Da 다 다 (da)
ಢ Dha 다 (strong) -
ಣ Na 나 나 (na)
ತ ta 타 타 (ta)
ಥ tha 타 (aspirated) -
ದ da 다 다 (da)
ಧ dha 다 (strong) -
ನ na 나 나 (na)
ಪ pa 파 파 (pa)
ಫ pha 파 (aspirated) -
ಬ ba 바 바 (ba)
ಭ bha 바 (strong) -
ಮ ma 마 마 (ma)
ಯ ya 야 야 (ya)
ರ ra 라/르 라디오 (radio)
ಲ la 라 라 (la)
ವ va 바 / 와 바 (ba) approximates
ಶ sha 샤 샤워 (syawo)
ಷ Sha 샤 (retroflex not present) -
ಸ sa 사 사 (sa)
ಹ ha 하 하 (ha)
ಳ La 라 (retroflex not present) -
ಕ್ಷ ksha 크샤 -
ಜ್ಞ gya 갸 갸 (gya)

Generated by chatgpt

#kannada #hangul #korean

notes

AI Evals

EvalOps

EvalOps is the control plane for AI evaluation and routing. It helps teams compare LLMs, track performance, and automatically send each request to the best LLM. EvalOps turns evals into your release contract

  • scorecards,
  • scenarios,
  • monitors, and
  • CI gates that keep quality from drifting and get you out of POC purgatory.

The Pillar worklow:

  1. Define -- Scorecards establish quality metrics
  2. Test -- Scenarios provide comprehensive coverage
  3. Gate -- CI Gates block regressions
  4. Monitor -- Continuous production oversight

The LLM quality problem -- Traditional testing breaks down with LLMs. Non-deterministic outputs, subjective quality metrics, and emergent behaviors make it impossible to ensure quality with conventional approaches.

60% of teams deploy untested changes -- No systematic way to validate LLM quality before production

Average 4 hours per regression -- Time spent debugging issues that reach production Manual evaluation bottlenecks -- Human reviewers can't scale with deployment frequency

notes

sphinx

Sphinx is a powerful documentation generator that supports multiple programming languages and markup formats. It is widely used in the Python community and is the documentation generator for many popular Python projects.

Furo -- A clean customisable Sphinx documentation theme, as seen here - Powerful Suite of Default Applications - JOHNAIC: Personal AI Computer

Shibuya -- "Beautiful responsive theme for Sphinx documentation generator. Great supports for Jupyter extensions.", as seen here - Advanced Alchemy (a companion library for SQLAlchemy).

Esbonio is a Language Server for Sphinx documentation projects.

Esbonio aids the writing process by resolving references, providing completion suggestions and highlighting errors. It ensures your local build is always up to date, allowing you to preview your changes in (almost!) real-time. The server itself can even be extended to better suit the needs of your project.

The primary goal of Esbonio is to reduce the friction that comes from trying to remember the specifics of a markup language, so that you can focus on your content and not your tooling.

notes

Desktop AI Tools

  • ollama is a lightweight, open-source AI inference engine that allows users to run large language models on their desktops.
  • FlowDown AI/LLM client application designed to provide users with an efficient AI interaction experience on the desktop.

notes

exif

You can use the exiftool (available on MacOS and other Unixes) to remove GPS information etc from your photos.

$ brew install exiftool
$ exiftool IMG.HEIC
.... prints out a long list of exif information ...
$ exiftool -all= IMG.HEIC
... strips out exif info ..
$ exiftool IMG.HEIC # to confirm reduced exif infor
Original Image with embedded EXIF data
Original Image with embedded EXIF data
Altered Image with reduced EXIF data
Altered Image with reduced EXIF data

notes

Rerankers

Rerankers and Two-Stage Retrieval | Pinecone

Boosting Your Search and RAG with Voyage’s Rerankers – Voyage AI

A reranker is often used as a refinement step in a two-stage retrieval system. In the first stage, embedding-based methods (or lexical search algorithms such as BM25 and TF-IDF) produce a broad set of initial search results. Following this, a re-ranker evaluates the relevance scores between the query and the candidate documents and selects the most pertinent subset of candidate documents based on the scores.

notes

Embeddings

Tools

Embedding Atlas  is a tool from Apple that provides interactive visualizations for large embeddings. It allows you to visualize, cross-filter, and search embeddings and metadata.

Nice exploration UX with hover and tool tip for single data points. Shows you nearest neighbors, which is cool. Coloring based on metadata for better insights -- via

A notebook showing how you can visualize the data stored in Weaviate vector database with Embedding Atlas

Papers

(Weller et al. 2025)

References

notes

AI Coding

Karpathy on Dec 25, 2025 on X:

I've never felt this much behind as a programmer. The profession is being dramatically refactored as the bits contributed by the programmer are increasingly sparse and between. I have a sense that I could be 10X more powerful if I just properly string together what has become available over the last ~year and a failure to claim the boost feels decidedly like skill issue. There's a new programmable layer of abstraction to master (in addition to the usual layers below) involving agents, subagents, their prompts, contexts, memory, modes, permissions, tools, plugins, skills, hooks, MCP, LSP, slash commands, workflows, IDE integrations, and a need to build an all-encompassing mental model for strengths and pitfalls of fundamentally stochastic, fallible, unintelligible and changing entities suddenly intermingled with what used to be good old fashioned engineering. Clearly some powerful alien tool was handed around except it comes with no manual and everyone has to figure out how to hold it and operate it, while the resulting magnitude 9 earthquake is rocking the profession. Roll up your sleeves to not fall behind.

The above appears to be influenced by Claude Opus 4.5 release. Some of the hype around "new layer of abstraction" might be a bit hyped, but there is something to consider about the hype, and see what can be taken away from that.

Claude Code was created by Boris Cherny in Sep 2024.

AI Coding Review Tools

Plannotator - Plan & Code Review for AI Coding Agents -- GitHub - backnotprop/plannotator: Annotate and review coding agent plans and code diffs visually, share with your team, send feedback to agents with one click. · GitHub

AI Coding Tools

Droid CLI "Run a real agent session from your terminal. Droid plans, edits, executes tools, streams results, and keeps the approval model visible." From this thread -- Best tools for AImaxing

OpenCode is an open source agent that helps you write code in your terminal, IDE, or desktop.

Toad is a unified experience for AI in the terminal for AI tools such as OpenHands, Claude Code, Gemini CLI, and many more. All of which run seamlessly under a single terminal UI, thanks to the ACP protocol.

GitHub - just-every/code: Every Code - push frontier AI to it limits. A fork of the Codex CLI with validation, automation, browser integration, multi-agents, theming, and much more. Orchestrate agents from OpenAI, Claude, Gemini or any provider.

Factory.AI an AI-native software development platform that works everywhere you do. From IDE to CI/CD - delegate complete tasks like refactors, incident response, and migrations to Droids without changing your tools, models, or workflow.

Brokk is very different than the typical VSCode based AI Coding agents like cursor etc. See Brokk: AI for Large (Java) Codebases.

Coding with local-llm

Doing AI Coding well

First attempt will be 95% garbage: A staff engineer's 6-week journey with Claude Code — by Vincent Quigley. Spoiler: it's running multiple agents like a small team with daily amnesia.

Parallel AI Agents Are a Game Changer — by Igor Šarčević

Prompt Techniques for AI Code Assistants - @addyosmani

Technique Prompt Template Purpose
1. Role Prompting “You are a senior {language} developer. Review this function for {goal}.” Simulate expert-level code review, debugging, or refactoring
2. Explicit Context Setup “Here’s the problem: {summary}. The code is below. It should do {expected behavior}, but instead it’s doing {actual behavior}. Why?” Frame the problem clearly to avoid generic, surface-level responses
3. Input/Output Examples “This function should return {expected output} when given {input}. Can you write or fix the code?” Guide the assistant by showing intent through examples
4. Iterative Chaining “First, generate a skeleton of the component. Next, we’ll add state. Then handle API calls.” Break larger tasks into steps to avoid overwhelming or vague prompts
5. Debug with Simulation “Walk through the function line by line. What are the variable values? Where might it break?” Get the assistant to simulate runtime behavior and surface hidden bugs
6. Feature Blueprinting “I’m building {feature}. Requirements: {bullets}. Using: {tech stack}. Please scaffold the initial component and explain your choices.” Kick off feature development with AI-led planning and scaffolding
7. Code Refactor Guidance “Refactor this code to improve {goal}, such as {e.g., readability, performance, idiomatic style}. Use comments to explain changes.” Make AI refactors align with your goals, not arbitrary changes
8. Ask for Alternatives “Can you rewrite this using a functional style? What would a recursive version look like?” Explore multiple implementation paths and expand your toolbox
9. Rubber Ducking “Here’s what I think this function does: {your explanation}. Am I missing anything? Does this reveal any bugs?” Let the AI challenge your understanding and spot inconsistencies
10. Constraint Anchoring “Please avoid {e.g., recursion} and stick to {e.g., ES6 syntax, no external libraries}. Optimize for {e.g., memory}. Here’s the function:” Prevent the AI from overreaching or introducing incompatible patterns
AI Code Prompts (via)

Understanding code with the help of AI

CodeBoarding "Helping teams visualize, scale, and collaborate across complex codebases. CodeBoarding transforms complex codebases into clear, visual maps — across every level of abstraction."

#aicoding #prompts

notes