Gephi Toolkit - 检索过滤后的节点表

问题描述

我正在使用 Gephi Toolkit (v0.9.2) 以编程方式分析网络。我想排除没有边(零度)的节点,并且我能够成功过滤图形。但是,来自 getNodeTable()org.gephi.graph.api.GraphModel 返回未过滤的节点集(所有节点,甚至那些没有边的节点)。如何检索过滤后的节点表?

为了计算节点列的统计信息(例如中心性和聚类系数度量),我只需要处理可见的节点集(度数 >= 1 的节点)。结果被大量没有边的节点所扭曲。我正在使用 getNumberOrNumberListColumnStatistics() org.gephi.datalab.api.AttributeColumnsController 计算平均值、中值、Q1、Q3、最小值和最大值。

我想找到一种使用 Gephi Toolkit API 使其正常工作的方法,而不是手动计算这些。

//exclude nodes with no edges
FilterController filterController = Lookup.getDefault().lookup(FilterController.class);
DegreeRangeFilter degreeFilter = new DegreeRangeFilter();
degreeFilter.setRange(new Range(1,Integer.MAX_VALUE));
Query query = filterController.createquery(degreeFilter);
GraphView view = filterController.filter(query);
graphModel.setVisibleView(view);
graph = graphModel.getUndirectedGraphVisible();
//Compute mean,median,Q1,Q3,min,and max of clustering coefficients
AttributeColumnsController attributeColumnsController = Lookup.getDefault().lookup(AttributeColumnsController.class);
BigDecimal[] modularityColumnStatistics = attributeColumnsController.getNumberOrNumberListColumnStatistics(graphModel.getNodeTable(),graphModel.getNodeTable().getColumn("clustering"));

double meanClusteringCoefficient = clusteringCoefficientStatistics[0].doubleValue();
double clusteringCoefficientQ1 = clusteringCoefficientStatistics[1].doubleValue();
double medianClusteringCoefficient = clusteringCoefficientStatistics[2].doubleValue();
double clusteringCoefficientQ3 = clusteringCoefficientStatistics[3].doubleValue();
double minClusteringCoefficient = clusteringCoefficientStatistics[6].doubleValue();
double maxClusteringCoefficient = clusteringCoefficientStatistics[7].doubleValue();

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)