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

Uploaded Source

File details

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

File metadata

  • Download URL: sefef-0.1.2.tar.gz
  • Upload date:
  • Size: 113.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.5

File hashes

Hashes for sefef-0.1.2.tar.gz
Algorithm Hash digest
SHA256 716974ceb250e3a7e9c3d7fc2a8a2b93247c1f8559c46985c288b81c40ed9a37
MD5 d18a59b897c8775e02e14d8f911e3af0
BLAKE2b-256 ef2000a96d8e9dc330cc983594023653bd028f800ea48f5a90e2185cc1d13844

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