Skip to main content
N-shot examples allow you to guide Newton’s behavior by providing labeled examples at inference time. For the Newton Omega model, this means building a reference library: a small set of sensor windows you’ve labeled (one or a few per class), embedded once and kept on the client side. New data is classified by comparing its embedding against that library. Key advantage: N-shot classification works with very few examples (often just one per class), eliminating the need for retraining or fine-tuning when you have limited labeled data.

How N-Shot Works

Omega is an encoder: it turns a window of sensor readings into a fixed-size embedding vector via a single Direct Query call. Windows that represent similar physical behavior land close together in embedding space, which makes classification a nearest-neighbor problem:
  1. Build the reference library — for each class (e.g. healthy, broken, overheating), embed a handful of labeled windows and store the vectors with their labels.
  2. Classify new data — embed each incoming window the same way and take a majority vote among its k nearest library vectors (KNN).
Both steps use the same request shape — a data.numeric_array event per channel, no prompt:
The library and the KNN vote live entirely in your client — a few lines of code with no server-side state to manage. The quickstart’s fault-detection example runs this full cycle on real bearing vibration data, reaching 95% accuracy on held-out windows from a library of just 8 labeled examples.

Requirements for N-Shot Examples

In the Direct Query workflow, windowing and normalization are your client’s responsibility. Two of the rules below exist because of that: use one window length everywhere (mixing lengths invalidates KNN distances), and normalize with one scaler fit on your reference pool rather than per window. Skipping either produces a pipeline that runs without errors but classifies poorly.
Format consistency Your reference examples must match the format of your incoming data:
  • Same sampling rate
  • Same variates (columns/channels)
  • Same data formats
  • Same window length (16–1024 timesteps; use one length for both the library and inference windows, since mixing lengths invalidates KNN distances)
  • No leaking of incorrect examples into other classes’ reference data
Consistent normalization Fit one scaler (per-channel mean/std) on your reference pool and apply it to every window — library and inference alike — calling the API with normalize_input: false. Per-window normalization (normalize_input: true) erases cross-window amplitude differences, which are often exactly the signal that separates classes. Coverage Provide at least one example for each possible state or class you want Newton to identify. Quality Examples should be clean, representative instances of each class, taken from contiguous recordings — the encoder reads a window as an ordered series, so windows that span gaps in the data produce misleading embeddings. Avoid noisy or ambiguous examples that could confuse the classification.

When to Use N-Shot Examples

N-shot examples are appropriate when:
  • You have limited labeled data (even just one example per class)
  • You need to classify states or detect patterns that Newton doesn’t recognize by default
  • You want to customize behavior without the overhead of fine-tuning
  • Your classification needs may change frequently, as you can update the reference library without retraining

Learn More

Quickstart: Detect a Machine Fault

The full library → KNN → evaluation cycle on real bearing data, in one runnable script.

Omega Agent Skill

Teach your coding agent the embedding and KNN patterns, including a full-scale evaluation harness.

Data Prep Agent Skill

Clean, split, and featurize time-series data into a leakage-free reference library.

Direct Query API

Request and response reference for the /query endpoint.

Next Steps

If n-shot examples aren’t achieving the accuracy you need, or you have a large labeled dataset, consider Fine-Tuning to train a custom Newton instance.