Install dotlearn

One self-contained bash binary. Bundles dot's runtime + dotcols's column types + ML libs (tree, naive Bayes, active learning) + three bundled demos.

Requirements

ToolVersionWhy
gawk≥ 4.xindirect calls, FUNCTAB, asorti
bash≥ 4.xarrays, process substitution <(...)
curlany--get-data fetcher

Get gawk

brew install gawk        # macOS
sudo apt install gawk    # debian/ubuntu

Install

curl -sL https://raw.githubusercontent.com/timm/awk/master/dotlearn/dotlearn -o dotlearn
chmod +x dotlearn

Or onto your PATH:

curl -sL https://raw.githubusercontent.com/timm/awk/master/dotlearn/dotlearn -o ~/.local/bin/dotlearn
chmod +x ~/.local/bin/dotlearn

Verify

Run the bundled tree demo on its sample CSV (heart-disease):

./dotlearn --demo tree | head -3

Expect three lines like:

<50,<50
>50_1,>50_1
<50,>50_1

Each line is one held-out test row: predicted,actual. Pipe the full output through tools/metrics.awk for a summary table.

Get example data

./dotlearn --get-data

Pulls 30 curated CSVs (10 classification, 10 regression, 10 optimization) from the moot data repo into ./data/. Same set as dotcols --get-data.

Usage

dotlearn FILE.awk [DATA...]    # run rewritten FILE.awk on DATA (or stdin)
dotlearn a.awk b.awk DATA      # multi-file run; .awk args go through prep
cat DATA | dotlearn FILE.awk   # stdin works too
dotlearn -c FILE.awk           # print rewritten source only
dotlearn --demo NAME [DATA]    # run demos/NAME/*.awk on DATA
                               # (auto-prepends config.csv if present;
                               #  defaults DATA to demos/NAME/sample.*; pass `-` for stdin)
dotlearn --demos               # list available demos under ./demos/
dotlearn --show                # dump bundled lib/*.awk (post-prep)
dotlearn --get-data            # fetch 30 curated CSVs into ./data/
dotlearn --help                # full help

Bundled demos

dotlearn --demo tree                              # decision tree on heart.c.csv
dotlearn --demo nb                                # naive Bayes on heart.c.csv
dotlearn --demo acquire                           # active learning on auto93.csv
dotlearn --demo tree | gawk -f tools/metrics.awk  # tree + per-class summary

Prefer git?

git clone https://github.com/timm/awk
cd awk/dotlearn
./build.sh           # rebuild the dotlearn binary from sources

The repo holds the modular sources (lib/{dist,tree,bayes,treeshow,wins}.awk) plus the three demo dirs and tools/{metrics,shuf}.awk. build.sh bundles them with ../dot/lib/* and ../dotcols/lib/* into the single-file dotlearn binary.