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.1.tar.gz (120.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.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sefef-2.1.1.tar.gz
Algorithm Hash digest
SHA256 0ba034cb04a5a93d292ee68a15201f79ffe6e54b245eb11bb7a928905beba4a9
MD5 c0f4c4ff18b0fb9ba2e1e8c1abedf88f
BLAKE2b-256 ffd3a2854f1d8d56f7a2925fd28eef36929de75fb0578dc6aa6a9740512d7d6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefef-2.1.1.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.1-py3-none-any.whl.

File metadata

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

File hashes

Hashes for sefef-2.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57f0bfe3ae702b070c1aa44f2ca3c640d55f109bbe0e86e8640ba76ab54895dd
MD5 b3037134095fc00d0ea3e8c6d0470d99
BLAKE2b-256 b107f597c1a26e5a215eb48a3d74e3793bf5326f3eed710ded19c0f01e5a86a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for sefef-2.1.1-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