def compute_affinity_matrix(self, copy=False, **kwargs):
if self.adjacency_matrix is None:<EOL><INDENT>self.compute_adjacency_matrix()<EOL><DEDENT>kwds = self.affinity_kwds.copy()<EOL>kwds.update(kwargs)<EOL>self.affinity_matrix = compute_affinity_matrix(self.adjacency_matrix,<EOL>self.affinity_method,<EOL>**kwds)<EOL>if copy:<EOL><INDENT>return self.affinity_matrix.copy()<EOL><DEDENT>else:<EOL><INDENT>return self.affinity_matrix<EOL><DEDENT>
This function will compute the affinity matrix. In order to
acquire the existing affinity matrix use self.affinity_matrix as
comptute_affinity_matrix() will re-compute the affinity matrix.

Parameters
----------
copy : boolean
    whether to return a copied version of the affinity matrix
**kwargs :
    see affinity.py docmuentation for arguments for each method.

Returns
-------
self.affinity_matrix : sparse matrix (N_obs, N_obs)
    contains the pairwise affinity values using the Guassian kernel
    and bandwidth equal to the affinity_radius