Skip to main content

SeFEF: Seizure Forecast Evaluation Framework

Project description

SeFEF logo

SeFEF is a Seizure Forecast Evaluation Framework written in Python. The framework standardizes the development, evaluation, and reporting of individualized algorithms for seizure likelihood forecast. SeFEF aims to decrease development time and minimize implementation errors by automating key procedures within data preparation, training/testing, and computation of evaluation metrics.

Highlights:

  • evaluation module: implements time series cross-validation.

  • labeling module: automatically labels samples according to the desired pre-ictal duration and prediction latency.

  • postprocessing module: processes individual predicted probabilities into a unified forecast according to the desired forecast horizon.

  • scoring module: computes both deterministic and probabilistic metrics according to the horizon of the forecast.

Installation

Installation can be easily done with pip:

$ pip install sefef

Simple Example

The code below loads the metadata from an existing dataset from the examples folder, create a Dataset instance, and creates an adequate split for a time series cross-validation.

import json
import pandas as pd
from sefef import evaluation

# read example files
files_metadata = pd.read_csv('examples/files_metadata.csv')
with open('examples/sz_onsets.txt', 'r') as f:
     sz_onsets = json.load(f)

# create Dataset instance and perform TSCV
dataset = evaluation.Dataset(files_metadata, sz_onsets, sampling_frequency=128)
tscv = evaluation.TimeSeriesCV()
tscv.split(dataset, iteratively=False, plot=True)

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

sefef-2.1.5.tar.gz (121.8 kB view details)

Uploaded Source

Built Distribution

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

sefef-2.1.5-py3-none-any.whl (24.5 kB view details)

Uploaded Python 3

File details

Details for the file sefef-2.1.5.tar.gz.

File metadata

  • Download URL: sefef-2.1.5.tar.gz
  • Upload date:
  • Size: 121.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sefef-2.1.5.tar.gz
Algorithm Hash digest
SHA256 74a9032e479e0d325f2b22cfa1c572e1498216636badbc7f1933a1ae2391d3e0
MD5 2e067a253d21fad0c958037558701d83
BLAKE2b-256 8d7220e93d144939b8f65b911c9e14de8bff9961431844f5407cb2cbafd16e59

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefef-2.1.5.tar.gz:

Publisher: release.yml on anascacais/SeFEF

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sefef-2.1.5-py3-none-any.whl.

File metadata

  • Download URL: sefef-2.1.5-py3-none-any.whl
  • Upload date:
  • Size: 24.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for sefef-2.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 a288f2865c72e74c0361fd2360983d175f0dbf60efbf88b87704c2b3015f0a7d
MD5 63d4f04820064f86cce5af74624501d2
BLAKE2b-256 a163869b71505254a4fe94427b249cf3d18c47fa0e97da7afc9a8919a1a5dec2

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefef-2.1.5-py3-none-any.whl:

Publisher: release.yml on anascacais/SeFEF

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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