# Kernel Died Problem

Sir,

I am trying to follow the example on "edge prediction as binary
classification".

Here is my code:

*import graph_tool as gt
import pandas as pd*

# create a graph object in data frame format

*ndf =
pd.DataFrame({'Node1':['a','b','c','d','e'],'Node2':['c','e','b','a','d'],'Weight':[0.2,0.8,0.4,0.5,0.7],
'RandProp1':[1,2,3,1,2]})

ng = gt.Graph()

nprop = ng.new_edge_property("float")
ng.edge_properties['Weight'] = nprop* # important to map the properties to
the graph

*LayerProp = ng.new_edge_property('float')
ng.edge_properties['LayerProp'] = LayerProp*

*nvp =

# minimizing the graph and inferring partitions

*stateA = gt.inference.minimize_nested_blockmodel_dl(ng,layers=True,

state_args=dict(ec=LayerProp,layers=True),

deg_corr=True,verbose=True)*
*L = 10
bs = stateA.get_bs()
bs += [np.zeros(1)]*(L-len(bs))

stateB = stateA.copy(bs=bs, sampling=True)
probs=([])

def collect_edge_probs(s):
p =
s.get_edges_prob([missing_edges[0]],entropy_args=dict(partition_dl=False))

probs[0].append(p);

missing_edges = [(1,2,1)] *# for layered network you need to specify layer
number

*gt.inference.mcmc_equilibrate(stateB,force_niter=1000,mcmc_args=dict(niter=10),
callback=collect_edge_probs,verbose=True)*

I have another query that; how can we get the layer associated with the
node?

In the above code when I try the command

*for i in nvp: print(i)*

I get the output as : *a,c,b,e,d*

and when I type the command

*LayerProp.a*

I get the output: *PropertyArray([ 1., 2., 3., 1., 2.])*

How do I understand that because the order of addition of nodes depends on
the order they come along with add_edge_list command, while the LayerProp is
added in the order as mentioned in the property map.

Sir,

I am trying to follow the example on "edge prediction as binary
classification".

Here is my code:

*import graph_tool as gt
import pandas as pd*

# create a graph object in data frame format

*ndf =
pd.DataFrame({'Node1':['a','b','c','d','e'],'Node2':['c','e','b','a','d'],'Weight':[0.2,0.8,0.4,0.5,0.7],
'RandProp1':[1,2,3,1,2]})

ng = gt.Graph()

nprop = ng.new_edge_property("float")
ng.edge_properties['Weight'] = nprop* # important to map the properties to
the graph

*LayerProp = ng.new_edge_property('float')
ng.edge_properties['LayerProp'] = LayerProp*

*nvp =

# minimizing the graph and inferring partitions

*stateA = gt.inference.minimize_nested_blockmodel_dl(ng,layers=True,

state_args=dict(ec=LayerProp,layers=True),

deg_corr=True,verbose=True)*
*L = 10
bs = stateA.get_bs()
bs += [np.zeros(1)]*(L-len(bs))

stateB = stateA.copy(bs=bs, sampling=True)
probs=([])

def collect_edge_probs(s):
p =
s.get_edges_prob([missing_edges[0]],entropy_args=dict(partition_dl=False))

``````probs\[0\]\.append\(p\);
``````

missing_edges = [(1,2,1)] *# for layered network you need to specify layer
number

*gt.inference.mcmc_equilibrate(stateB,force_niter=1000,mcmc_args=dict(niter=10),
callback=collect_edge_probs,verbose=True)*

This might be a bug. Please open an issue in the website with this example, and I'll take a look at it when I have the time.

(Also, please do not post the same email multiple times to the mailing list. If I haven't responded the first time, it's because I did not have the chance to look into it)

I have another query that; how can we get the layer associated with the
node?

In the above code when I try the command

*for i in nvp: print(i)*

I get the output as : *a,c,b,e,d*

and when I type the command

*LayerProp.a*

I get the output: *PropertyArray([ 1., 2., 3., 1., 2.])*

How do I understand that because the order of addition of nodes depends on
the order they come along with add_edge_list command, while the LayerProp is
added in the order as mentioned in the property map.

I'm not sure I understand your question. Nodes do not belong to different layers, only the edges do.

Thank you sir, I will open the issue on the website.

Sir,

I tried raising this issue on Git Lab page of graph-tool but somehow it
always fails with an error 500 page popping up. I tried using different
internet connections and computers but no solution.

Also, I tried looking for this particular Git Lab issue which has reported
by others as well. But there isn;t any specific solution associated with
this problem.

Thanks for reporting this. The problem has been fixed.