Skip to main content

JABS behavior event processing and postprocessing filters

Project description

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)

Project details


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.41.0a5.tar.gz (6.5 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.41.0a5-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

Details for the file jabs_behavior-0.41.0a5.tar.gz.

File metadata

  • Download URL: jabs_behavior-0.41.0a5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.41.0a5.tar.gz
Algorithm Hash digest
SHA256 d77f9fbb2302bde4a28db9bab4a410b029dc6c26aa8a08011b6d168a9ee93bdd
MD5 810f8833580cb0cda0e19b2ce9e916e3
BLAKE2b-256 f9e0823260f6c067ecee5ecb9de07d8ce5bc0550b08ba03617952e77922447c0

See more details on using hashes here.

File details

Details for the file jabs_behavior-0.41.0a5-py3-none-any.whl.

File metadata

  • Download URL: jabs_behavior-0.41.0a5-py3-none-any.whl
  • Upload date:
  • Size: 11.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","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.41.0a5-py3-none-any.whl
Algorithm Hash digest
SHA256 524976861276530fdb703fbb23b18f4e011ef0bfc949cd7e30c4fbaf4f84fa92
MD5 f5b76f9891b69dd592a24f35c6b4d95c
BLAKE2b-256 7e7d6a27333fd66b4a04dc495bc09a7ad002c7331139c093e6ca5bc6e7d32833

See more details on using hashes here.

Supported by

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