Skip to main content

JABS Behavior (jabs-behavior)

Prediction Postprocessing

The jabs.behavior.postprocessing module provides tools for refining behavior predictions generated by the JABS framework. It includes classes and functions to manipulate and enhance the quality of behavior event predictions through various postprocessing techniques.

  • BehaviorEvents: Run-length encoding of JABS predictions for efficient behavior event manipulation
  • Postprocessing Stages: Configurable pipeline stages for refining behavior predictions:
    • BoutDurationFilterStage: Remove short behavior bouts below a minimum duration
    • BoutStitchingStage: Combine behavior bouts separated by short gaps
    • GapInterpolationStage: Fill gaps in predictions (NONE labels)
  • PostprocessingPipeline: Sequential application of multiple Stages

Usage

import numpy as np
from jabs.behavior.events import BehaviorEvents, ClassLabels
from jabs.behavior.postprocessing import BoutDurationFilterStage, BoutStitchingStage, PostprocessingPipeline 

# Create behavior events from a prediction vector
predictions = np.array([0, 0, 1, 1, 0, 1, 1, 1, 0])
events = BehaviorEvents.from_vector(predictions)

# Apply postprocessing pipeline
config = {
    BoutStitchingStage.name: {"max_stitch_gap": 2},
    BoutDurationFilterStage.name: {"min_duration": 3},
}
pipeline = PostprocessingPipeline(config)
refined_predictions = pipeline.run(predictions)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jabs_behavior-0.46.2.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jabs_behavior-0.46.2-py3-none-any.whl (11.8 kB view details)

Uploaded Python 3

File details

Details for the file jabs_behavior-0.46.2.tar.gz.

File metadata

  • Download URL: jabs_behavior-0.46.2.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for jabs_behavior-0.46.2.tar.gz
Algorithm Hash digest
SHA256 5865e530a8b48fa91d40cd86938efc7156b00d1143ef4a946d8d488b9a47b5a9
MD5 10982d61a42483dc29e0f36362c29f52
BLAKE2b-256 4abb7be35493a7f2c6994cfc9934bddbd3044cd95c2c503cce172e2c9e3c0089

See more details on using hashes here.

File details

Details for the file jabs_behavior-0.46.2-py3-none-any.whl.

File metadata

  • Download URL: jabs_behavior-0.46.2-py3-none-any.whl
  • Upload date:
  • Size: 11.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for jabs_behavior-0.46.2-py3-none-any.whl
Algorithm Hash digest
SHA256 cb679bf16cbf584ad7613d5b1d22bab18eb2618988994f9fbff6706ec8383be4
MD5 abd2eaf72a2fffae232e507e5602f0e4
BLAKE2b-256 ac1a6ad76b8bec67d6e6b863d26513e1f3fbc860d43874db88c92fa1bb16f7d8

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.46.2 This release

2 files

0.46.1

2 files

0.46.0

2 files

0.45.0

2 files

0.44.2

2 files

0.44.1

2 files

0.44.0

2 files

0.43.0

2 files

0.42.1

2 files

0.42.0

2 files

0.41.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page