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)

Metadata

Release files for jabs-behavior 0.47.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jabs-behavior 0.47.1
File Size Uploaded
jabs_behavior-0.47.1.tar.gz 14.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jabs-behavior 0.47.1
File Interpreter ABI Platform
jabs_behavior-0.47.1-py3-none-any.whl Python 3 none any Details

Total release size: 35.7 kB

Release files / jabs_behavior-0.47.1.tar.gz

Download URL jabs_behavior-0.47.1.tar.gz
Size 14.7 kB
Tags Source
SHA-256 checksum
How to use checksums
8d4736a63742b56e88bf0ebdb080906d9fc7449f34c87b8493bdc624da0a8f2a
BLAKE2b-256 checksum
How to use checksums
afbde2feafab4626e074ff0413632cf17223c74f26938a789712e4edaea99842
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}

Release files / jabs_behavior-0.47.1-py3-none-any.whl

Download URL jabs_behavior-0.47.1-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e5afd79b0c41aad8987f057b856239991bea6e1f1378b719fb8c7be3d8756021
BLAKE2b-256 checksum
How to use checksums
81c8b17f57fc81e223e45f061f817f562626d3c1746a1b43d46ba18d8b8a93e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","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}
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page