bigraph.preprocessing package

Submodules

bigraph.preprocessing.get_adjacents module

class bigraph.preprocessing.get_adjacents.GetAdjacents

Bases: object

bigraph.preprocessing.import_files module

class bigraph.preprocessing.import_files.ImportFiles

Bases: object

import_files(edge_csv: str = './inputs/neighbour_matrix.csv', label_id: str = './inputs/id_labels.csv', sep: str = ',', *args, **kwargs) dict

Import links and labels from csv files

Parameters
  • edge_csv – A CSV file containing edge data on each line: 0,4,2 that are u,v,w which stand for node 1, node 2, weight respectively

  • label_id – A CSV file containing labels for nodes: 10,node_name which are ID,label for each node

  • sep – A separator that is the boundary for distinct entities

Returns

links and label dataframes

bigraph.preprocessing.make_graph module

class bigraph.preprocessing.make_graph.MakeGraph

Bases: object

make_graph(dataframe: dict, left_bipartite: str = 'left_side', right_bipartite: str = 'right_side')

Make a graph based on the input dataframe

Parameters
  • left_bipartite – Left part of the graph

  • right_bipartite – Right part of the graph

  • dataframe – Bipartite graph dataframe

Returns

Generated networkx graph

bigraph.preprocessing.pd_to_list module

Module contents

class bigraph.preprocessing.GetAdjacents

Bases: object

class bigraph.preprocessing.ImportFiles

Bases: object

import_files(edge_csv: str = './inputs/neighbour_matrix.csv', label_id: str = './inputs/id_labels.csv', sep: str = ',', *args, **kwargs) dict

Import links and labels from csv files

Parameters
  • edge_csv – A CSV file containing edge data on each line: 0,4,2 that are u,v,w which stand for node 1, node 2, weight respectively

  • label_id – A CSV file containing labels for nodes: 10,node_name which are ID,label for each node

  • sep – A separator that is the boundary for distinct entities

Returns

links and label dataframes

class bigraph.preprocessing.MakeGraph

Bases: object

make_graph(dataframe: dict, left_bipartite: str = 'left_side', right_bipartite: str = 'right_side')

Make a graph based on the input dataframe

Parameters
  • left_bipartite – Left part of the graph

  • right_bipartite – Right part of the graph

  • dataframe – Bipartite graph dataframe

Returns

Generated networkx graph