A pure python utility

Label Propagation

A pure python implementation of label propagation

Inspired by smly’s java-labelpropagation, and implemented in pure python code.

Install and Usage

To install labelprop

To use labelprop

Data Format

Input Data Format

each line is in list format, which contains

  • list[0]: node id
  • list[1]: label, use 0 if unknown
  • list[2]: list of neighbor nodes with weight

 

Normal Output Data Format

set clean_result as False, each line is in list format, which contains

  • list[0]: node id
  • list[1]: predicted label
  • list[2:]: list of labels with weight

 

Cleaned Output Data Format

set clean_result as True, each line is in list format, which contains

  • list[0]: node id
  • list[1]: predicted label
  • list[2:]: weight for label