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.

generalized_correlation_matrix_test

class networkunit.tests.generalized_correlation_matrix_test(observation=None, name=None, **params)

Test to compare the different kinds 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.

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.

maxlagint

Maximum shift (in number of bins) between spike trains which should still be considered in the calculating the correlation measure.

time_reduction: ‘sum’, ‘max’, ‘threshold x.x’

Method how to include lagged correlations between spike trains. sum - calculates the sum of the normalized CCH within +- maxlag max - takes the maximum of the CCH within +- maxlag threshold x.x - sums up the part of the CCH above the threshold x.x

and within +- maxlag

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

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’