Reorganize directory, add manual dataset and sync tooling
- Move all scripts to scripts/, web assets to web/, analysis results into self-contained data/readings/<type>_<YYYYMMDD>/ directories - Add data/readings/manual_20260320/ with 32 JSON readings from git.medlab.host/ntnsndr/protocol-bicorder-data - Add scripts/json_to_csv.py to convert bicorder JSON files to CSV - Add scripts/sync_readings.sh for one-command sync + re-analysis of any dataset backed by a .sync_source config file - Add scripts/classify_readings.py to apply the LDA classifier to all readings and save per-reading cluster assignments - Add --min-coverage flag to multivariate_analysis.py for sparse/shortform datasets; also applies in lda_visualization.py - Fix lda_visualization.py NaN handling and 0-d array annotation bug - Update README.md and WORKFLOW.md to document datasets, sync workflow, shortform handling, and new scripts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,7 @@ This guide explains how to integrate the cluster classification system into the
|
||||
|
||||
**Version-based compatibility**: The model includes a `bicorder_version` field. The classifier checks that versions match. When bicorder.json structure changes:
|
||||
1. Increment the version number in bicorder.json
|
||||
2. Retrain the model with `python3 export_model_for_js.py`
|
||||
2. Retrain the model with `python3 scripts/export_model_for_js.py data/readings/synthetic_20251116/readings.csv`
|
||||
3. The new model will have the updated version
|
||||
|
||||
This ensures the web app and model stay in sync without complex backward compatibility.
|
||||
@@ -20,8 +20,8 @@ This ensures the web app and model stay in sync without complex backward compati
|
||||
## Files
|
||||
|
||||
- `bicorder_model.json` - Trained model parameters (5KB, embed in app)
|
||||
- `bicorder-classifier.js` - JavaScript implementation
|
||||
- `bicorder-classifier.d.ts` - TypeScript type definitions
|
||||
- `web/bicorder-classifier.js` - JavaScript implementation
|
||||
- `web/bicorder-classifier.d.ts` - TypeScript type definitions
|
||||
|
||||
## Quick Start
|
||||
|
||||
@@ -38,8 +38,8 @@ cp bicorder_model.json ../path/to/bicorder/public/
|
||||
Copy the JavaScript module to your source directory:
|
||||
|
||||
```bash
|
||||
cp bicorder-classifier.js ../path/to/bicorder/src/lib/
|
||||
cp bicorder-classifier.d.ts ../path/to/bicorder/src/lib/
|
||||
cp web/bicorder-classifier.js ../path/to/bicorder/src/lib/
|
||||
cp web/bicorder-classifier.d.ts ../path/to/bicorder/src/lib/
|
||||
```
|
||||
|
||||
### 3. Basic Usage
|
||||
@@ -395,8 +395,8 @@ console.log(classifier.predict(boundary));
|
||||
|
||||
## Questions?
|
||||
|
||||
See the demo in `bicorder-classifier.js` for working examples, or test with:
|
||||
See the test in `web/test-classifier.mjs` for working examples, or test with:
|
||||
|
||||
```bash
|
||||
node bicorder-classifier.js
|
||||
node web/test-classifier.mjs
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user