Skip to main content
N-shot examples allow you to guide Newton’s behavior by providing labeled examples at inference time. This is more powerful than lens customization alone because you’re showing Newton exactly what outputs you expect for given inputs.

How N-Shot Works

Instead of training a new model, n-shot examples are provided as part of the lens configuration. Newton uses these examples to understand the pattern you want it to follow, then applies that pattern to new incoming data. 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.

Configuration

N-shot examples are configured differently depending on the lens type. The general pattern is to provide labeled examples in the model_parameters section.

Example: Machine State Lens

For time-series classification, provide CSV files for each state:
model_parameters:
  model_name: OmegaEncoder
  model_version: OmegaEncoder::omega_embeddings_01
  normalize_input: true
  buffer_size: 1024
  input_n_shot:
    healthy: healthy.csv
    broken: broken.csv
    overheating: overheating.csv
  knn_configs:
    n_neighbors: 5
    metric: manhattan
    weights: distance
Each CSV file contains representative sensor data for that machine state. At inference time, Newton compares incoming data against these examples to classify the current state.

Requirements for N-Shot Examples

Format consistency Your examples must match the format of your incoming data:
  • Same sampling rate
  • Same variates (columns/channels)
  • Same data formats
  • Same timestamp formats (for time-series data)
  • No leaking of incorrect examples into other n-shot example files.
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. 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 examples without retraining

Lens-Specific Documentation

For detailed n-shot configuration, refer to your lens documentation:

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.