Skip to content

clean_channels: make the RANSAC random seed a parameter #540

Closed

Description

@neuromechanist

clean_channels draws its RANSAC subsets from numpy.random.RandomState(5489), hardcoded (clean_channels.py, "replicate
MATLAB's default randseed"). A pipeline that records every parameter cannot list or change the seed:

import inspect, eegprep
from eegprep import clean_channels
print(list(inspect.signature(clean_channels).parameters))
# ['EEG', 'corr_threshold', 'noise_threshold', 'window_len', 'max_broken_time', 'num_samples', 'subset_size']
print([l.strip() for l in inspect.getsource(inspect.getmodule(clean_channels)).splitlines() if "RandomState(5489)" in l])

Expected: a keyword (for example seed: int = 5489, so results do not change) and the value used recorded in
EEG["etc"]. calc_projector already accepts a stream.

Checked on eegprep 0.5.0 and on the develop branch at commit 89eb411 (2026-11-05).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions