Benchmarking speech biomarkers of Alzheimer's against cognitive and neural measures.
One block of code here has a permanent identifier (oscr:b:…), listed with the matches below: citable for good, with a page of its own. Select a match and press Cite to copy it. What a block identifier is.
The 1 match
- [1] § METHODS › Machine learning ↔ Scripts/train_models_bayes.py, lines 30 to 65 · score 0.89 · Bayesian optimization, outer loop, inner loop, parallel processing, cross validation, iterations · block
oscr:b:RGBPW9248QX8X-F· Report a mismatch
Paper
Loaded from Europe PMC by your browser; OSCR does not store it: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
Python · 503 lines · 28 KB · no license · 1 match
- import numpy as np
- import pandas as pd
- from pathlib import Path
- from sklearn.model_selection import StratifiedKFold, KFold, LeaveOneOut, StratifiedShuffleSplit, ShuffleSplit
- from sklearn.linear_model import LogisticRegression as LR
- from sklearn.svm import SVC, SVR
- from sklearn.neighbors import KNeighborsClassifier as KNNC
- from sklearn.discriminant_analysis import LinearDiscriminantAnalysis as LDA
- from sklearn.discriminant_analysis import QuadraticDiscriminantAnalysis as QDA
- from sklearn.linear_model import Lasso, Ridge, ElasticNet
- from sklearn.neighbors import KNeighborsRegressor as KNNR
- from sklearn.naive_bayes import GaussianNB
- from sklearn.model_selection import train_test_split
- from sklearn.preprocessing import MinMaxScaler,StandardScaler
- from sklearn.impute import KNNImputer
- from xgboost import XGBClassifier as xgboost
- from xgboost import XGBRegressor as xgboostr
- import itertools,pickle,sys, json
- import logging,sys,os,argparse
- from psrcal.calibration import AffineCalLogLoss
- from sklearn.preprocessing import LabelEncoder
- sys.path.append(str(Path(Path.home(),'scripts_generales'))) if 'Users/gp' in str(Path.home()) else sys.path.append(str(Path(Path.home(),'user','scripts_generales')))
- import utils
- from expected_cost.ec import CostMatrix
- ##---------------------------------PARAMETERS---------------------------------##
- def parse_args():
- parser = argparse.ArgumentParser(
- description='Train models with hyperparameter optimization and feature selection'
- )
- parser.add_argument('--project_name', default='crossling_mci',type=str,help='Project name')
- parser.add_argument('--stats', type=str, default='', help='Stats to be considered (default = all)')
- parser.add_argument('--shuffle_labels', type=int, default=0, help='Shuffle labels flag (1 or 0)')
- parser.add_argument('--stratify', type=int, default=1, help='Stratification flag (1 or 0)')
- parser.add_argument('--calibrate', type=int, default=0, help='Whether to calibrate models')
- parser.add_argument('--n_folds_outer', type=float, default=5, help='Number of folds for cross validation (outer loop)')
- parser.add_argument('--n_folds_inner', type=float, default=5, help='Number of folds for cross validation (inner loop)')
- parser.add_argument('--n_iter', type=int, default=20, help='Number of hyperparameter iterations')
- parser.add_argument('--init_points', type=int, default=20, help='Number of random initial points to test during Bayesian optimization')
- parser.add_argument('--feature_selection',type=int,default=1,help='Whether to perform feature selection with RFE or not')
- parser.add_argument('--fill_na',type=int,default=0,help='Values to fill nan with. Default (=0) means no filling (imputing instead)')
- parser.add_argument('--n_seeds_train',type=int,default=10,help='Number of seeds for cross-validation training')
- parser.add_argument('--n_seeds_shuffle',type=int,default=1,help='Number of seeds for shuffling')
- parser.add_argument('--scaler_name', type=str, default='StandardScaler', help='Scaler name')
- parser.add_argument('--id_col', type=str, default='id', help='ID column name')
- parser.add_argument('--n_boot',type=int,default=1000,help='Number of bootstrap iterations')
- parser.add_argument('--n_boot_train',type=int,default=0,help='Number of bootstrap iterations for training')
- parser.add_argument('--n_boot_test',type=int,default=1000,help='Number of bootstrap iterations for testing')
- parser.add_argument('--shuffle_all',type=int,default=1,help='Whether to shuffle all models or only the best ones')
- parser.add_argument('--filter_outliers',type=int,default=0,help='Whether to filter outliers in regression problems')
- parser.add_argument('--early_fusion',type=int,default=1,help='Whether to perform early fusion')
- parser.add_argument('--overwrite',type=int,default=0,help='Whether to overwrite past results or not')
- parser.add_argument('--parallel',type=int,default=0,help='Whether to parallelize processes or not')
- parser.add_argument('--n_seeds_test',type=int,default=1,help='Number of seeds for testing')
- parser.add_argument('--bootstrap_method',type=str,default='bca',help='Bootstrap method [bca, percentile, basic]')
- parser.add_argument('--round_values',type=int,default=0,help='Whether to round predicted values for regression or not')
- parser.add_argument('--add_dem',type=int,default=0,help='Whether to add demographic features or not')
- parser.add_argument('--cut_values',type=float,default=-1,help='Cut values above a given threshold')
- parser.add_argument('--regress_out',type=str,default='',help='List of demographic variables to regress out from target variable, separated by "_"')
- parser.add_argument('--regress_out_method',type=str,default='linear',help='Whether to perform linear or non-linear regress-out')
- return parser.parse_args()
- def load_configuration(args):
- # Global configuration dictionaries
- config = dict(
- project_name = args.project_name,
- stats = str(args.stats),
- shuffle_labels = bool(args.shuffle_labels),
- shuffle_all = bool(args.shuffle_all),
- stratify = bool(args.stratify),
- calibrate = bool(args.calibrate),
- n_folds_outer = float(args.n_folds_outer),
- n_folds_inner = float(args.n_folds_inner),
- n_iter = float(args.n_iter),
- feature_selection = bool(args.feature_selection),
- fill_na = int(args.fill_na),
- init_points = float(args.init_points),
- n_seeds_train = float(args.n_seeds_train) if args.n_folds_outer!= -1 else float(1),
- n_seeds_shuffle = float(args.n_seeds_shuffle) if args.shuffle_labels else float(0),
- scaler_name = args.scaler_name,
- id_col = args.id_col,
- n_boot = float(args.n_boot),
- n_boot_test = float(args.n_boot_test),
- n_boot_train = float(args.n_boot_train),
- filter_outliers = bool(args.filter_outliers),
- early_fusion = bool(args.early_fusion),
- overwrite = bool(args.overwrite),
- parallel = bool(args.parallel),
- n_seeds_test = float(args.n_seeds_test) if args.n_folds_outer!= -1 else float(0),
- bootstrap_method = args.bootstrap_method,
- round_values = bool(args.round_values),
- add_dem = bool(args.add_dem),
- cut_values = float(args.cut_values),
- regress_out = sorted(list(args.regress_out.split('_'))),
- regress_out_method = str(args.regress_out_method)
- )
- return config
- args = parse_args()
- config = load_configuration(args)
- project_name = config['project_name']
- add_dem = config['add_dem']
- round_values = config['round_values']
- cut_values = config['cut_values']
- regress_out = config['regress_out']
- fill_na = config['fill_na'] if config['fill_na'] != 0 else None
- logging.info('Configuration loaded. Starting training...')
- logging.info('Training completed.')
- ##------------------ Configuration and Parameter Parsing ------------------##
- home = Path(os.environ.get('HOME', Path.home()))
- if 'Users/gp' in str(home):
- data_dir = home / 'data' / project_name
- else:
- data_dir = Path('D:/path/data', project_name)
- results_dir = Path(str(data_dir).replace('data', 'results'))
- main_config = json.load(Path(Path(__file__).parent,'main_config.json').open())
- y_labels = main_config['y_labels'][project_name]
- tasks = main_config['tasks'][project_name]
- single_dimensions = main_config['single_dimensions'][project_name]
- data_file = main_config['data_file'][project_name]
- try:
- test_size = main_config['test_size'][project_name]
- except:
- test_size = 0
- try:
- thresholds = main_config['thresholds'][project_name]
- except:
- thresholds = [None]
- try:
- cmatrix = CostMatrix(np.array(main_config["cmatrix"][project_name])) if main_config["cmatrix"][project_name] is not None else None
- except:
- cmatrix = None
- config['test_size'] = float(test_size)
- config['data_file'] = data_file
- config['tasks'] = tasks
- config['single_dimensions'] = single_dimensions
- config['y_labels'] = y_labels
- config['avoid_stats'] = list(set(['min','max','median','skewness','kurtosis','std','mean','stddev']) - set(config['stats'].split('_'))) if config['stats'] != '' else []
- config['stat_folder'] = '_'.join(sorted(config['stats'].split('_')))
- config['random_seeds_train'] = [int(3**x) for x in np.arange(1, config['n_seeds_train']+1)]
- config['random_seeds_test'] = [int(3**x) for x in np.arange(1, config['n_seeds_test']+1)] if config['test_size'] > 0 else ['']
- config['random_seeds_shuffle'] = [float(3**x) for x in np.arange(1, config['n_seeds_shuffle']+1)] if config['shuffle_labels'] else ['']
- config['bayes'] = True
- if config['calibrate']:
- calmethod = AffineCalLogLoss
- calparams = {'bias':True, 'priors':None}
- else:
- calmethod = None
- calparams = None
- models_dict = {'clf':{
- 'lr':LR,
- 'knnc':KNNC,
- 'xgb':xgboost,
- #'qda':QDA,
- #'lda': LDA
- },
- 'reg':{'lasso':Lasso,
- 'ridge':Ridge,
- 'elastic':ElasticNet,
- #'knnr':KNNR,
- #'svr':SVR,
- #'xgb':xgboostr
- }
- }
- hyperp = json.load(Path(Path(__file__).parent,'hyperparameters.json').open())
- for task in tasks:
- if isinstance(y_labels,dict):
- y_labels_ = y_labels[task]
- else:
- y_labels_ = y_labels
- for y_label in y_labels_:
- dimensions = list()
- if isinstance(single_dimensions,dict):
- single_dimensions_ = single_dimensions[task]
- else:
- single_dimensions_ = single_dimensions
- if isinstance(single_dimensions_,list) and config["early_fusion"]:
- for ndim in range(len(single_dimensions_)):
- for dimension in itertools.combinations(single_dimensions_,ndim+1):
- dimensions.append('__'.join(dimension))
- elif isinstance(single_dimensions_,list) and not config["early_fusion"]:
- dimensions = single_dimensions_
- else:
- dimensions = [single_dimensions_]
- for dimension in dimensions:
- try:
- all_data = pd.read_csv(Path(data_dir,data_file))
- except:
- all_data = pd.read_csv(Path(data_dir,data_file),encoding='latin1')
- all_data = all_data.loc[:, ~all_data.columns.str.match(r'^Unnamed')]
- features = [col for col in all_data.columns if any(f'{x}__{y}__' in col for x,y in itertools.product(task.split('__'),dimension.split('__'))) and 'timestamp' not in col]
- if len(config["avoid_stats"]) > 0:
- features = [col for col in features if all(f'_{x}' not in col for x in config['avoid_stats'])]
- covariates = list(set(regress_out).intersection(set(all_data.columns)))
- config['covariates'] = covariates
- if config['add_dem']:
- for col in set(['sex','age','education','handedness']).intersection(set(all_data.columns)):
- all_data[f'{task}__dem__{col}'] = all_data[col]
- demographic_features = [f'{task}__dem__{col}' for col in all_data.columns if col in ['sex','age','education','handedness']]
- features.extend(demographic_features)
- dimension = dimension + '__dem' if dimension != '' else 'dem'
- print(task,dimension)
- data = all_data[features + [y_label, config['id_col']]]
- data.dropna(axis=1,how='all',inplace=True)
- data.dropna(subset=y_label,inplace=True)
- if cut_values > 0:
- data = data[data[y_label] <= cut_values]
- data = data.reset_index(drop=True)
- if len(np.unique(data[y_label])) > 3:
- config['problem_type'] = 'reg'
- scoring_metric = 'r2'
- else:
- config['problem_type'] = 'clf'
- scoring_metric = 'roc_auc' if len(np.unique(data[y_label])) == 2 else 'norm_expected_cost'
- if config['project_name'] == 'crossling_mci':
- config['problem_type'] = 'reg'
- scoring_metric = 'r2'
- if config['problem_type'] == 'reg' and config['filter_outliers']:
- all_data = all_data[np.abs((all_data[y_label] - all_data[y_label].mean()) / all_data[y_label].std()) < 2]
- #convert y_label to categories
- y = data.pop(y_label)
- y = pd.Series(LabelEncoder().fit_transform(y) if config['problem_type'] == 'clf' else y,name=y_label)
- if data.shape[0] == 0:
- continue
- if config['shuffle_labels'] and config['problem_type'] == 'clf':
- np.random.seed(42)
- zero_indices = np.where(y == 0)[0]
- one_indices = np.where(y == 1)[0]
- # Shuffle and select half of the indices for flipping
- zero_to_flip = np.random.choice(zero_indices, size=len(zero_indices) // 2, replace=False)
- one_to_flip = np.random.choice(one_indices, size=len(one_indices) // 2, replace=False)
- # Flip the values at the selected indices
- y[zero_to_flip] = 1
- y[one_to_flip] = 0
- elif config['shuffle_labels']:
- np.random.seed(42)
- #Perform random permutations of the labels
- y = np.random.permutation(y)
- ID = data.pop(config['id_col'])
- if (config['problem_type'] == 'reg') & ('group' in data.columns) & (config['stratify']):
- strat_col = data.pop('group')
- elif (config['problem_type'] == 'clf') & (config['stratify']):
- strat_col = y
- else:
- strat_col = None
- for model_key, model_class in models_dict[config['problem_type']].items():
- print(model_key)
- held_out = float(config["test_size"]) > 0
- n_folds_outer = config['n_folds_outer']
- n_folds_inner = config['n_folds_inner']
- if held_out:
- n_samples_dev = int(data.shape[0] * (1 - config['test_size']))
- random_seeds_test = config['random_seeds_test']
- else:
- n_samples_dev = data.shape[0]
- random_seeds_test = ['']
- config["n_seeds_test"] = 0
- config["random_seeds_test"] = ['']
- if n_folds_outer== 0:
- n_folds_outer= int(n_samples_dev / np.unique(y).shape[0])
- CV_outer = (StratifiedKFold(n_splits=n_folds_outer, shuffle=True)
- if strat_col is not None
- else KFold(n_splits=n_folds_outer, shuffle=True))
- config["kfold_folder"] = f'l{np.unique(y).shape[0]}out'
- n_samples_outer = n_samples_dev - np.unique(y).shape[0]
- elif n_folds_outer== -1:
- CV_outer = LeaveOneOut()
- n_samples_outer = n_samples_dev - 1
- config["kfold_folder"] = 'loocv'
- elif n_folds_outer < 1:
- CV_outer = (StratifiedShuffleSplit(n_splits=1,test_size=n_folds_outer)
- if strat_col is not None
- else ShuffleSplit(n_splits=1,test_size=n_folds_outer))
- n_samples_outer = int(n_samples_dev*(1-n_folds_outer))
- config['kfold_folder'] = f'{int(n_folds_outer*100)}pct'
- else:
- n_folds_outer = int(n_folds_outer)
- CV_outer = (StratifiedKFold(n_splits=n_folds_outer, shuffle=True)
- if strat_col is not None
- else KFold(n_splits=n_folds_outer, shuffle=True))
- n_samples_outer = int(n_samples_dev*(1-1/n_folds_outer))
- config['kfold_folder'] = f'{n_folds_outer}_folds'
- if n_folds_inner == 0:
- n_folds_inner = int(n_samples_outer / np.unique(y).shape[0])
- CV_inner = (StratifiedKFold(n_splits=n_folds_inner, shuffle=True)
- if strat_col is not None
- else KFold(n_splits=n_folds_inner, shuffle=True))
- config["kfold_folder"] += f'_l{np.unique(y).shape[0]}ocv'
- n_max = n_samples_outer - np.unique(y).shape[0]
- elif n_folds_inner == -1:
- CV_inner = LeaveOneOut()
- config["kfold_folder"] += '_loocv'
- n_max = n_samples_outer - 1
- elif n_folds_inner < 1:
- CV_inner = (StratifiedShuffleSplit(n_splits=1,test_size=n_folds_inner)
- if strat_col is not None
- else ShuffleSplit(n_splits=1,test_size=n_folds_inner))
- n_max = int(n_samples_outer*(1-n_folds_inner))
- config["kfold_folder"] += f'_{int(n_folds_inner*100)}pct'
- else:
- n_folds_inner = int(n_folds_inner)
- CV_inner = (StratifiedKFold(n_splits=n_folds_inner, shuffle=True)
- if strat_col is not None
- else KFold(n_splits=n_folds_inner, shuffle=True))
- n_max = int(n_samples_outer*(1-1/n_folds_inner))
- config["kfold_folder"] += f'_{n_folds_inner}_folds'
- with open(Path(__file__).parent/'config.json', 'w') as f:
- json.dump(config, f, indent=4)
- subfolders = [
- task, dimension,
- config['kfold_folder'], f'{y_label}_res' if len(covariates) > 0 else y_label, config['stat_folder'],scoring_metric,
- 'hyp_opt' if config['n_iter'] > 0 else '','feature_selection' if config['feature_selection'] else '',
- 'filter_outliers' if config['filter_outliers'] and config['problem_type'] == 'reg' else '','rounded' if round_values else '','cut' if cut_values > 0 else '',
- 'shuffle' if config['shuffle_labels'] else ''
- ]
- path_to_save = results_dir.joinpath(*[str(s) for s in subfolders if s])
- if Path(path_to_save,'config.json').exists():
- with open(Path(path_to_save,'config.json'), 'rb') as f:
- old_config = json.load(f)
- old_config['n_boot'] = config['n_boot']
- if (not config['overwrite']) & (any(old_config[x] != config[x] for x in ['n_iter','init_points','n_seeds_train','n_boot'])):
- for key in ['n_iter','init_points','n_seeds_train','n_boot']:
- print(f'Warning: {key} has changed from {old_config[key]} to {config[key]}. Overwriting previous results.')
- config[key] = old_config[key]
- with open(Path(path_to_save,'config.json'),'w') as f:
- json.dump(config, f, indent=4)
- if 'scoring_metric' not in list(config.keys()):
- config['scoring_metric'] = scoring_metric
- config['add_dem'] = add_dem
- config['round_values'] = round_values
- with open(Path(Path(__file__).parent,'config.json'),'w') as f:
- json.dump(config, f, indent=4)
- for random_seed_test in random_seeds_test:
- Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '').mkdir(exist_ok=True,parents=True)
- if test_size > 0:
- X_train_, X_test_, y_train_, y_test_, ID_train_, ID_test_ = train_test_split(
- data, y, ID,
- test_size=config['test_size'],
- random_state=int(random_seed_test),
- shuffle=True,
- stratify=strat_col)
- if strat_col is not None:
- strat_col_train_, strat_col_test_ = train_test_split(
- strat_col,
- test_size=config['test_size'],
- random_state=int(random_seed_test),
- shuffle=True,
- stratify=strat_col)
- # Reset indexes after split.
- X_train_.reset_index(drop=True, inplace=True)
- X_test_.reset_index(drop=True, inplace=True)
- y_train_ = y_train_.reset_index(drop=True)
- y_test_ = y_test_.reset_index(drop=True)
- ID_train_ = ID_train_.reset_index(drop=True)
- ID_test_ = ID_test_.reset_index(drop=True)
- if strat_col is not None:
- strat_col_train_ = strat_col_train_.reset_index(drop=True)
- else:
- strat_col_train_ = None
- else:
- X_train_, y_train_, ID_train_ = data.reset_index(drop=True), y.reset_index(drop=True), ID.reset_index(drop=True)
- if strat_col is not None:
- strat_col_train_ = strat_col.reset_index(drop=True)
- else:
- strat_col_train_ = None
- X_test_, y_test_, ID_test_ = pd.DataFrame(), pd.Series(), pd.Series()
- data_train = pd.concat((X_train_,y_train_,ID_train_),axis=1)
- data_test = pd.concat((X_test_,y_test_,ID_test_),axis=1)
- data_train.to_csv(Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '', 'data_train.csv'),index=False)
- data_test.to_csv(Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '', 'data_test.csv'),index=False)
- hyperp['knnc']['n_neighbors'] = (1,n_max)
- hyperp['knnr']['n_neighbors'] = (1,n_max)
- # Check for data leakage.
- assert set(ID_train_).isdisjoint(set(ID_test_)), 'Data leakage detected between train and test sets!'
- if (Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '', f'all_models_{model_key}.csv').exists() and config['calibrate'] == False) or (Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '', f'cal_outputs_{model_key}.pkl').exists() and config['calibrate']):
- if not bool(config['overwrite']):
- print(f'Results already exist for {task} - {y_label} - {model_key}. Skipping...')
- continue
- print(f'Training model: {model_key}')
- all_models,outputs_best,y_dev,y_pred_best,IDs_dev = utils.nestedCVT(model_class=models_dict[config['problem_type']][model_key],
- scaler=StandardScaler if config['scaler_name'] == 'StandardScaler' else MinMaxScaler,
- imputer=KNNImputer,
- X=X_train_,
- y=y_train_.values if isinstance(y_train_, pd.Series) else y_train_,
- n_iter=int(config['n_iter']),
- iterator_outer=CV_outer,
- iterator_inner=CV_inner,
- strat_col=strat_col_train_,
- random_seeds_outer=config['random_seeds_train'],
- hyperp_space=hyperp[model_key],
- IDs=ID_train_,
- init_points=int(config['init_points']),
- scoring=scoring_metric,
- problem_type=config['problem_type'],
- cmatrix=cmatrix,priors=None,
- threshold=thresholds,
- parallel=bool(config['parallel']),
- feature_selection=bool(config['feature_selection']),
- calmethod=calmethod,
- calparams=calparams,
- round_values=round_values,
- covariates=covariates if isinstance(covariates,pd.DataFrame) else None,
- fill_na = fill_na,
- regress_out_method = config['regress_out_method']
- )
- Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '').mkdir(parents=True, exist_ok=True)
- with open(Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '','config.json'),'w') as f:
- json.dump(config,f)
- all_models.to_csv(Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '',f'all_models_{model_key}.csv'),index=False)
- result_files = {
- 'X_train.npy': X_train_,
- 'y_train.npy': y_train_,
- 'IDs_train.npy': ID_train_,
- 'y_dev.npy': y_dev,
- 'IDs_dev.npy': IDs_dev,
- f'outputs_{model_key}.npy': outputs_best}
- if test_size > 0:
- result_files.update({
- 'X_test.npy': X_test_,
- 'y_test.npy': y_test_,
- 'IDs_test.npy': ID_test_,
- })
- for fname, obj in result_files.items():
- with open(Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '', fname), 'wb') as f:
- np.save(f, obj)
- with open(Path(path_to_save,f'random_seed_{int(random_seed_test)}' if config['test_size'] else '', 'config.json'), 'w') as f:
- json.dump(config, f, indent=4)
train_models_bayes.py, no license · at the source
Overview
20 affiliations
- Cognitive Neuroscience Center (CNC), Department of Life and Behavioral Sciences, Universidad de San Andrés, Buenos Aires, Argentina
- National Scientific and Technical Research Council (CONICET), Buenos Aires, Argentina
- School of Engineering, University of Buenos Aires, Buenos Aires, Argentina
- Department of Psychiatry, School of Medicine, Pontificia Universidad Católica de Chile, Santiago, Chile
- Instituto de Investigación en Ciencias de la Computación (ICC), CONICET‐UBA, Buenos Aires, Argentina
- Departamento de Computación, Faculty of Exact and Natural Sciences, University of Buenos Aires (UBA), Buenos Aires, Argentina
- Memory and Neuropsychiatric Center (CMYN) Neurology Department, Hospital del Salvador & Faculty of Medicine, University of Chile, Santiago, Chile
- Departamento de Psiquiatría Oriente, Facultad de Medicina, Universidad de Chile, Santiago, Chile
- Neuropsychology and Clinical Neuroscience Laboratory (LANNEC), Physiopathology Program – Institute of Biomedical Sciences (ICBM), Neuroscience and East Neuroscience Departments, Faculty of Medicine, University of Chile, Santiago, Chile
- Servicio de Neurología, Clínica Las Condes, Santiago, Chile
- Gerosciences Center for Brain Health and Metabolism, Santiago, Chile
- Interdisciplinary Center for Neuroscience (NeuroUC), Laboratory for Cognitive and Evolutionary Neuroscience (LANCE), Department of Psychiatry, Faculty of Medicine, Pontificia Universidad Católica de Chile, Santiago, Chile
- Memory and Aging Center, University of California, San Francisco, California, USA
- Servicio de Neurología, Departamento de Medicina, Clínica Alemana‐Universidad del Desarrollo, Santiago, Chile
- Latin American Brain Health Institute (BrainLat), Universidad Adolfo Ibáñez, Santiago, Chile
- Global Brain Health Institute, University of California San Francisco, San Francisco, California, USA
- Department of Biophysics, School of Medicine, Istanbul Medipol University, Istanbul, Türkiye
- Barcelonaβeta Brain Research Center (BBRC), Pasqual Maragall Foundation, Barcelona, Spain
- Trinity College Dublin, Dublin, Ireland
- Departamento de Lingüística y Literatura, Facultad de Humanidades, Universidad de Santiago de Chile, Santiago, Chile
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 1 match between paragraphs and lines of code.
OSF ad8jb
Availability: 2 checks, the latest on 29 October 2026: the link answers (HTTP 200)
- 29 October 2026: the link answers (HTTP 200)
- 28 September 2026: the link answers (HTTP 200)
4 files
- Scripts/
bootstrap_models_bayes.p , Python, 291 linesy - Scripts/
train_final_model_bayes. , Python, 349 linespy - Scripts/
train_models_bayes.py , Python, 503 lines, 1 match - Scripts/
violin_plots_bayes.py , Python, 220 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;
- 4 scripts, each with its path and the digest of its content;
- 1 match 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.
Code and data availability statement
The paper has a code and data availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: OSF ad8jb
Read it in the paper: doi.org/10.1002/alz.71365.
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 1, 28 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 16 authors, 6 keywords, 14 MeSH terms, 33 funders, 70 references.
Cite
This paper
Caro, I., Pérez, G., Bize, J. V., Ponferrada, J., Ferrante, F. J., Welford, A. S., Gauder, L., Olavarría, L., Henríquez, F., Ramos, T., Besnier, C., Ferrer, L., Gorno‐Tempini, M. L., Slachevsky, A., Ibañez, A., & García, A. M. (2026). Benchmarking speech biomarkers of Alzheimer's against cognitive and neural measures. Alzheimer's & dementia : the journal of the Alzheimer's Association, 22(4), e71365. https://
BibTeX
@article{caro2026benchma
author = {Caro, Ivan and Pérez, Gonzalo and Bize, Joaquín Valdés and Ponferrada, Joaquín and Ferrante, Franco J and Welford, Alejandro Sosa and Gauder, Lara and Olavarría, Loreto and Henríquez, Fernando and Ramos, Teresita and Besnier, Cristina and Ferrer, Luciana and Gorno‐Tempini, Maria Luisa and Slachevsky, Andrea and Ibañez, Agustín and García, Adolfo M},
title = {{Benchmarking speech biomarkers of Alzheimer's against cognitive and neural measures}},
journal = {Alzheimer's \& dementia : the journal of the Alzheimer's Association},
year = {2026},
month = apr,
volume = {22},
number = {4},
pages = {e71365},
publisher = {Wiley},
issn = {1552-5260},
doi = {10.1002/
url = {https://
pmid = {41979006},
pmcid = {PMC13077448}
}
RIS
TY - JOUR
AU - Caro, Ivan
AU - Pérez, Gonzalo
AU - Bize, Joaquín Valdés
AU - Ponferrada, Joaquín
AU - Ferrante, Franco J
AU - Welford, Alejandro Sosa
AU - Gauder, Lara
AU - Olavarría, Loreto
AU - Henríquez, Fernando
AU - Ramos, Teresita
AU - Besnier, Cristina
AU - Ferrer, Luciana
AU - Gorno‐Tempini, Maria Luisa
AU - Slachevsky, Andrea
AU - Ibañez, Agustín
AU - García, Adolfo M
TI - Benchmarking speech biomarkers of Alzheimer's against cognitive and neural measures
T2 - Alzheimer's & dementia : the journal of the Alzheimer's Association
J2 - Alzheimers Dement
PY - 2026
DA - 2026/
VL - 22
IS - 4
SP - e71365
SN - 1552-5260
PB - Wiley
DO - 10.1002/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.1002/
"type": "article-journal",
"title": "Benchmarking speech biomarkers of Alzheimer's against cognitive and neural measures",
"container-title": "Alzheimer's & dementia : the journal of the Alzheimer's Association",
"author": [
{
"family": "Caro",
"given": "Ivan"
},
{
"family": "Pérez",
"given": "Gonzalo"
},
{
"family": "Bize",
"given": "Joaquín Valdés"
},
{
"family": "Ponferrada",
"given": "Joaquín"
},
{
"family": "Ferrante",
"given": "Franco J"
},
{
"family": "Welford",
"given": "Alejandro Sosa"
},
{
"family": "Gauder",
"given": "Lara"
},
{
"family": "Olavarría",
"given": "Loreto"
},
{
"family": "Henríquez",
"given": "Fernando"
},
{
"family": "Ramos",
"given": "Teresita"
},
{
"family": "Besnier",
"given": "Cristina"
},
{
"family": "Ferrer",
"given": "Luciana"
},
{
"family": "Gorno‐Tempini",
"given": "Maria Luisa"
},
{
"family": "Slachevsky",
"given": "Andrea"
},
{
"family": "Ibañez",
"given": "Agustín"
},
{
"family": "García",
"given": "Adolfo M"
}
],
"container-title-short":
"volume": "22",
"issue": "4",
"page": "e71365",
"DOI": "10.1002/
"PMID": "41979006",
"PMCID": "PMC13077448",
"ISSN": "1552-5260",
"publisher": "Wiley",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
4,
1
]
]
}
}
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.1126/sciadv.aef9864 [code]
- Speech clocks decode dementia phenotypes, social exposome, and biological aging.Journal: Science advancesIn common: statsmodels, seaborn, scikit-learn, 4 other tools, Alzheimer's / dementia, cognitive, 10 references, author Franco J Ferrante
- [2] doi:10.1038/s41531-024-00630-4 [code]
- Neurocognitive correlates of semantic memory navigation in Parkinson's disease.Journal: NPJ Parkinson's diseaseIn common: XGBoost, seaborn, scikit-learn, 3 other tools, 5 references, author Franco J Ferrante
- [3] doi:10.1002/alz.71124 [code]
- Automated item-level measures of verbal fluency in semantic and logopenic primary progressive aphasia.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: Alzheimer's / dementia, 6 references, author Franco J Ferrante
- [4] doi:10.3389/fnins.2023.1221401 [code]
- Harnessing acoustic speech parameters to decipher amyloid status in individuals with mild cognitive impairment.Journal: Frontiers in neuroscienceIn common: scikit-learn, pandas, Matplotlib, 1 other tool, Alzheimer's / dementia, cognitive, 5 references
- [5] doi:10.1002/alz.13861 [code]
- Sleep functional connectivity, hyperexcitability, and cognition in Alzheimer's disease.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: XGBoost, statsmodels, seaborn, 5 other tools, Alzheimer's / dementia, cognitive, 3 references
- [6] doi:10.1002/alz.13788 [code]
- Viscous dynamics associated with hypoexcitation and structural disintegration in neurodegeneration via generative whole-brain modeling.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: seaborn, scikit-learn, pandas, 3 other tools, Alzheimer's / dementia, 5 references
- [7] doi:10.1002/alz.71232
- Neural embedding of frailty in cognitively unimpaired aging and dementia across Latin America.Journal: Alzheimer's & dementia : the journal of the Alzheimer's AssociationIn common: Alzheimer's / dementia, 7 references
- [8] doi:10.1038/s41597-023-02806-8 [code]
- The BrainLat project, a multimodal neuroimaging dataset of neurodegeneration from underrepresented backgrounds.Journal: Scientific dataIn common: SciPy, NumPy, Alzheimer's / dementia, 6 references
- [9] doi:10.1016/j.nicl.2024.103707 [code]
- Prediction of methylphenidate treatment response for ADHD using conventional and radiomics T1 and DTI features: Secondary analysis of a randomized clinical trial.Journal: NeuroImage. ClinicalIn common: XGBoost, statsmodels, seaborn, 5 other tools, 2 references
- [10] doi:10.1038/s41467-025-63277-6 [code]
- Social exposome and brain health outcomes of dementia across Latin America.Journal: Nature communicationsIn common: Alzheimer's / dementia, 7 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, 4 scripts, and 1 match 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:d976f8c9f107ebe3…
Add the badge to the code's README
If you are an author or a maintainer of this paper's code, you can add this badge. It says what OSCR knows of the paper (its code, its validated tracing map) and links the code to this page. Paste one of these snippets under the README's title. Keep the two marks around it, so that the badge can be replaced in place and is never added twice. OSCR changes nothing in your repository.
Markdown
<!-- oscr-badge:start -->
[](https://openscicode.org/badge/doi/10.1002/alz.71365)
<!-- oscr-badge:end -->reStructuredText
.. oscr-badge:start
.. image:: https://openscicode.org/badge/doi/10.1002/alz.71365.svg
:target: https://openscicode.org/badge/doi/10.1002/alz.71365
:alt: OSCR
.. oscr-badge:endHTML
<!-- oscr-badge:start -->
<a href="https://openscicode.org/badge/doi/10.1002/alz.71365"><img src="https://openscicode.org/badge/doi/10.1002/alz.71365.svg" alt="OSCR"></a>
<!-- oscr-badge:end -->If you choose to, you can have the badge kept up to date for you, with oscr badge --write from the command line or with the GitHub Action in your repository's workflows. Every other form and option (a card, AsciiDoc, LaTeX, shields.io) is on the badge page.
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: code errors and mismatches between the code and the paper about this paper and its code, from readers and its authors, beside the paper and its tracing map.
Report a mismatch between the code and the paper · Report a code error (signed in)
Reproductions: reports from readers who ran the authors' code and did not get the paper's result, what they ran, with which environment, commit and data.
Report a reproduction failure (signed in)
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
