hair : hands-on AI recipes

hair

Do stakeholdes want classification, regression, or optimization? In my experience, they ask all sorts of quirky questions like "which of these is risky?", "what should we try next?", "is this one weird?. Then they leave you to turn that into code.

Here's the good news: all thise things they ask you to do often share parts (distances between rows; summaries of columns; splits; a little statistics, etc). And once they build those parts once and the next task arrives half-written. > new lines 1 2 3 4 5 6 7 8 9 10 task

I call this the hair heuristic: Half Already Implemented (making Reuse easy); i.e. after many tasks, task+1 takes nearly no effort.

Now compare this to asking an LLM for an AI workbench: you get code too big to understand, trust, or change safely, where each change calls for more code, which calls for more changes. That recursive explosion is AI slop.

Small code is an antidote to AI slop: easy to read, trust, change and teach; little to install or attack; and likely to outlive the frameworks it never used.

Sources

ExamplesLines of code
   64  hair/__init__.py
    2  hair/__main__.py
    2  hair/about.py
   69  hair/data.py
   31  hair/dist.py
   53  hair/lib.py
  164  hair/stats.py
  115  hair/tree.py
   67  eg/forest.py
   44  eg/knn.py
   48  eg/nb.py
   43  eg/plot.py
   60  eg/sa.py
Problems
  raise an issue

License
  (c) 2026 by timm. Share and enjoy.

github  NC State Computer Science