15.12.2012 Views

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

scipy tutorial - Baustatik-Info-Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SciPy Reference Guide, Release 0.8.dev<br />

is_valid_im(R, warning=False, throw=False, name=None)<br />

Returns True if the inconsistency matrix passed is valid. It must be a n by 4 numpy array of doubles. The<br />

standard deviations R[:,1] must be nonnegative. The link counts R[:,2] must be positive and no greater<br />

than n − 1.<br />

Arguments<br />

Returns<br />

• R : ndarray The inconsistency matrix to check for validity.<br />

• warning : bool When True, issues a Python warning if the linkage matrix passed is<br />

invalid.<br />

• throw : bool When True, throws a Python exception if the linkage matrix passed is<br />

invalid.<br />

• name : string This string refers to the variable name of the invalid linkage matrix.<br />

• b : bool True iff the inconsistency matrix is valid.<br />

is_valid_linkage(Z, warning=False, throw=False, name=None)<br />

Checks the validity of a linkage matrix. A linkage matrix is valid if it is a two dimensional nd-array (type<br />

double) with n rows and 4 columns. The first two columns must contain indices between 0 and 2n − 1. For a<br />

given row i, 0 ≤ Z[i, 0] ≤ i + n − 1 and 0 ≤ Z[i, 1] ≤ i + n − 1 (i.e. a cluster cannot join another cluster<br />

unless the cluster being joined has been generated.)<br />

Arguments<br />

Returns<br />

• warning : bool When True, issues a Python warning if the linkage matrix passed is<br />

invalid.<br />

• throw : bool When True, throws a Python exception if the linkage matrix passed is<br />

invalid.<br />

• name : string This string refers to the variable name of the invalid linkage matrix.<br />

• b<br />

leaders(Z, T)<br />

(L, M) = leaders(Z, T):<br />

[bool] True iff the inconsistency matrix is valid.<br />

Returns the root nodes in a hierarchical clustering corresponding to a cut defined by a flat cluster assignment<br />

vector T. See the fcluster function for more information on the format of T.<br />

For each flat cluster j of the k flat clusters represented in the n-sized flat cluster assignment vector T, this<br />

function finds the lowest cluster node i in the linkage tree Z such that:<br />

•leaf descendents belong only to flat cluster j (i.e. T[p]==j for all p in S(i) where S(i) is the set of leaf<br />

ids of leaf nodes descendent with cluster node i)<br />

•there does not exist a leaf that is not descendent with i that also belongs to cluster j (i.e. T[q]!=j for<br />

all q not in S(i)). If this condition is violated, T is not a valid cluster assignment vector, and an exception<br />

will be thrown.<br />

140 Chapter 3. Reference

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!