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 />

• method=’ward’ uses the Ward variance minimization algorithm. The new entry d(u, v) is computed<br />

as follows,<br />

�<br />

|v| + |s|<br />

d(u, v) = d(v, s)<br />

T<br />

2 |v| + |t|<br />

+ d(v, t)<br />

T<br />

2 + |v|<br />

d(s, t)2<br />

T<br />

where u is the newly joined cluster consisting of clusters s and t, v is an unused cluster in the forest,<br />

T = |v| + |s| + |t|, and | ∗ | is the cardinality of its argument. This is also known as the incremental<br />

algorithm.<br />

Warning: When the minimum distance pair in the forest is chosen, there may be two or more pairs with the<br />

same minimum distance. This implementation may chose a different minimum than the MATLAB(TM)<br />

version.<br />

Returns<br />

Parameters<br />

• Z<br />

• y<br />

[ndarray] A condensed or redundant distance matrix. A condensed distance matrix<br />

is a flat array containing the upper triangular of the distance matrix. This is the<br />

form that pdist returns. Alternatively, a collection of m observation vectors in n<br />

dimensions may be passed as an m by n array.<br />

• method<br />

[string] The linkage algorithm to use. See the Linkage Methods section below<br />

for full descriptions.<br />

• metric<br />

[string] The distance metric to use. See the distance.pdist function for a list<br />

of valid distance metrics.<br />

[ndarray] The hierarchical clustering encoded as a linkage matrix.<br />

maxRstat(Z, R, i)<br />

Returns the maximum statistic for each non-singleton cluster and its descendents.<br />

Arguments<br />

Returns<br />

• Z<br />

• R<br />

• i<br />

[ndarray] The hierarchical clustering encoded as a matrix. See linkage for more<br />

information.<br />

[ndarray] The inconsistency matrix.<br />

[int] The column of R to use as the statistic.<br />

• MR : ndarray Calculates the maximum statistic for the i’th column of the inconsistency<br />

matrix R for each non-singleton cluster node. MR[j] is the maximum over R[Q(j)-n,<br />

i] where Q(j) the set of all node ids corresponding to nodes below and including j.<br />

3.1. Clustering package (<strong>scipy</strong>.cluster) 143

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

Saved successfully!

Ooh no, something went wrong!