mvpa2.datasets.sources.skl_sparse_spd_matrix

mvpa2.datasets.sources.skl_sparse_spd_matrix(dim=1, alpha=0.95, norm_diag=False, smallest_coef=0.1, largest_coef=0.9, random_state=None)

Generate a sparse symmetric definite positive matrix.

Read more in the User Guide.

Parameters:

dim : integer, optional (default=1)

The size of the random matrix to generate.

alpha : float between 0 and 1, optional (default=0.95)

The probability that a coefficient is zero (see notes). Larger values enforce more sparsity.

norm_diag : boolean, optional (default=False)

Whether to normalize the output matrix to make the leading diagonal elements all 1

smallest_coef : float between 0 and 1, optional (default=0.1)

The value of the smallest coefficient.

largest_coef : float between 0 and 1, optional (default=0.9)

The value of the largest coefficient.

random_state : int, RandomState instance or None, optional (default=None)

If int, random_state is the seed used by the random number generator; If RandomState instance, random_state is the random number generator; If None, the random number generator is the RandomState instance used by np.random.

Returns:

prec : sparse matrix of shape (dim, dim)

The generated matrix.

See also

make_spd_matrix

Notes

This function has been auto-generated by wrapping make_sparse_spd_matrix() from the sklearn package. The documentation of this function has been kept verbatim. Consequently, the actual return value is not as described in the documentation, but the data is returned as a PyMVPA dataset.