def ToliasCadena2017Correlation(*regression_args, **regression_kwargs): loader = AssemblyLoader() assembly_repetition = loader(average_repetition=False) assembly = loader(average_repetition=True) assembly.stimulus_set.name = assembly.stimulus_set_name similarity_metric = CrossRegressedCorrelation( regression=corr_regression( *regression_args, **regression_kwargs), correlation=pearsonr_correlation(), crossvalidation_kwargs={'splits': 4, 'stratification_coord': None}) identifier = f'tolias.Cadena2017-correlation' ceiler = InternalConsistency(split_coord='repetition_id') def ceiling(): assembly_nonan, stimuli = loader.dropna( assembly_repetition, assembly_repetition.attrs['stimulus_set']) return ceiler(assembly_nonan) return NeuralBenchmark(identifier=identifier, version=1, assembly=assembly, similarity_metric=similarity_metric, ceiling_func=ceiling)
def ToliasCadena2017Mask(): loader = AssemblyLoader() assembly_repetition = loader(average_repetition=False) assembly = loader(average_repetition=True) assembly.stimulus_set.identifier = assembly.stimulus_set_identifier similarity_metric = CrossRegressedCorrelation( regression=mask_regression(), correlation=pearsonr_correlation(), crossvalidation_kwargs={ 'splits': 4, 'stratification_coord': None }) identifier = f'tolias.Cadena2017-mask' ceiler = InternalConsistency(split_coord='repetition_id') return NeuralBenchmark(identifier=identifier, version=1, assembly=assembly, similarity_metric=similarity_metric, visual_degrees=VISUAL_DEGREES, number_of_trials=NUMBER_OF_TRIALS, parent='V1', bibtex=BIBTEX, ceiling_func=lambda: ceiler(assembly_repetition))
def AruKuzovkin2018PLS(): assembly_repetition = LazyLoad( lambda: load_assembly(average_repetitions=False)) assembly = LazyLoad(lambda: load_assembly(average_repetitions=True)) # similarity_metric = CrossRegressedCorrelation( # regression=pls_regression(), # correlation=pearsonr_correlation(), # crossvalidation_kwargs=dict(stratification_coord=None) # ) similarity_metric = RDMCrossValidated(crossvalidation_kwargs=dict( stratification_coord=None)) # sub-select the entire IT region # x = assembly['region'] # idx = x.data == 20 # sub-select only important it electrodes for IT: 1094 # idx = np.zeros((len(assembly.neuroid_id)), dtype=bool) # idx[1094] = True # idx[847] = True #idx = get_IT_MNI() idx = it_idx new_assembly = assembly[:, idx, :] # Can replace the "name" of the brain region new_assembly = type(new_assembly)( new_assembly.values, coords={ coord: (dims, values if coord != 'region' else ['IT'] * len(new_assembly['region'])) for coord, dims, values in walk_coords(new_assembly) }, dims=new_assembly.dims) new_assembly.attrs = assembly.attrs new_assembly = new_assembly.where(new_assembly['time_bin_start'] < 350, drop=True) new_assembly = new_assembly.where(new_assembly['time_bin_start'] > 250, drop=True) new_assembly = new_assembly.mean('time_bin') new_assembly = new_assembly.expand_dims('time_bin') new_assembly.coords['time_bin'] = pd.MultiIndex.from_tuples( [(62.5, 156.2)], names=['time_bin_start', 'time_bin_end']) new_assembly = new_assembly.squeeze('time_bin') new_assembly.attrs = assembly.attrs ceiling = Score([1, np.nan], coords={'aggregation': ['center', 'error']}, dims=['aggregation']) return NeuralBenchmark(identifier=f'aru.Kuzovkin2018-pls', version=1, assembly=new_assembly, similarity_metric=similarity_metric, visual_degrees=VISUAL_DEGREES, ceiling_func=lambda: ceiling, parent='Kamila', number_of_trials=1)