sospcat¶
The module exposes the functions get_social_groups()
and
compare_soc_spat()
.
get_social_groups()
is defined in sospcat.social
as
spspcat.social.get_groups()
.
compare_soc_spat()
is defined in sospcat.compare
as
spspcat.social.social_vs_spatial()
.
-
compare_soc_spat
(node_locations, soc_membership, **kwargs)¶ This method relies on the
homogeneity_completeness_v_measure()
method form thesklearn.metrics
package.See also
V-Measure:A conditional entropy-based external cluster evaluation measureAndrew Rosenberg and Julia Hirschberg, 2007- Parameters
node_locations (dict(int, tuple)) – Specify for each node (key) its position (value) in the form of a (x, y) tuple.
soc_membership (dict) – Holds for each node (key) the social group affiliation (value).
**kwargs – All keyword arguments forwarded to
spatial.get_groups()
- Returns
homogeneity, completeness, v-measure – Homogeneity, completeness and v-measure as computed by the
homogeneity_completeness_v_measure()
.- Return type
Return the grouping of the provided graph object using the specified method. The grouping is returned as a list of sets each holding all members of a group.
- Parameters
a_graph (
igraph.Graph
) – The graph to partitionmethod (str (default='component_infomap')) – String specifying which method to use. If two methods should be used one after the other they should be separated by _. Default: ‘component_infomap’ which will first consider all disconnected components as groups then apply infomap on all of those groups to optionally further split.
return_form (str (default='membership')) –
Determines the format of how the social group structure should be returned. Options are:
'membership'
: A list returning for each index node the group it belongs to.'memberlists'
: Dictionary with a list of members value for each group key.
- Returns
Depending on what was chosen for the return_form attribute, either the membership dict, i.e.:
{ node_id: group_id, ... }
or the memberlist dict, i.e.:
{ group_id: [node1_id, node2_id, ...], ... }
(value) is returned.
- Return type