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-1.3.0.tar.gz (118.4 kB view details)

Uploaded Source

Built Distribution

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

sefef-1.3.0-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sefef-1.3.0.tar.gz
Algorithm Hash digest
SHA256 6e775aba6ff98b5c99c8b8826a416a1fdf9a13854af883a3dc3798b5b72fd45e
MD5 fc633fa2d243f7a97b768ab9f5557a50
BLAKE2b-256 e22a3d38f4ffcecf1697f899c32f9beb5f05c4d2b3e0b76a3d06bfbe45d09593

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for sefef-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b0e7e9cabf055fc2a7b6bb07f8853fdead07c6a3cc5221d3cee0a9e0fe0aba55
MD5 c4ccf48f8a9fe1e8765461af98a153cb
BLAKE2b-256 00d7b1b044635ab9d3b2b1d305cdd0a5caac3a207a679654e6c64a7f35ae5db7

See more details on using hashes here.

Provenance

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