On 06.10.2017 07:37, Snehal Shekatkar wrote:
> First, the formula for gt.assortativity implies that we are talking about
> discrete categories for the vertices. If this is true, how can we use it at
> all for "degree" since we treat that as a continuous variable? Thus,  I
> don't understand what does "in", "out" and "total" do in this formula.

Degrees are discrete, not continuous.

> Second, I tried implementing the formula itself assuming that the actual
> degree values to be discrete types and my code gives different results than
> the result given by gt.assortativity. I agree that I might be interpreting
> the whole thing in a different fashion and I would be very happy to
> understand it. My code:
> 
> import numpy as np
> import graph_tool.all as gt
> 
> # Load a graph
> g = gt.collection.data['karate']
> 
> # Unique degree values or types
> deg_vals = list(set([v.out_degree() for v in g.vertices()]))
> n = len(deg_vals)

Why are you doing this? The moment you discard repetitions, all the
fractions you compute will be wrong.

> Why are these two values different?

Because they come from different algorithms.

Best,
Tiago

-- 
Tiago de Paula Peixoto <[email protected]>

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to