Metadata-Version: 2.4
Name: nhisml
Version: 0.4.0
Summary: Survey-aware ML starter kit for NHIS Adults (2023/2024): fetch, build core data, train baselines, export reproducible outputs.
Author-email: JPSM et al <lreign1@umd.edu>
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.26
Requires-Dist: pandas>=2.1
Requires-Dist: pyarrow>=14
Requires-Dist: scikit-learn>=1.4
Requires-Dist: joblib>=1.3
Requires-Dist: requests>=2.31
Requires-Dist: tqdm>=4.66
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.6; extra == "dev"
Provides-Extra: viz
Requires-Dist: matplotlib>=3.8; extra == "viz"
Provides-Extra: duckdb
Requires-Dist: duckdb>=1.0; extra == "duckdb"
Dynamic: license-file

# nhisml
```text
Survey-aware machine learning toolkit for NHIS Adults data.
```
## Features
```text
- Task-aware training (SRH, smoking, etc.)
- Survey-weighted metrics
- Cross-year evaluation (2023 → 2024)
- Subgroup fairness analysis
- Publication-ready outputs
```
## Installation
```bash

pip install nhisml
```
## Quick start
```bash

#Download and cache raw NHIS Adults public-use files.
nhisml fetch --year 2023 --year 2024
#Builds a clean, analysis-ready core parquet with harmonized variable names.
nhisml build-core --year 2023
```
### Self-rated health
```bash

#Train
nhisml train --in data/core_2023.parquet --task srh_binary
#Evaluate
nhisml evaluate --task srh_binary --latest --year 2024
# Subgroup analysis
nhisml subgroup --task srh_binary --latest --year 2024 --by sex age education
```

### Current smoking
```bash
#Train
nhisml train --in data/core_2023.parquet --task smoking_current
#Evaluate
nhisml evaluate --task smoking_current --latest --year 2024
# Subgroup analysis
nhisml subgroup --task smoking_current --latest --year 2024 --by sex age education
```
### FIGURES & TABLES
```bash

python scripts/make_paper_outputs.py \
  --tasks srh_binary smoking_current \
  --run-for-task srh_binary=runs/<srh_run_dir> \
  --run-for-task smoking_current=runs/<smoking_run_dir>
```
## Others
```bash

nhisml list-tasks # list all available predicton tasks
nhisml describe-task # Describe a specific task.
nhisml list-featuresets # List available feature sets.
nhisml describe-featureset  # Describe feature set contents.
```

## LICENSE
```text
This project is licensed under the MIT License.
See the LICENSE file for details.
...
