Changeset 10510:e65f85644182 in orange
 Timestamp:
 03/13/12 17:43:51 (2 years ago)
 Branch:
 default
 rebase_source:
 4b5672932052f697bb634cca91743026714ec9d5
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Orange/OrangeWidgets/Unsupervised/OWNxAnalysis.py
r10046 r10510 6 6 <priority>6425</priority> 7 7 """ 8 from PyQt4.QtCore import QMutex 8 9 import numpy 9 10 import networkx as nx … … 66 67 self.outputs = [("Network", Orange.network.Graph), 67 68 ("Items", Orange.data.Table)] 68 69 69 70 self.methods = [ 70 71 ("number_of_nodes", True, "Number of nodes", GRAPHLEVEL, lambda G: G.number_of_nodes()), … … 75 76 ("average_shortest_path_length", False, "Average shortest path length", GRAPHLEVEL, nx.average_shortest_path_length), 76 77 ("density", True, "Density", GRAPHLEVEL, nx.density), 77 ("degree_assortativity_coefficient", False, "Degree assortativity coefficient", GRAPHLEVEL, nx.degree_assortativity_coefficient), 78 ("degree_assortativity_coefficient", False, \ 79 "Degree assortativity coefficient", GRAPHLEVEL, \ 80 nx.degree_assortativity_coefficient if \ 81 hasattr(nx, "degree_assortativity_coefficient") else None), 78 82 # additional attr needed 79 83 #("attribute_assortativity_coefficient", False, "Attribute assortativity coefficient", GRAPHLEVEL, nx.attribute_assortativity_coefficient), 80 84 #("numeric_assortativity_coefficient", False, "Numeric assortativity coefficient", GRAPHLEVEL, nx.numeric_assortativity_coefficient), 81 ("degree_pearson_correlation_coefficient", False, "Degree pearson correlation coefficient", GRAPHLEVEL, nx.degree_pearson_correlation_coefficient), 82 ("estrada_index", False, "Estrada index", GRAPHLEVEL, nx.estrada_index), 85 ("degree_pearson_correlation_coefficient", False, \ 86 "Degree pearson correlation coefficient", GRAPHLEVEL, \ 87 nx.degree_pearson_correlation_coefficient if\ 88 hasattr(nx, "degree_pearson_correlation_coefficient") else None), 89 ("estrada_index", False, "Estrada index", GRAPHLEVEL, \ 90 nx.estrada_index if hasattr(nx, "estrada_index") else None), 83 91 ("graph_clique_number", False, "Graph clique number", GRAPHLEVEL, nx.graph_clique_number), 84 92 ("graph_number_of_cliques", False, "Graph number of cliques", GRAPHLEVEL, nx.graph_number_of_cliques), … … 112 120 ("current_flow_closeness_centrality", False, "Information centrality", NODELEVEL, nx.current_flow_closeness_centrality), 113 121 ("current_flow_betweenness_centrality", False, "Randomwalk betweenness centrality", NODELEVEL, nx.current_flow_betweenness_centrality), 114 ("approximate_current_flow_betweenness_centrality", False, "Approx. randomwalk betweenness centrality", NODELEVEL, nx.approximate_current_flow_betweenness_centrality), 122 ("approximate_current_flow_betweenness_centrality", False, \ 123 "Approx. randomwalk betweenness centrality", NODELEVEL, \ 124 nx.approximate_current_flow_betweenness_centrality if \ 125 hasattr(nx, "approximate_current_flow_betweenness_centrality") \ 126 else None), 115 127 ("eigenvector_centrality", False, "Eigenvector centrality", NODELEVEL, nx.eigenvector_centrality), 116 128 ("eigenvector_centrality_numpy", False, "Eigenvector centrality (NumPy)", NODELEVEL, nx.eigenvector_centrality_numpy), … … 120 132 ("closeness_vitality", False, "Closeness vitality", NODELEVEL, nx.closeness_vitality), 121 133 ] 134 135 self.methods = [method for method in self.methods if method[1] is not None] 122 136 123 137 self.auto_commit = False
Note: See TracChangeset
for help on using the changeset viewer.