rsatoolbox.inference.result module

Result object definition

class rsatoolbox.inference.result.Result(models, evaluations, method, cv_method, noise_ceiling, variances=None, dof=1, fitter=None, n_rdm=None, n_pattern=None)[source]

Bases: object

Result class storing results for a set of models with the models, the results matrix and the noise ceiling

Parameters:
  • models (list of rsatoolbox.model.Model) – the evaluated models

  • evaluations (numpy.ndarray) – evaluations of the models over bootstrap/crossvalidation format: bootstrap_samples x models x crossval & others such that np.mean(evaluations[i,j]) is a valid evaluation for the jth model on the ith bootstrap-sample

  • method (String) – the evaluation method

  • cv_method (String) – crossvalidation specification

  • noise_ceiling (numpy.ndarray) – noise ceiling such that np.mean(noise_ceiling[0]) is the lower bound and np.mean(noise_ceiling[1]) is the higher one.

Variables:

inputs (as) –

get_ci(ci_percent, test_type='t-test')[source]

returns confidence intervals for the evaluations

get_errorbars(eb_type='sem', test_type='t-test')[source]

returns errorbars for the model evaluations

get_means()[source]

returns the mean evaluations per model

get_model_var()[source]

returns the variance of the evaluation per model

get_noise_ceil()[source]

returns the noise ceiling for the model evaluations

get_sem()[source]

returns the SEM of the evaluation per model

save(filename, file_type='hdf5', overwrite=False)[source]

saves the results into a file.

Parameters:
  • filename (String) – path to the file [or opened file]

  • file_type (String) – Type of file to create: hdf5: hdf5 file pkl: pickle file

  • overwrite (Boolean) – overwrites file if it already exists

summary(test_type='t-test')[source]

Human readable summary of the results

Parameters:

test_type (String) – What kind of tests to run. See rsatoolbox.util.inference_util.all_tests for options

test_all(test_type='t-test')[source]

returns all p-values: p_pairwise, p_zero & p_noise

Parameters:

test_type (String) – What kind of tests to run. See rsatoolbox.util.inference_util.all_tests for options

test_noise(test_type='t-test')[source]

returns the p-values for the tests against the noise ceiling

test_pairwise(test_type='t-test')[source]

returns the pairwise test p-values

test_zero(test_type='t-test')[source]

returns the p-values for the tests against 0

to_dict()[source]

Converts the RDMs object into a dict, which can be used for saving

Returns:

A dictionary with all the information needed

to regenerate the object

Return type:

results_dict(dict)

rsatoolbox.inference.result.load_results(filename, file_type=None)[source]

loads a Result object from disc

Parameters:

filename (String) – path to the filelocation

rsatoolbox.inference.result.result_from_dict(result_dict)[source]

recreate Results object from dictionary

Parameters:

result_dict (dict) – dictionary to regenerate

Returns:

the recreated object

Return type:

result(Result)