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.3.3.tar.gz (121.9 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.3.3-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for sefef-2.3.3.tar.gz
Algorithm Hash digest
SHA256 433d14fbe2245be337afe0abc93fd317ff206ad034de08933ec659ac93368b53
MD5 41c022974922b4468485f6f31bf0229f
BLAKE2b-256 b58ff1e1a4cee233e5aa5e8f2ae6a17a8e523ce47a8abda6922849fd78a41523

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: sefef-2.3.3-py3-none-any.whl
  • Upload date:
  • Size: 24.6 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.3.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fa79f833cde8df612ed7bdfa0a5641fb0d04aa7a93aea35b0a30739ae5222518
MD5 4cefc761304baa357675f7d2a353accd
BLAKE2b-256 f59b2ccfece70ebacc1e56cc91f8a67bdecba80fd31c6515afb1f2875281081a

See more details on using hashes here.

Provenance

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