Blyx

ResidualWatch

Monitoring framework and CLI · 0.1.0

Monitor prediction drift by detecting sustained upward or downward changes in errors against a frozen reference period.

Install ResidualWatch in your editor

Extension RahulChaube.blyx-residualwatch · 0.1.0

The extension includes a runnable Blyx example, function completions and the framework source. For the modular project, extract the starter, open its folder and run blyxc native-run main.blyx with the native toolchain installed.

Create an empty .blyx file, type blyx-residualwatch-demo and accept the completion. Choose Blyx: Run File to run the example.

For an offline installation, choose Extensions: Install from VSIX for Blyx Language first, then for ResidualWatch.

Download the companion Blyx Language VSIX

Run the command-line tool

Extract the archive for your machine and run the included CSV example. Use .\residualwatch.exe in PowerShell. The input header is actual,predicted.

./residualwatch fixtures/shift.csv --reference 3 --limit 3

Reference residuals have mean 0 and sample deviation 1. The first alert is data row 5. The command exits with code 1.

brew install rahulchaube1/blyx/residualwatch

On Windows x64, add the Blyx Scoop bucket once, then install the tool from PowerShell.

scoop bucket add blyx https://github.com/Rahulchaube1/scoop-blyx
scoop install blyx/residualwatch
Scoop manifest

Install with Conda

Create an environment containing ResidualWatch 0.1.0, its Blyx source and a runnable example. Run the second command with Blyx 0.2.1, Rust and a host linker installed.

conda create -y --prefix ./blyx-env --override-channels -c https://rahulchaube1.github.io/blyx-packages blyx-residualwatch=0.1.0=0
blyxc native-run ./blyx-env/share/blyx/residualwatch/main.blyx

To use this package in your application, copy share/blyx/residualwatch/vendor/residualwatch from the environment into your project's vendor directory.

Install the full collection with Homebrew or Scoop

Import into a Blyx project

Install Blyx 0.2.1, Rust 1.85 or newer and a host linker. From the directory containing your entry file, clone this tagged release.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-residualwatch.git vendor/residualwatch

Save this as main.blyx beside vendor and run blyxc native-run main.blyx.

use vendor::residualwatch::residualwatch;
fn main() {
    let reference = rw_fit([9, 10, 11], [10, 10, 10], 0.0);
    let first = rw_step(rw_monitor(), reference, 12.0, 10.0, 0.5, 3.0);
    let second = rw_step(first, reference, 12.0, 10.0, 0.5, 3.0);
    println!(at(reference, 2));
    println!(at(first, 2));
    println!(at(second, 2));
}

Expected output

1
0
1

API and input requirements

Keep rows in time order. The reference residual is actual minus prediction, so a positive alarm means sustained underprediction. A constant reference requires an explicit positive scale floor. Choose thresholds against representative stable data.

APIUse
rw_fit(actual, predicted, min_scale)Freeze row count, mean residual and sample scale from reference data.
rw_training(), rw_train(state, actual, prediction), rw_freeze(state, min_scale)Learn the same reference one observation at a time.
rw_monitor(), rw_step(state, reference, actual, prediction, allowance, limit)Update the detector. The third result is +1, −1 or 0.

Develop and contribute

Open the tagged source to read the implementation and examples. Include the smallest reproducible Blyx program, compiler version and expected result when reporting an issue.