packages feed

hanalyze-cli-0.2.0.1: README.md

# hanalyze-cli

The command-line front end of [`hanalyze`](../README.md). This package
ships a single executable, **`hanalyze`**, and no library.

It was split out of the umbrella package in Phase 106 for two reasons:

- so that working on the library does not trigger a CLI compile + link every
  time, and
- so that the CLI **depends only on the umbrella's public API** — the fact
  that it never reaches into internal modules is guaranteed structurally
  (`build-depends` names only `hanalyze`).

```bash
cabal build hanalyze          # included in the default cabal.project
cabal run   hanalyze -- --help
```

## Subcommands (15 in total)

### Regression

| Command | What it does |
|---|---|
| `regress` | Classical / Bayesian regression (LM / GLM / GLMM / GP / HBM). **The default** — omitting the subcommand name lands here |
| `ridge` | Regularized regression (Ridge / Lasso / Elastic Net) |
| `kernel` | Kernel regression / RFF approximation |
| `spline` | B-spline / natural cubic regression |
| `quantile` | Quantile regression (τ-quantile, MM-IRLS) |
| `gam` | Generalized additive model (additive B-splines + Ridge) |
| `rf` | Random forest regression (CART + bagging + feature subsets) |
| `multireg` | Multi-output regression (wide CSV; linear / kernel-rbf) |

### Inspecting and plotting data

| Command | What it does |
|---|---|
| `info` | Print per-column type and basic statistics |
| `hist` | Histogram, optionally with a theoretical density overlaid |

### Design of experiments

| Command | What it does |
|---|---|
| `doe` | Generate orthogonal arrays (L_n) |
| `taguchi` | Taguchi method (S/N ratio + factor effects + inner/outer arrays) |

### Reshaping data

| Command | What it does |
|---|---|
| `clean` | Apply per-column cleaning rules (`StripUnits`, `ParseCurrency`, `ParseDecimalEU`, …) |
| `melt` | Wide → long reshaping |
| `regrid` | Align sparse long-form data `[id, z, y]` onto a common grid |

> ⚠ `clean`, `melt` and `regrid` are implemented but missing from the
> `hanalyze --help` listing. Run any of them with no arguments to see its
> usage (e.g. `hanalyze melt`).

## Usage

```bash
# inspect column types and basic statistics
hanalyze info data.csv

# simple regression (subcommand omitted = regress)
hanalyze data.csv x y

# polynomial degrees with a 90% confidence interval
hanalyze data.tsv "x1 x2" y LM --degree -1 2 -2 3 --ci 0.90

# Poisson regression with a log link
hanalyze data.csv x y GLM -d poisson -l log

# random effects (LM + --group → LME, GLM + --group → GLMM)
hanalyze data.csv x y LM --group school

# write an HTML report
hanalyze data.csv x y --report report.html --waic
```

Main options of `regress`:

| Option | Meaning |
|---|---|
| `-d, --dist DIST` | Distribution: `gaussian` / `binomial` / `poisson` (default `gaussian`) |
| `-l, --link LINK` | Link: `identity` / `log` / `logit` / `sqrt` (default: canonical) |
| `--degree SPEC` | Polynomial degree specification (default `1`) |
| `--ci [LEVEL]` | Confidence interval (default `0.95`) |
| `--pi [LEVEL]` | Prediction interval (Gaussian only; default `0.95`) |
| `--group COL` | Grouping column → LME / GLMM |
| `--format FORMAT` | Output format: `html` / `png` / `svg` (default `html`) |
| `--report [FILE]` | Generate an HTML analysis report (default `report.html`) |
| `--waic` | Add WAIC and LOO-CV to the report (requires `--report`) |

Options specific to the other subcommands are printed when you run them with
no arguments (e.g. `hanalyze ridge`).

## Related docs

There is no CLI-specific page yet; `hanalyze <sub>` examples appear inside the
per-feature docs.

- Regression overview: [docs/regression/01-lm.md](../docs/regression/01-lm.md)
- `clean` rules: [docs/io/01-dirty-data.md](../docs/io/01-dirty-data.md)
- `melt` / `regrid`: [io/02-reshape.md](../docs/io/02-reshape.md) /
  [io/03-regrid.md](../docs/io/03-regrid.md)
- `doe` / `taguchi`: [doe/01-doe.md](../docs/doe/01-doe.md) /
  [doe/02-orthogonal-taguchi.md](../docs/doe/02-orthogonal-taguchi.md)
- The HTML that `--report` produces: [visualization/02-report-builder.md](../docs/visualization/02-report-builder.md)

← [repository README](../README.md)