This module provides the functions for node classification problem.
The functions in this module are not imported
into the top level
You can access these functions by importing
then accessing the functions as attributes of
>>> import networkx as nx >>> from networkx.algorithms import node_classification >>> G = nx.path_graph(4) >>> G.edges() EdgeView([(0, 1), (1, 2), (2, 3)]) >>> G.node['label'] = 'A' >>> G.node['label'] = 'B' >>> node_classification.harmonic_function(G) # doctest: +SKIP ['A', 'A', 'B', 'B']
Function for computing Harmonic function algorithm by Zhu et al.
Zhu, X., Ghahramani, Z., & Lafferty, J. (2003, August). Semi-supervised learning using gaussian fields and harmonic functions. In ICML (Vol. 3, pp. 912-919).
||Node classification by Harmonic function|
Local and Global Consistency¶
Function for computing Local and global consistency algorithm by Zhou et al.
Zhou, D., Bousquet, O., Lal, T. N., Weston, J., & Schölkopf, B. (2004). Learning with local and global consistency. Advances in neural information processing systems, 16(16), 321-328.
||Node classification by Local and Global Consistency|