Hi all,
I'm new to the graph theory field and graph-tool package. Can anyone help me with the following questions on SBM of layered graph:
1) In the example shown in https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-..., the edge covariates for the Les Misérables network is passed via g.ep.value:
state = gt.minimize_blockmodel_dl(g, deg_corr=False, layers=True, state_args=dict(ec=g.ep.value, layers=False))
In this case, does the constructed layered model automatically detect how many layers there should be in order to obtain a best fit SBM? If so, how can one retrieve the layer membership of each edge? If not, is there a way to do so in graph-tool via other function calls?
2) There's a so called 'independent layers' model discussed in the reference: Peixoto, T. P., Phys. Rev. E, 2015, 92, 042807 and it seems that setting state_args=dict(ec=g.ep.value, layers=True) in the example should use this model instead of the edge covariate model. But it seems from the paper that on is required to input the number of layers ('C' as in Fig. 3 of the reference). So how exactly should I use graph-tool to use the 'independent layers' model? Or is the algorithm capable of automatically detecting 'C' or the number of layers from the data?
Thanks, Tim
On 23.02.2017 02:01, treinz wrote:
Hi all,
I'm new to the graph theory field and graph-tool package. Can anyone help me with the following questions on SBM of layered graph:
- In the example shown in
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-..., the edge covariates for the Les Misérables network is passed via g.ep.value:
state = gt.minimize_blockmodel_dl(g, deg_corr=False, layers=True, state_args=dict(ec=g.ep.value, layers=False))
In this case, does the constructed layered model automatically detect how many layers there should be in order to obtain a best fit SBM? If so, how can one retrieve the layer membership of each edge? If not, is there a way to do so in graph-tool via other function calls?
Each layer corresponds to a particular value of the g.ep.value property map, which was passed as the `ec` parameter. There is no need to extract anything, since this information was provided to the function in the first place.
- There's a so called 'independent layers' model discussed in the
reference: Peixoto, T. P., Phys. Rev. E, 2015, 92, 042807 and it seems that setting state_args=dict(ec=g.ep.value, layers=True) in the example should use this model instead of the edge covariate model. But it seems from the paper that on is required to input the number of layers ('C' as in Fig. 3 of the reference). So how exactly should I use graph-tool to use the 'independent layers' model? Or is the algorithm capable of automatically detecting 'C' or the number of layers from the data?
The number of layers is determined automatically from the supplied `ec` parameter.
Best, Tiago
Hi Tiago,
Thank you for the info. Here's a follow-up question. If I have a series of networks and I'm expecting some clusters of networks in terms of their stochastic block structure, i.e., there exist networks that are similar to each other when compare their block models. I'm trying to compare them and then identify these clusters by using SBM. Is the layered SBM the appropriate way of doing this and if so how should I use the layered SBM to do so? I don't have enough background to fulling appreciate what's in the paper even after I read it thoroughly and I hope you can give me some idea.
Thanks, Tim At 2017-02-24 02:39:26, "Tiago de Paula Peixoto" tiago@skewed.de wrote:
On 23.02.2017 02:01, treinz wrote:
Hi all,
I'm new to the graph theory field and graph-tool package. Can anyone help me with the following questions on SBM of layered graph:
- In the example shown in
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-..., the edge covariates for the Les Misérables network is passed via g.ep.value:
state = gt.minimize_blockmodel_dl(g, deg_corr=False, layers=True, state_args=dict(ec=g.ep.value, layers=False))
In this case, does the constructed layered model automatically detect how many layers there should be in order to obtain a best fit SBM? If so, how can one retrieve the layer membership of each edge? If not, is there a way to do so in graph-tool via other function calls?
Each layer corresponds to a particular value of the g.ep.value property map, which was passed as the `ec` parameter. There is no need to extract anything, since this information was provided to the function in the first place.
- There's a so called 'independent layers' model discussed in the
reference: Peixoto, T. P., Phys. Rev. E, 2015, 92, 042807 and it seems that setting state_args=dict(ec=g.ep.value, layers=True) in the example should use this model instead of the edge covariate model. But it seems from the paper that on is required to input the number of layers ('C' as in Fig. 3 of the reference). So how exactly should I use graph-tool to use the 'independent layers' model? Or is the algorithm capable of automatically detecting 'C' or the number of layers from the data?
The number of layers is determined automatically from the supplied `ec` parameter.
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
Do the networks have the same number of nodes? If so, you could
- define a variable which has a distinct value for each network in your series, - use this variable as a layer variable - see if this formulation is reducing overall description length, compared to modelling each network individually.
If description length is reduced, then the layer variable is informative in forming the blocks. This might not be what you want if you have a time series, though... Peter
On Fri, 24 Mar 2017 at 11:29 treinz treinz@163.com wrote:
Hi Tiago,
Thank you for the info. Here's a follow-up question. If I have a series of networks and I'm expecting some clusters of networks in terms of their stochastic block structure, i.e., there exist networks that are similar to each other when compare their block models. I'm trying to compare them and then identify these clusters by using SBM. Is the layered SBM the appropriate way of doing this and if so how should I use the layered SBM to do so? I don't have enough background to fulling appreciate what's in the paper even after I read it thoroughly and I hope you can give me some idea.
Thanks, Tim
At 2017-02-24 02:39:26, "Tiago de Paula Peixoto" tiago@skewed.de wrote:
On 23.02.2017 02:01, treinz wrote:
Hi all,
I'm new to the graph theory field and graph-tool package. Can anyone help me with the following questions on SBM of layered graph:
- In the example shown in
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-..., the edge covariates for the Les Misérables network is passed via g.ep.value:
state = gt.minimize_blockmodel_dl(g, deg_corr=False, layers=True, state_args=dict(ec=g.ep.value, layers=False))
In this case, does the constructed layered model automatically detect how many layers there should be in order to obtain a best fit SBM? If so, how can one retrieve the layer membership of each edge? If not, is there a way to do so in graph-tool via other function calls?
Each layer corresponds to a particular value of the g.ep.value property map, which was passed as the `ec` parameter. There is no need to extract anything, since this information was provided to the function in the first place.
- There's a so called 'independent layers' model discussed in the
reference: Peixoto, T. P., Phys. Rev. E, 2015, 92, 042807 and it seems that setting state_args=dict(ec=g.ep.value, layers=True) in the example should use this model instead of the edge covariate model. But it seems from the paper that on is required to input the number of layers ('C' as in Fig. 3 of the reference). So how exactly should I use graph-tool to use the 'independent layers' model? Or is the algorithm capable of automatically detecting 'C' or the number of layers from the data?
The number of layers is determined automatically from the supplied `ec` parameter.
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
Hi Peter,
Thanks for your reply. If I understand you correctly, what you said is basically defining a similarity score and cluster the network into layers and run SBM on each layer and then compare?
Thanks, Tim
At 2017-03-27 06:22:18, "Peter Straka" p.straka@unsw.edu.au wrote:
Do the networks have the same number of nodes? If so, you could define a variable which has a distinct value for each network in your series, use this variable as a layer variable
see if this formulation is reducing overall description length, compared to modelling each network individually. If description length is reduced, then the layer variable is informative in forming the blocks. This might not be what you want if you have a time series, though... Peter
On Fri, 24 Mar 2017 at 11:29 treinz treinz@163.com wrote:
Hi Tiago,
Thank you for the info. Here's a follow-up question. If I have a series of networks and I'm expecting some clusters of networks in terms of their stochastic block structure, i.e., there exist networks that are similar to each other when compare their block models. I'm trying to compare them and then identify these clusters by using SBM. Is the layered SBM the appropriate way of doing this and if so how should I use the layered SBM to do so? I don't have enough background to fulling appreciate what's in the paper even after I read it thoroughly and I hope you can give me some idea.
Thanks, Tim At 2017-02-24 02:39:26, "Tiago de Paula Peixoto" tiago@skewed.de wrote:
On 23.02.2017 02:01, treinz wrote:
Hi all,
I'm new to the graph theory field and graph-tool package. Can anyone help me with the following questions on SBM of layered graph:
- In the example shown in
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-..., the edge covariates for the Les Misérables network is passed via g.ep.value:
state = gt.minimize_blockmodel_dl(g, deg_corr=False, layers=True, state_args=dict(ec=g.ep.value, layers=False))
In this case, does the constructed layered model automatically detect how many layers there should be in order to obtain a best fit SBM? If so, how can one retrieve the layer membership of each edge? If not, is there a way to do so in graph-tool via other function calls?
Each layer corresponds to a particular value of the g.ep.value property map, which was passed as the `ec` parameter. There is no need to extract anything, since this information was provided to the function in the first place.
- There's a so called 'independent layers' model discussed in the
reference: Peixoto, T. P., Phys. Rev. E, 2015, 92, 042807 and it seems that setting state_args=dict(ec=g.ep.value, layers=True) in the example should use this model instead of the edge covariate model. But it seems from the paper that on is required to input the number of layers ('C' as in Fig. 3 of the reference). So how exactly should I use graph-tool to use the 'independent layers' model? Or is the algorithm capable of automatically detecting 'C' or the number of layers from the data?
The number of layers is determined automatically from the supplied `ec` parameter.
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
Don't know what you mean by similarity score? I also don't really know what you're trying to do... but I assume you're looking for patterns and clusters. Blockmodels take the philosophy that if your network data can be compressed effectively by fitting a blockmodel, then a blockmodel is likely to be a good model for how your data were generated. In this paper https://arxiv.org/pdf/1504.02381 Tiago explains how you can check if the time/index/sequence variable for your series of networks contains useful information. You compare the description lengths without and with that variable (Section IV). That way you could e.g. give evidence for a change point in the series. Hope this helps, Peter
On Tue, 28 Mar 2017 at 04:18 treinz treinz@163.com wrote:
Hi Peter,
Thanks for your reply. If I understand you correctly, what you said is basically defining a similarity score and cluster the network into layers and run SBM on each layer and then compare?
Thanks, Tim
At 2017-03-27 06:22:18, "Peter Straka" p.straka@unsw.edu.au wrote:
Do the networks have the same number of nodes? If so, you could
- define a variable which has a distinct value for each network in
your series,
- use this variable as a layer variable
- see if this formulation is reducing overall description length,
compared to modelling each network individually.
If description length is reduced, then the layer variable is informative in forming the blocks. This might not be what you want if you have a time series, though... Peter
On Fri, 24 Mar 2017 at 11:29 treinz treinz@163.com wrote:
Hi Tiago,
Thank you for the info. Here's a follow-up question. If I have a series of networks and I'm expecting some clusters of networks in terms of their stochastic block structure, i.e., there exist networks that are similar to each other when compare their block models. I'm trying to compare them and then identify these clusters by using SBM. Is the layered SBM the appropriate way of doing this and if so how should I use the layered SBM to do so? I don't have enough background to fulling appreciate what's in the paper even after I read it thoroughly and I hope you can give me some idea.
Thanks, Tim
At 2017-02-24 02:39:26, "Tiago de Paula Peixoto" tiago@skewed.de wrote:
On 23.02.2017 02:01, treinz wrote:
Hi all,
I'm new to the graph theory field and graph-tool package. Can anyone help me with the following questions on SBM of layered graph:
- In the example shown in
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-..., the edge covariates for the Les Misérables network is passed via g.ep.value:
state = gt.minimize_blockmodel_dl(g, deg_corr=False, layers=True, state_args=dict(ec=g.ep.value, layers=False))
In this case, does the constructed layered model automatically detect how many layers there should be in order to obtain a best fit SBM? If so, how can one retrieve the layer membership of each edge? If not, is there a way to do so in graph-tool via other function calls?
Each layer corresponds to a particular value of the g.ep.value property map, which was passed as the `ec` parameter. There is no need to extract anything, since this information was provided to the function in the first place.
- There's a so called 'independent layers' model discussed in the
reference: Peixoto, T. P., Phys. Rev. E, 2015, 92, 042807 and it seems that setting state_args=dict(ec=g.ep.value, layers=True) in the example should use this model instead of the edge covariate model. But it seems from the paper that on is required to input the number of layers ('C' as in Fig. 3 of the reference). So how exactly should I use graph-tool to use the 'independent layers' model? Or is the algorithm capable of automatically detecting 'C' or the number of layers from the data?
The number of layers is determined automatically from the supplied `ec` parameter.
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
Hi Peter,
I think I'm confused by how the input and output are related to each other in the layered model. Let's say each network in my data is 1 of the top 3 layers of Fig. 1 of the paper you mentioned. I don't have a well-defined sequence variable for the networks except that I know they're related to each other but not exactly the same. You can think of them as realizations of different perturbed states of the same underlying network but each comes with some experimental noise. I'm expecting the algorithm to tell me how many of these perturbed states are there in my data and what's the SBM for each of these states. I'm thinking maybe the layered SBM can help me with that. But it seems that in order to use the layered model, I have to first collapse all the networks, which I think will lose a lot of information in my data and I don't know how to interpret the output.
Thanks, Tim
At 2017-03-28 06:13:54, "Peter Straka" p.straka@unsw.edu.au wrote:
Don't know what you mean by similarity score? I also don't really know what you're trying to do... but I assume you're looking for patterns and clusters. Blockmodels take the philosophy that if your network data can be compressed effectively by fitting a blockmodel, then a blockmodel is likely to be a good model for how your data were generated. In this paper Tiago explains how you can check if the time/index/sequence variable for your series of networks contains useful information. You compare the description lengths without and with that variable (Section IV). That way you could e.g. give evidence for a change point in the series. Hope this helps, Peter
On Tue, 28 Mar 2017 at 04:18 treinz treinz@163.com wrote:
Hi Peter,
Thanks for your reply. If I understand you correctly, what you said is basically defining a similarity score and cluster the network into layers and run SBM on each layer and then compare?
Thanks, Tim
At 2017-03-27 06:22:18, "Peter Straka" p.straka@unsw.edu.au wrote:
Do the networks have the same number of nodes? If so, you could define a variable which has a distinct value for each network in your series, use this variable as a layer variable
see if this formulation is reducing overall description length, compared to modelling each network individually. If description length is reduced, then the layer variable is informative in forming the blocks. This might not be what you want if you have a time series, though... Peter
On Fri, 24 Mar 2017 at 11:29 treinz treinz@163.com wrote:
Hi Tiago,
Thank you for the info. Here's a follow-up question. If I have a series of networks and I'm expecting some clusters of networks in terms of their stochastic block structure, i.e., there exist networks that are similar to each other when compare their block models. I'm trying to compare them and then identify these clusters by using SBM. Is the layered SBM the appropriate way of doing this and if so how should I use the layered SBM to do so? I don't have enough background to fulling appreciate what's in the paper even after I read it thoroughly and I hope you can give me some idea.
Thanks, Tim At 2017-02-24 02:39:26, "Tiago de Paula Peixoto" tiago@skewed.de wrote:
On 23.02.2017 02:01, treinz wrote:
Hi all,
I'm new to the graph theory field and graph-tool package. Can anyone help me with the following questions on SBM of layered graph:
- In the example shown in
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-..., the edge covariates for the Les Misérables network is passed via g.ep.value:
state = gt.minimize_blockmodel_dl(g, deg_corr=False, layers=True, state_args=dict(ec=g.ep.value, layers=False))
In this case, does the constructed layered model automatically detect how many layers there should be in order to obtain a best fit SBM? If so, how can one retrieve the layer membership of each edge? If not, is there a way to do so in graph-tool via other function calls?
Each layer corresponds to a particular value of the g.ep.value property map, which was passed as the `ec` parameter. There is no need to extract anything, since this information was provided to the function in the first place.
- There's a so called 'independent layers' model discussed in the
reference: Peixoto, T. P., Phys. Rev. E, 2015, 92, 042807 and it seems that setting state_args=dict(ec=g.ep.value, layers=True) in the example should use this model instead of the edge covariate model. But it seems from the paper that on is required to input the number of layers ('C' as in Fig. 3 of the reference). So how exactly should I use graph-tool to use the 'independent layers' model? Or is the algorithm capable of automatically detecting 'C' or the number of layers from the data?
The number of layers is determined automatically from the supplied `ec` parameter.
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
_______________________________________________ graph-tool mailing list graph-tool@skewed.de https://lists.skewed.de/mailman/listinfo/graph-tool
On 28.03.2017 00:02, treinz wrote:
I think I'm confused by how the input and output are related to each other in the layered model. Let's say each network in my data is 1 of the top 3 layers of Fig. 1 of the paper you mentioned. I don't have a well-defined sequence variable for the networks except that I know they're related to each other but not exactly the same. You can think of them as realizations of different perturbed states of the same underlying network but each comes with some experimental noise. I'm expecting the algorithm to tell me how many of these perturbed states are there in my data and what's the SBM for each of these states. I'm thinking maybe the layered SBM can help me with that. But it seems that in order to use the layered model, I have to first collapse all the networks, which I think will lose a lot of information in my data and I don't know how to interpret the output.
I don't really understand what you want, exactly, and what you mean by "perturbed states". Forget about the layered SBM for a moment, and try to explain clearly and succinctly how your data is, and what you want to obtain in the end.
Best, Tiago
OK. Fig 1 and its legend in this paper (http://ieeexplore.ieee.org/document/7442167/) is a summary of what I just stated before.
-Tim
At 2017-03-28 07:18:52, "Tiago de Paula Peixoto" tiago@skewed.de wrote:
On 28.03.2017 00:02, treinz wrote:
I think I'm confused by how the input and output are related to each other in the layered model. Let's say each network in my data is 1 of the top 3 layers of Fig. 1 of the paper you mentioned. I don't have a well-defined sequence variable for the networks except that I know they're related to each other but not exactly the same. You can think of them as realizations of different perturbed states of the same underlying network but each comes with some experimental noise. I'm expecting the algorithm to tell me how many of these perturbed states are there in my data and what's the SBM for each of these states. I'm thinking maybe the layered SBM can help me with that. But it seems that in order to use the layered model, I have to first collapse all the networks, which I think will lose a lot of information in my data and I don't know how to interpret the output.
I don't really understand what you want, exactly, and what you mean by "perturbed states". Forget about the layered SBM for a moment, and try to explain clearly and succinctly how your data is, and what you want to obtain in the end.
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
On 28.03.2017 01:17, treinz wrote:
OK. Fig 1 and its legend in this paper (http://ieeexplore.ieee.org/document/7442167/) is a summary of what I just stated before.
They describe a multilayer SBM, much like the one which is implemented in graph-tool (the main difference is that in graph-tool the model is nonparametric).
If you want to find what they call "strata", i.e. groups of layers, all you need to do is group layers together, such that the description length, with the addition of a term, as described in Eq. 17 of http://dx.doi.org/10.1103/PhysRevE.92.042807.
Best, Tiago
I don't have the prior for how the layers should be grouped together. I suppose I need equation 18 also? Are all of these implemented in graph-tool? If so, can you specify the functions in graph-tool for this? It doesn't seem the LayeredBlockState constructor takes multiple graphs or multilayer graphs as input.
Thanks, Tim
At 2017-03-28 16:03:56, "Tiago de Paula Peixoto" tiago@skewed.de wrote:
On 28.03.2017 01:17, treinz wrote:
OK. Fig 1 and its legend in this paper (http://ieeexplore.ieee.org/document/7442167/) is a summary of what I just stated before.
They describe a multilayer SBM, much like the one which is implemented in graph-tool (the main difference is that in graph-tool the model is nonparametric).
If you want to find what they call "strata", i.e. groups of layers, all you need to do is group layers together, such that the description length, with the addition of a term, as described in Eq. 17 of http://dx.doi.org/10.1103/PhysRevE.92.042807.
Best, Tiago
-- Tiago de Paula Peixoto tiago@skewed.de
On 28.03.2017 23:48, treinz wrote:
I don't have the prior for how the layers should be grouped together. I suppose I need equation 18 also? Are all of these implemented in graph-tool?
You don't need a prior; the complete procedure is described in the paper.
Eq. 18 is not implemented in graph-tool yet, but it is easy to compute.
If so, can you specify the functions in graph-tool for this? It doesn't seem the LayeredBlockState constructor takes multiple graphs or multilayer graphs as input.
This is covered in the HOWTO:
https://graph-tool.skewed.de/static/doc/demos/inference/inference.html#edge-...
Best, Tiago