http://tiny.cc/luamine

LUAMINE = LUA MINing Engines: lots of useful learners. Three small files, each a few hundred lines long, no dependencies beyond Lua 5.x: generic helpers, AI primitives (Num, Sym, distance, trees, Bayes), and apps (clustering, classification, active learning, GA/DE/SA/LS optimizers, synthetic data, anomaly detection).

# install and test
git clone http://tiny.cc/konfig ../konfig
git clone http://tiny.cc/luamine luamine && cd luamine
lua lapps.lua --all

Sections: NAME | SYNOPSIS | OPTIONS | DATA | TESTS | OUTPUT | EXIT | SEE ALSO | LICENSE | AUTHOR

lib.lua = generic helpers (list, stats, csv, cli, o); luamine.lua = AI primitives (Num, Sym, Cols, dist, tree, like, pick, extrapolate); lapps.lua = apps (kmeans, classify, acquire, bob, ga, de, sa, ls, sample, anomaly); tut.md/tut.html = ten-lecture REPL tutorial (307 worked prompts; rebuild html: make tut.html); style.md = read-fast cheat sheet.

NAME

luamine - multi-objective explanation, optimization, and
anomaly detection via incremental stats, recursive
bi-clustering, and active learning. Lua, three files, zero
dependencies.

SYNOPSIS

lua lapps.lua   [-h] [--FLAG VALUE]... [--ACTION]...
lua luamine.lua [-h] [--FLAG VALUE]... [--ACTION]...
lua lib.lua     [-h] [--FLAG VALUE]... [--ACTION]...

luarocks install luamine

OPTIONS

Shared:
  -t  --train=F   training CSV   ($MOOT/optimize/misc/auto93.csv)
  -T  --test=F    test CSV       (defaults to --train)
      --seed=N    RNG seed       (1)

luamine.lua: --bins --leaf --p --cap --budget --k --m --F --cr
lapps.lua:   --k_cluster --iter --few --start --wait --np
             --gens --tour --mut --de_iter --budget --budget1
             --dot --repeats --check

`lua FILE.lua -h` lists every flag with its default. $MOOT =
data repo root (env var; default ~/gits/moot).

DATA

CSV with self-describing header; no separate schema file:

  first char UPPER  -> numeric (Num)
  first char lower  -> symbolic (Sym)
  suffix '+'        -> numeric goal, maximize
  suffix '-'        -> numeric goal, minimize
  suffix '!'        -> symbolic goal (klass)
  suffix 'X'        -> ignore
  else              -> predictor
  missing value     -> '?'

E.g. auto93.csv: Clndrs,Volume,HpX,Lbs-,Acc+,Model,origin,Mpg+

TESTS

Every action is a test; --all runs them in order:

  lua lib.lua     --all  lists, rand, stats, sames, tabulate,
                         confuse, str, csv
  lua luamine.lua --all  cols, data, dist, cuts, tree, ftree,
                         bayes, mutate, body
  lua lapps.lua   --all  kmeans, kpp, classify, acquire, sample,
                         anomaly, bob, acq, ga, de, sa, ls, race

Each prints `tag = value` check lines; runs end "all pass" or
"N failed". Missing train CSV -> synthetic mock data (still runs).

OUTPUT

Check lines, tables, and trees. E.g. `lua luamine.lua --tree`:

     n     Mpg+  disty  tree
  +  10      30   0.26  Volume <= 105 |  Lbs- <= 2130
  -   8      20   0.69  Volume >  191

`lua lapps.lua --race` prints one merged best-so-far trace
across ga/de/sa/ls, sorted by #evals.

EXIT

0 always (including test failures, which print as FAIL lines;
grep FAIL to detect). Non-zero only on Lua errors (e.g. bad
flag, missing required file for --acq).

SEE ALSO

konfig    http://tiny.cc/konfig      shared Makefile, dotfiles
kah       http://tiny.cc/kah-lua     utility library, same style
moot      http://github.com/timm/moot  optimization datasets
style     http://tiny.cc/luamine#file-style-md  coding conventions

LICENSE

MIT. https://choosealicense.com/licenses/mit/

AUTHOR

Tim Menzies <timm@ieee.org>

NC State ©2026, timm, MIT License
150 words of css
designed.2.last