Explainable machine-learning integration of pre-task and preparatory EEG: revealing complementary predictive information for expert action reliability.
The 11 matches
- [1] § Materials and methods › Explainability and multiscale integration ↔ code/04_multiscale_integration.py, lines 213–306 · score 0.87 · ridge regression, Nested leave, preparation spectra, multiscale integration, outperform, R2
- [2] § Materials and methods › Unsupervised behavioral decomposition ↔ code/01_behavioral_architecture.py, lines 116–145 · score 0.81 · depth centroid, lateral bias, fine precision, area compactness, zone reliability, Pearson
- [3] § Materials and methods › Spectral features and nested cross-athlete learning ↔ code/04_multiscale_integration.py, lines 71–190 · score 0.78 · logistic regression, target zone, hit, transformed, weighting, class
- [4] § Results › Pre-task alpha organization related to athlete-level reliability and compactness ↔ code/02_pretask_alpha.py, lines 1–18 · score 0.77 · PC1 PC2 placement, fronto central alpha, Pre task alpha, partial correlations, style, coherence
- [5] § Results › Multiscale integration combined complementary predictive information ↔ code/04_multiscale_integration.py, lines 213–306 · score 0.72 · ridge regression, Nested leave, preparation spectra, regional, R2, alpha organization
- [6] § Results › Dominant landing variance reflected individualized organization ↔ code/01_behavioral_architecture.py, lines 116–145 · score 0.70 · depth centroid, lateral bias, fine precision, zone reliability, PC3, components
- [7] § Materials and methods › Spectral features and nested cross-athlete learning ↔ code/03_preparation_decoder.py, lines 34–47 · score 0.70 · logistic regression, feature selection, imputation, L2, weighting, Median
- [8] § Results › Pre-task alpha organization related to athlete-level reliability and compactness ↔ code/02_pretask_alpha.py, lines 1–18 · score 0.68 · PC2 placement style, fronto central, pre task, coherence, IAPF, compactness
- [9] § Results › Multiscale integration combined complementary predictive information ↔ code/04_multiscale_integration.py, lines 71–190 · score 0.65 · preparation coefficients, integrated model, combined model, pre task, outer, Multiscale
- [10] § Materials and methods › Statistical analysis and software ↔ code/02_pretask_alpha.py, lines 119–138 · score 0.53 · controlled PC1, Partial correlations, Pearson, PC2, landing
- [11] § Materials and methods › Experimental procedure ↔ code/01_behavioral_architecture.py, lines 1–16 · score 0.51 · unsupervised PCA, Split half, component, behavioral, landing, athletes
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 357 lines · 13 KB · no license · 4 matches
- #!/usr/bin/env python3
- """Integrate participant-level and trial-level predictive information.
- Pre-task alpha organization supplies a participant-level baseline probability.
- Preparatory EEG supplies within-participant trial evidence. The final analysis
- combines those quantities without allowing the held-out participant to inform
- model fitting, then tests whether averaged preparation features can reconstruct
- the pre-task axis.
- """
- import warnings
- import numpy as np
- import pandas as pd
- from sklearn.feature_selection import SelectKBest, f_classif
- from sklearn.impute import SimpleImputer
- from sklearn.linear_model import LogisticRegression, Ridge
- from sklearn.metrics import brier_score_loss, log_loss, roc_auc_score
- from sklearn.model_selection import LeaveOneGroupOut, LeaveOneOut
- from sklearn.pipeline import Pipeline
- from sklearn.preprocessing import OneHotEncoder, StandardScaler
- from common import (
- DATA,
- RESULTS,
- logit,
- macro_auc,
- sigmoid,
- within_participant_z,
- write_json,
- )
- REGIONS = {
- "frontal": ("F7", "F3", "Fz", "F4", "F8"),
- "central": ("C3", "Cz", "C4"),
- "parietal": ("P7", "P3", "Pz", "P4", "P8"),
- "occipital": ("O1", "O2"),
- }
- BANDS = ("theta", "alpha", "low_beta", "high_beta")
- def one_hot_encoder():
- """Construct a dense encoder compatible with recent and older sklearn."""
- try:
- return OneHotEncoder(
- drop="first", sparse_output=False, handle_unknown="ignore"
- )
- except TypeError:
- return OneHotEncoder(
- drop="first", sparse=False, handle_unknown="ignore"
- )
- def classifier(k, c):
- """Recreate the preparatory EEG classifier used in the decoder analysis."""
- return Pipeline([
- ("impute", SimpleImputer(strategy="median")),
- ("scale", StandardScaler()),
- ("select", SelectKBest(f_classif, k=k)),
- ("model", LogisticRegression(
- C=c,
- penalty="l2",
- class_weight="balanced",
- solver="liblinear",
- max_iter=4000,
- )),
- ])
- def integrate(preparation, predictions, pretask, selections, features):
- """Build pre-task, preparation, and combined held-out predictions.
- The pre-task model estimates an athlete-level prior from alpha organization.
- The preparation model estimates a common trial-level coefficient after
- removing each participant's mean prediction. Their log-odds are added in
- the combined model.
- """
- base = preparation.merge(
- predictions[["participant_id", "trial", "prediction"]],
- on=["participant_id", "trial"],
- how="inner",
- ).merge(
- pretask[["participant_id", "alpha_organization"]],
- on="participant_id",
- how="left",
- )
- y = base["target_zone"].astype(int).to_numpy()
- groups = base["participant_id"].to_numpy()
- output = []
- coefficients = []
- # All components of the integration model are estimated without the outer
- # test participant.
- for train, test in LeaveOneGroupOut().split(base, y, groups):
- participant = groups[test][0]
- if base.iloc[test]["alpha_organization"].isna().all():
- continue
- inner = base.iloc[train].reset_index(drop=True)
- inner_y = inner["target_zone"].astype(int).to_numpy()
- inner_groups = inner["participant_id"].to_numpy()
- inner_prediction = np.full(len(inner), np.nan)
- # Refit the preparation decoder inside the outer training sample so the
- # trial coefficient is based on cross-fitted, rather than fitted, scores.
- for fit, validation in LeaveOneGroupOut().split(
- inner, inner_y, inner_groups
- ):
- choice = selections[
- selections["held_out_participant"].eq(participant)
- ].iloc[0]
- model = classifier(int(choice["k"]), float(choice["C"]))
- with warnings.catch_warnings():
- warnings.simplefilter("ignore")
- model.fit(inner.iloc[fit][features], inner_y[fit])
- inner_prediction[validation] = model.predict_proba(
- inner.iloc[validation][features]
- )[:, 1]
- inner_state = within_participant_z(
- logit(inner_prediction), inner_groups
- )
- encoder = one_hot_encoder()
- participant_design = encoder.fit_transform(
- inner_groups.reshape(-1, 1)
- )
- design = np.column_stack([inner_state, participant_design])
- state_model = LogisticRegression(
- C=1.0,
- solver="liblinear",
- class_weight="balanced",
- max_iter=3000,
- )
- state_model.fit(design, inner_y)
- state_beta = float(state_model.coef_[0, 0])
- participant_training = (
- inner.groupby("participant_id")
- .agg(
- hits=("target_zone", "sum"),
- n=("target_zone", "size"),
- alpha=("alpha_organization", "first"),
- )
- .dropna()
- .reset_index()
- )
- participant_training["smoothed_rate"] = (
- participant_training["hits"] + 0.5
- ) / (participant_training["n"] + 1)
- scaler = StandardScaler()
- x_trait = scaler.fit_transform(participant_training[["alpha"]])
- trait_model = Ridge(alpha=1.0)
- trait_model.fit(
- x_trait, logit(participant_training["smoothed_rate"])
- )
- test_alpha = float(
- base.iloc[test]["alpha_organization"].iloc[0]
- )
- trait_logit = float(trait_model.predict(
- scaler.transform(pd.DataFrame({"alpha": [test_alpha]}))
- )[0])
- test_state = within_participant_z(
- logit(base.iloc[test]["prediction"].to_numpy()), groups[test]
- )
- state_intercept = logit(
- participant_training["hits"].sum()
- / participant_training["n"].sum()
- )
- model_predictions = {
- "pre-task": np.repeat(sigmoid(trait_logit), len(test)),
- "preparation": sigmoid(state_intercept + state_beta * test_state),
- "combined": sigmoid(trait_logit + state_beta * test_state),
- }
- coefficients.append({
- "held_out_participant": participant,
- "preparation_coefficient": state_beta,
- })
- for model, values in model_predictions.items():
- for row, value in zip(test, values):
- output.append({
- "model": model,
- "participant_id": participant,
- "trial": int(base.iloc[row]["trial"]),
- "observed": int(y[row]),
- "prediction": float(value),
- })
- return pd.DataFrame(output), pd.DataFrame(coefficients)
- def summarize_integration(predictions):
- """Report discrimination and calibration for each information source."""
- rows = []
- for model, frame in predictions.groupby("model"):
- y = frame["observed"].to_numpy()
- predicted = frame["prediction"].to_numpy()
- groups = frame["participant_id"].to_numpy()
- _, scores = macro_auc(y, predicted, groups)
- rows.append({
- "model": model,
- "pooled_auc": roc_auc_score(y, predicted),
- "macro_auc": scores.mean(),
- "brier_score": brier_score_loss(y, predicted),
- "log_loss": log_loss(y, predicted),
- "n_trials": len(frame),
- "n_participants": frame["participant_id"].nunique(),
- })
- return pd.DataFrame(rows)
- def cross_scale_reconstruction(preparation, pretask, behavior):
- """Test whether average preparation spectra reconstruct participant axes.
- Regional band-power summaries are evaluated with nested leave-one-out ridge
- regression. Negative held-out R-squared means that predicting the training
- mean would outperform the attempted cross-scale reconstruction.
- """
- feature_columns = [
- column for column in preparation.columns
- if column.startswith(("Prep1_", "Prep2_"))
- ]
- participant = (
- preparation.groupby("participant_id")[feature_columns]
- .mean()
- .reset_index()
- .merge(
- pretask[["participant_id", "alpha_organization"]],
- on="participant_id",
- )
- .merge(
- behavior[["participant_id", "zone_reliability"]],
- on="participant_id",
- )
- .dropna()
- .reset_index(drop=True)
- )
- engineered = pd.DataFrame({
- "participant_id": participant["participant_id"]
- })
- all_features = []
- alpha_features = []
- for stage in ("Prep1", "Prep2"):
- for band in BANDS:
- for region, channels in REGIONS.items():
- names = [
- f"{stage}_{channel}_{band}_log_power"
- for channel in channels
- ]
- name = f"{stage}_{band}_{region}"
- engineered[name] = participant[names].mean(axis=1)
- all_features.append(name)
- if band == "alpha":
- alpha_features.append(name)
- engineered["alpha_organization"] = participant["alpha_organization"]
- engineered["zone_reliability"] = participant["zone_reliability"]
- rows = []
- alphas = (0.1, 1.0, 10.0, 100.0)
- feature_sets = {
- "all_bands": all_features,
- "alpha_only": alpha_features,
- }
- for feature_set, columns in feature_sets.items():
- for outcome in ("alpha_organization", "zone_reliability"):
- y = engineered[outcome].to_numpy()
- prediction = np.full(len(y), np.nan)
- # The ridge penalty is selected inside each outer participant fold.
- for train, test in LeaveOneOut().split(engineered):
- best = None
- for alpha in alphas:
- inner_prediction = np.full(len(train), np.nan)
- for fit_relative, validation_relative in LeaveOneOut().split(train):
- fit = train[fit_relative]
- validation = train[validation_relative]
- model = Pipeline([
- ("scale", StandardScaler()),
- ("ridge", Ridge(alpha=alpha)),
- ])
- model.fit(engineered.iloc[fit][columns], y[fit])
- inner_prediction[validation_relative] = model.predict(
- engineered.iloc[validation][columns]
- )
- error = np.mean((y[train] - inner_prediction) ** 2)
- if best is None or error < best[0]:
- best = (error, alpha)
- model = Pipeline([
- ("scale", StandardScaler()),
- ("ridge", Ridge(alpha=best[1])),
- ])
- model.fit(engineered.iloc[train][columns], y[train])
- prediction[test] = model.predict(
- engineered.iloc[test][columns]
- )
- r2 = 1 - np.sum((y - prediction) ** 2) / np.sum(
- (y - y.mean()) ** 2
- )
- rows.append({
- "feature_set": feature_set,
- "outcome": outcome,
- "n_participants": len(y),
- "loso_r2": r2,
- })
- return pd.DataFrame(rows)
- def main():
- # 1. Load outputs from the previous scripts.
- preparation = pd.read_csv(DATA / "preparation_eeg_features.csv")
- predictions = pd.read_csv(
- RESULTS / "preparation_out_of_sample_predictions.csv"
- )
- selections = pd.read_csv(RESULTS / "preparation_hyperparameters.csv")
- pretask = pd.read_csv(RESULTS / "pretask_analysis_sample.csv")
- behavior = pd.read_csv(DATA / "behavior_summary.csv")
- features = [
- column for column in preparation.columns
- if column.startswith(("Prep1_", "Prep2_"))
- ]
- # 2. Combine participant-level alpha organization with trial-level
- # preparation evidence.
- integrated, coefficients = integrate(
- preparation, predictions, pretask, selections, features
- )
- # 3. Summarize discrimination and calibration for each information source.
- summary = summarize_integration(integrated)
- # 4. Test whether averaged preparation spectra reconstruct pre-task axes.
- reconstruction = cross_scale_reconstruction(
- preparation, pretask, behavior
- )
- # 5. Save results.
- integrated.to_csv(
- RESULTS / "multiscale_predictions.csv", index=False
- )
- coefficients.to_csv(
- RESULTS / "multiscale_coefficients.csv", index=False
- )
- summary.to_csv(
- RESULTS / "multiscale_summary.csv", index=False
- )
- reconstruction.to_csv(
- RESULTS / "cross_scale_reconstruction.csv", index=False
- )
- print(summary.to_string(index=False))
- print("\nCross-scale reconstruction")
- print(reconstruction.to_string(index=False))
- if __name__ == "__main__":
- main()
04_multiscale_integration.py at commit 4d7e7b8, no license · at the source
Overview
Abstract
Introduction: Expert motor behavior varies among athletes and across repetitive actions; however, conventional brain-behavior analyses can conflate these statistical levels. We characterized the behavioral architecture of expert table tennis serves and tested whether pre-task and action-preparatory EEG contribute information at different behavioral scales.
Methods: A total of 22 expert athletes completed 100 cue-directed serves with trial-resolved landing coordinates. Unsupervised principal component analysis characterized complete landing distributions. Eyes-closed pre-task EEG provided a hypothesis-informed alpha-organization index combining individual alpha peak frequency and fronto-central alpha coherence. EEG spectral power during action preparation was evaluated using nested leave-one-athlete-out learning, within-athlete permutation testing, grouped permutation importance, and multiscale probability integration.
Results: The two dominant landing components explained 57.2% of behavioral variance and primarily reflected reproducible individualized placement patterns, whereas a smaller component (7.4% explained variance) was more closely aligned with task-defined performance. Pre-task alpha organization was associated with higher target-zone reliability (r = 0.68, p = 0.002) and a smaller 95% landing area (r = −0.50, p = 0.034; n = 18). Preparatory EEG contained modest information that generalized trial outcomes to unseen athletes (macro AUC = 0.589; p = 0.0063), with predictive information concentrated in theta activity in both preparation stages, Prep2 high-beta activity, and parietal sensors. Athlete-average preparatory activities did not reconstruct pre-task alpha organization under leave-one-athlete-out validation.
Discussion: Pre-task and preparatory EEG carried complementary rather than interchangeable predictive information. Pre-task EEG was related to between-athlete performance propensity, whereas preparatory EEG offered weak but reliable within-athlete trial evidence. The value of the transparent machine-learning framework did not lie solely in achieving high prediction accuracy; rather, it was its capability to discover behavioral structure, test cross-athlete generalization, explain predictive information, and integrate neural evidence at a statistical level relevant to its operation.
Reproduced under the paper's license (CC BY), from the paper cited above.
Repository
Its files are read in the Code ↔ Paper reader above, with 11 matches between paragraphs and lines of code.
Qiwei-Zhao/pre-task-and-preparatory-EEG-of-expert-action-reliability
4d7e7b8196930937c653cdc4bd7c5c4e4abe9584, 11 July 2026Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
6 files
- code/
01_behavioral_architectu , Python, 206 lines, 3 matchesre.py - code/
02_pretask_alpha.py , Python, 166 lines, 3 matches - code/
03_preparation_decoder.p , Python, 280 lines, 1 matchy - code/
04_multiscale_integratio , Python, 357 lines, 4 matchesn.py - code/
common.py , Python, 60 lines - README.md, Text, 26 lines
The paper's code and data availability statement is in the Data section.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 5 scripts, each with its path and the digest of its content;
- 11 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Data availability statement
The de-identified data and analysis code required to reproduce the main findings are available on GitHub: https://
Reproduced under the paper's license (CC BY), from the paper cited above.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 2, 28 September 2026
- Funding: added National Natural Science Foundation of China: 32371129, 32500792; Shanghai University of Sport
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, pages, dates, 2 authors, 7 keywords, 48 references.
Cite
This paper
Zhao, Q., & Zhou, C. (2026). Explainable machine-learning integration of pre-task and preparatory EEG: revealing complementary predictive information for expert action reliability. Frontiers in neuroscience, 20, 1907378. https://
BibTeX
@article{zhao2026explain
author = {Zhao, Qiwei and Zhou, Chenglin},
title = {{Explainable machine-learning integration of pre-task and preparatory EEG: revealing complementary predictive information for expert action reliability}},
journal = {Frontiers in neuroscience},
year = {2026},
month = jul,
volume = {20},
pages = {1907378},
publisher = {Frontiers Media SA},
issn = {1662-4548},
doi = {10.3389/
url = {https://
pmid = {42597548},
pmcid = {PMC13468886}
}
RIS
TY - JOUR
AU - Zhao, Qiwei
AU - Zhou, Chenglin
TI - Explainable machine-learning integration of pre-task and preparatory EEG: revealing complementary predictive information for expert action reliability
T2 - Frontiers in neuroscience
J2 - Front Neurosci
PY - 2026
DA - 2026/
VL - 20
SP - 1907378
SN - 1662-4548
PB - Frontiers Media SA
DO - 10.3389/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.3389/
"type": "article-journal",
"title": "Explainable machine-learning integration of pre-task and preparatory EEG: revealing complementary predictive information for expert action reliability",
"container-title": "Frontiers in neuroscience",
"author": [
{
"family": "Zhao",
"given": "Qiwei"
},
{
"family": "Zhou",
"given": "Chenglin"
}
],
"container-title-short":
"volume": "20",
"page": "1907378",
"DOI": "10.3389/
"PMID": "42597548",
"PMCID": "PMC13468886",
"ISSN": "1662-4548",
"publisher": "Frontiers Media SA",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
7,
30
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.1371/journal.pone.0351872 [code]
- Decoding visual object recognition from EEG signals.Journal: PloS oneIn common: scikit-learn, pandas, SciPy, 1 other tool, EEG, 5 references
- [2] doi:10.1093/cercor/bhag113 [code]
- Long-term reliability and stability of parameterized resting state EEG: evidence from a five-year follow-up.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: scikit-learn, pandas, SciPy, 1 other tool, EEG, 4 references
- [3] doi:10.7554/elife.104053 [code]
- Brain cognition gaps reveal associations with dopamine and factors related to brain health through artificial intelligence prediction of functional connectome.Journal: eLifeIn common: scikit-learn, pandas, SciPy, 1 other tool, 3 references
- [4] doi:10.1038/s41467-026-75661-x [code]
- A neural signature of sleep deprivation in the human brain.Journal: Nature communicationsIn common: scikit-learn, pandas, SciPy, 1 other tool, 3 references
- [5] doi:10.1093/nc/niag029 [code]
- A data-driven approach to identifying and evaluating connectivity-based neural correlates of conscious visual perception.Journal: Neuroscience of consciousnessIn common: scikit-learn, pandas, SciPy, 1 other tool, 3 references
- [6] doi:10.1093/cercor/bhag077 [code]
- The longitudinal development of intrinsic timescales in infancy and their relation to alpha brain rhythm.Journal: Cerebral cortex (New York, N.Y. : 1991)In common: scikit-learn, pandas, SciPy, 1 other tool, EEG, 2 references
- [7] doi:10.3389/fnhum.2026.1806951 [code]
- The theta paradox-delayed reduction of frontal midline theta following downregulation neurofeedback training.Journal: Frontiers in human neuroscienceIn common: EEG, 4 references
- [8] doi:10.7554/elife.108023 [code]
- Challenges in replay detection by TDLM in post-encoding resting state.Journal: eLifeIn common: scikit-learn, pandas, SciPy, 1 other tool, 3 references
- [9] doi:10.1523/eneuro.0370-25.2026 [code]
- Pretraining for Large-Scale Functional Connectome Fingerprinting Supports Generalization and Transfer Learning in Functional Neuroimaging.Journal: eNeuroIn common: scikit-learn, pandas, NumPy, 3 references
- [10] doi:10.1162/imag.a.1321 [code]
- Phase similarity between similar objects indicates representational merging across retrieval training but not sleep.Journal: Imaging neuroscience (Cambridge, Mass.)In common: scikit-learn, pandas, SciPy, 1 other tool, EEG, 2 references
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 5 scripts, and 11 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:6859d96a87a826e1…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
