Skip to content
LabDownloads

Data

Downloads

The trained models behind the app, as small JSON files, with test vectors to check a port against.

Licence and citing

No licence chosen yet: the repository has no licence file, so none is granted for now. The models were trained on open data; credit those datasets too.

Never published

Raw personal data: strap recordings, sleep history or anything from a phone. These files hold trained weights and test vectors from public datasets; the recovery weights are four numbers, not the days they were fitted on.

SleepHow it works →

  • model.json

    The trained sleep models (asleep or awake, and the four stages), with their held-out results.

    Used by: Sleep and nap detection, and the Sleep tab's stages

    Format
    JSON
    Size
    446 KB
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "sleep": { "classes": 1, "initial": [1 item], "learning_rate": 0.1 },
      "sleepMotion": { "classes": 1, "initial": [1 item], "learning_rate": 0.1 },
      "stages": { "classes": 4, "initial": [4 items], "learning_rate": 0.1 },
      "transitions": [[4 items], … 4 items],
      "priors": [0.0498, 0.5839, 0.1489, … 4 items],
      "alpha": 0.5,
      "features": ["act", "ang", "sd", … 20 items],
      "stage_features": ["act", "ang", "sd", … 22 items],
      … 1 more key
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/sleep/model.json"))
    print(m["features"][:5])

    algorithms/sleep/model.jsonsha256 9d0719a45838…

  • vectors.json

    Two hours of one public night, with the features, probabilities and stages the model must produce.

    Used by: The app's tests: its Swift port must reproduce these outputs

    Format
    JSON
    Size
    359 KB
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "source": "sleep-accel 8686948, first 2 h",
      "baseline": 55,
      "acc": [[3 items], … 7200 items],
      "hr": [null, null, null, … 7200 items],
      "features": [[20 items], … 240 items],
      "sleep": [0.0316, 0.0282, 0.027, … 240 items],
      "sleepMotion": [0.0539, 0.0418, 0.0502, … 240 items],
      "stages": [[4 items], … 240 items],
      … 2 more keys
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/sleep/vectors.json"))
    print(m["stages"][0])

    algorithms/sleep/vectors.jsonsha256 f8418a9bb0b6…

ActivityHow it works →

  • model.json

    The trained activity model (still, walk, run, cycle, other), with its leave-one-person-out results.

    Used by: "Looks like you went for a walk" suggestions

    Format
    JSON
    Size
    207 KB
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "model": { "classes": 5, "initial": [5 items], "learning_rate": 0.1 },
      "features": ["act", "ang", "sd", … 15 items],
      "classes": ["still", "walk", "run", … 5 items],
      "results": { "accuracy": 0.9267, "kappa": 0.8961, "recall": {"still", "walk", "run", … 5 keys} }
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/activity/model.json"))
    print(m["classes"])

    algorithms/activity/model.jsonsha256 eb20e76c6835…

  • vectors.json

    Ten synthetic minutes of motion and heart rate, with the features and probabilities the model must produce.

    Used by: The app's tests: its Swift port must reproduce these outputs

    Format
    JSON
    Size
    27 KB
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "acc": [[3 items], … 600 items],
      "hr": [70, 70.4, 70.8, … 600 items],
      "rest": 60,
      "max": 190,
      "features": [[15 items], … 20 items],
      "probabilities": [[5 items], … 20 items]
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/activity/vectors.json"))
    print(m["probabilities"][0])

    algorithms/activity/vectors.jsonsha256 a82504e542e3…

Heart rhythmHow it works →

  • model.json

    The trained rhythm model: 150 small trees, its eight features and the alert threshold.

    Used by: The irregular rhythm check

    Format
    JSON
    Size
    109 KB
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "features": ["nrmssd", "nrmssd2", "pnn50", … 8 items],
      "window": 64,
      "init": -2.245,
      "learning_rate": 0.1,
      "trees": [{"left", "right", "feature", … 5 keys}, … 150 items],
      "threshold": 0.7,
      "consecutive": 6
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/rhythm/model.json"))
    print(m["features"], m["threshold"])

    algorithms/rhythm/model.jsonsha256 959ea7c3c800…

  • vectors.json

    Five windows of public PhysioNet beats, with the features and probability the model must produce.

    Used by: The app's tests: its Swift port must reproduce these outputs

    Format
    JSON
    Size
    4.8 KB
    Updated
    29 Nov 2026
    Download
    What's inside
    [
      { "source": "afdb_04015", "rr": [64 items], "features": [8 items] },
      … 5 items
    ]

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/rhythm/vectors.json"))
    print(m[0]["probability"])

    algorithms/rhythm/vectors.jsonsha256 5944a144a2cb…

RecoveryHow it works →

  • coefficients.json

    The recovery formula's four weights, fitted on 336 days of the author's history (the weights only, no data).

    Used by: The recovery score, once you have 30 nights

    Format
    JSON
    Size
    161 B
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "intercept": 0.7871,
      "hrv": 0.573,
      "rhr": -0.0207,
      "sleep": 0.2244,
      "baseline_days": 30,
      "days": 336
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/recovery/coefficients.json"))
    print({k: m[k] for k in ("hrv", "rhr", "sleep")})

    algorithms/recovery/coefficients.jsonsha256 f47c4ff1ac2c…

  • prior.json

    Starting weights for someone new, fitted on the open IFH-Affect dataset.

    Used by: The recovery score for a new user without history

    Format
    JSON
    Size
    203 B
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "intercept": 1.2651,
      "hrv": 0.029,
      "rhr": -0.1383,
      "sleep": 0.2287,
      "people": 20,
      "test_mae": 4.6382,
      "test_r": 0.7557
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/recovery/prior.json"))
    print(m["test_r"])

    algorithms/recovery/prior.jsonsha256 4c4d4baf08d2…

  • illness.json

    The illness-warning rule that ships, and all 36 rules it was chosen from.

    Used by: The "Unusual vitals" notification

    Format
    JSON
    Size
    5.3 KB
    Updated
    29 Nov 2026
    Download
    What's inside
    {
      "rule": { "kind": "robust", "thr": 2, "k": 2 },
      "all": [{"kind", "thr", "k", … 7 keys}, … 36 items]
    }

    Load it in Python:

    import json, urllib.request
    m = json.load(urllib.request.urlopen("https://pulse.nitish.sh/data/recovery/illness.json"))
    print(m["rule"])

    algorithms/recovery/illness.jsonsha256 c22ad30a1a9f…

How the trees are stored

Each model keeps its trees as flat arrays: for every node a feature index, a threshold, the left and right child (−1 at a leaf) and a leaf value, plus the learning rate and starting score. The features are computed by each algorithm's Python (linked from its Lab page); the test vectors show the exact numbers to expect.