scipy 1.8.0 Pypi GitHub Homepage
Other Docs
NotesParametersReturns
cwt_matrix(n_rows, n_columns, seed=None)

Given the desired size of matrix, the method returns a matrix S of size (n_rows, n_columns) where each column has all the entries set to 0 except for one position which has been randomly set to +1 or -1 with equal probability.

Notes

Given a matrix A, with probability at least 9/10, .. math:: \|SA\| = (1 \pm \epsilon)\|A\| Where the error epsilon is related to the size of S.

Parameters

n_rows: int :

Number of rows of S

n_columns: int :

Number of columns of S

seed : {None, int, `numpy.random.Generator`,

numpy.random.RandomState }, optional

If seed is None (or :None:None:`np.random`), the numpy.random.RandomState singleton is used. If seed is an int, a new RandomState instance is used, seeded with seed . If seed is already a Generator or RandomState instance then that instance is used.

Returns

S : (n_rows, n_columns) csc_matrix

The returned matrix has n_columns nonzero entries.

Generate a matrix S which represents a Clarkson-Woodruff transform.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/linalg/_sketches.py#14
type: <class 'function'>
Commit: