Overview of tests¶
two_sample_test¶
- class networkunit.tests.two_sample_test(observation=None, name=None, **params)¶
Parent class for specific two sample test scenarios which enables initialization via a data model instead of a direct observation, interchangeable test scores, and basic sample visualization.
correlation_test¶
- class networkunit.tests.correlation_test(observation=None, name=None, **params)¶
Abstract test class to compare the pairwise correlations between spike trains of a set of neurons in a network.
Parameters:¶
- bin_size: quantity, None (default: 2*ms)
Size of bins used to calculate the correlation coefficients.
- num_bins: int, None (default: None)
Number of bins within t_start and t_stop used to calculate the correlation coefficients.
- t_start: quantity, None
Start of time window used to calculate the correlation coefficents.
- t_stop: quantity, None
Stop of time window used to calculate the correlation coefficents.
- nan_to_num: bool (default: False)
If true, np.nan are set to 0, and np.inf to largest finite float.
- binary: bool
If true, the binned spike trains are set to be binary.
correlation_dist_test¶
- class networkunit.tests.correlation_dist_test(observation=None, name=None, **params)¶
Abstract test class to compare the distributions of pairwise correlations of a set of spiking neurons in a network. The statistical testing method needs to be set in form of a sciunit.Score as score_type.
Parameters:¶
- bin_size: quantity, None (default: 2*ms)
Size of bins used to calculate the correlation coefficients.
- num_bins: int, None (default: None)
Number of bins within t_start and t_stop used to calculate the correlation coefficients.
- t_start: quantity, None
Start of time window used to calculate the correlation coefficents.
- t_stop: quantity, None
Stop of time window used to calculate the correlation coefficents.
- nan_to_num: bool
If true, np.nan are set to 0, and np.inf to largest finite float.
- binary: bool
If true, the binned spike trains are set to be binary.
correlation_matrix_test¶
- class networkunit.tests.correlation_matrix_test(observation=None, name=None, **params)¶
Abstract test class to compare correlation matrices of a set of spiking neurons in a network. The statistical testing method needs to be set in form of a sciunit.Score as score_type.
Parameters:¶
- bin_size: quantity, None (default: 2*ms)
Size of bins used to calculate the correlation coefficients.
- num_bins: int, None (default: None)
Number of bins within t_start and t_stop used to calculate the correlation coefficients.
- t_start: quantity, None
Start of time window used to calculate the correlation coefficients.
- t_stop: quantity, None
Stop of time window used to calculate the correlation coefficients.
- nan_to_num: bool
If true, np.nan are set to 0, and np.inf to largest finite float.
- binary: bool
If true, the binned spike trains are set to be binary.
- cluster_matrixbool
If true, the matrix is clustered by the hierarchical cluster algorithm scipy.cluster.hierachy.linkage() with ‘method’ determined by the cluster_method.
- cluster_methodstring (default: ‘ward’)
Method for the hierarchical clustering if cluster_matrix=True
- remove_autocorr: bool
If true, the diagonal values of the matrix are set to 0.
- edge_threshold: float
Passed to draw_graph() and determines the threshold above which edges are draw in the graph corresponding to the matrix.
avg_std_correlation_test¶
- class networkunit.tests.avg_std_correlation_test(observation=None, name=None, **params)¶
Abstract test class to compare correlation matrices of a set of spiking neurons in a network. The statistical testing method needs to be set in form of a sciunit.Score as score_type.
Parameters:¶
- bin_size: quantity, None (default: 2*ms)
Size of bins used to calculate the correlation coefficients.
- num_bins: int, None (default: None)
Number of bins within t_start and t_stop used to calculate the correlation coefficients.
- t_start: quantity, None
Start of time window used to calculate the correlation coefficients.
- t_stop: quantity, None
Stop of time window used to calculate the correlation coefficients.
- nan_to_num: bool
If true, np.nan are set to 0, and np.inf to largest finite float.
- binary: bool
If true, the binned spike trains are set to be binary.
eigenvalue_test¶
- class networkunit.tests.eigenvalue_test(observation=None, name=None, **params)¶
Test to compare the eigenvalues of correlation matrices of a set of spiking neurons in a network. The statistical testing method needs to be set in form of a sciunit.Score as score_type.
Parameters:¶
- bin_size: quantity, None (default: 2*ms)
Size of bins used to calculate the correlation coefficients.
- num_bins: int, None (default: None)
Number of bins within t_start and t_stop used to calculate the correlation coefficients.
- t_start: quantity, None
Start of time window used to calculate the correlation coefficients.
- t_stop: quantity, None
Stop of time window used to calculate the correlation coefficients.
- nan_to_num: bool
If true, np.nan are set to 0, and np.inf to largest finite float.
- binary: bool
If true, the binned spike trains are set to be binary.
covariance_test¶
- class networkunit.tests.covariance_test(observation=None, name=None, **params)¶
Test to compare the pairwise covariances of a set of neurons in a network. The statistical testing method needs to be set in form of a sciunit.Score as score_type.
Parameters:¶
- bin_size: quantity, None (default: 2*ms)
Size of bins used to calculate the correlation coefficients.
- num_bins: int, None (default: None)
Number of bins within t_start and t_stop used to calculate the correlation coefficients.
- t_start: quantity, None
Start of time window used to calculate the correlation coefficients.
- t_stop: quantity, None
Stop of time window used to calculate the correlation coefficients.
- binary: bool
If true, the binned spike trains are set to be binary.
firing_rate_test¶
- class networkunit.tests.firing_rate_test(observation=None, name=None, **params)¶
Test to compare the firing rates of a set of spiking neurons in a network. The statistical testing method needs to be set in form of a sciunit.Score as score_type.
isi_variation_test¶
- class networkunit.tests.isi_variation_test(observation=None, name=None, **params)¶
Test to compare the firing rates of a set of spiking neurons in a network.
Parameters:¶
- variation_measure: ‘isi’, ‘cv’, ‘lv’, ‘lvr’ (default)
‘isi’ - Compares the inter-spike intervals ‘cv’ - Compares the coefficients of variation ‘cv2’ - Compares the coefficients of variation ‘lv’ - Compares the local coefficients of variation ‘lvr’ - Compares the revised local coefficients of variation
timescale_test¶
- class networkunit.tests.timescale_test(observation=None, name=None, **params)¶
Test to compare the timescales a set of spiking neurons in a network. The timescale is defined as the decay of the autocorrelation function of a given spike train. The timescale is returned in ‘ms’. The statistical testing method needs to be set in form of a sciunit.Score as score_type.
Parameters:¶
- bin_size: quantity (default: 1*ms)
Size of bins used to calculate the spiketrain timescale.
- tau_max: quantity (default: 100*ms)
Maximal integration time of the auto-correlation function.
- min_spikecount: int (default: 2)
Minimum number of spikes required to compute the timescale, if less spikes are found np.nan is returned.
graph_centrality_helperclass¶
- class networkunit.tests.graph_centrality_helperclass(observation: List[int] | Tuple[int, int], name: str | None = None, **params)¶
Abstract test class to compare graph centrality measures of a set of spiking neurons in a network. This test needs to be combined with a test which generates a prediction in form of matrix. From this matrix the chosen graph measure is calculated and passed on in scalar, vector, or matrix form, depending on whether the measure is network-wise, node-wise, or node-pair-wise. The executable test has to inherit from the graph_measure_test and the matrix generating test in the order (TestM2M), graph_centrality_helperclass, matrix_test.
- Parameters:
----------
edge_threshold – float (default: 0) Threshold for the matrix values to create the graph.
graph_measure – ‘degree_strength’, ‘closeness’, ‘betweenness’, ‘edge_betweenness’, ‘katz’, ‘clustering_coefficient’, ‘transitivity’, ‘small-worldness’
power_spectrum_test¶
- class networkunit.tests.power_spectrum_test(observation=None, name=None, **params)¶
Test to compare the power spectral density of a set of spiking neurons in a network. All spiketrains need to have the same t_start and t_stop. Parameters are passed on to elephant.spectral.welch_psd()
freqband_power_test¶
- class networkunit.tests.freqband_power_test(observation=None, name=None, **params)¶
Test to compare the power spectral density of a set of spiking neurons in a network. All spiketrains need to have the same t_start and t_stop. Parameters are passed on to elephant.spectral.welch_psd()