cosifer.handlers package¶
Submodules¶
cosifer.handlers.file_handler module¶
FileHandler interface.
cosifer.handlers.fs_handler module¶
FileSystemHandler inferencer.
-
class
cosifer.handlers.fs_handler.
FileSystemHandler
(filepath, **kwargs)¶ Bases:
cosifer.handlers.file_handler.FileHandler
FileSystemHandler inferencer.
-
filepath
¶ path to the file.
- Type
str
-
dump
(buffer, file_type='w')¶ Dump object to the file.
- Parameters
buffer (object) – a buffer-like object.
file_type (str, optional) – type of the file. Defaults to ‘w’.
-
exist
()¶ Check whether the file exists.
- Returns
true if the file exists, false otherwise.
- Return type
bool
-
filepath
= None
-
load
(file_type='r')¶ Load object from the file.
- Argd:
file_type (str, optional): type of the file. Defaults to ‘r’.
- Returns
the loaded file.
- Return type
IOBase
-
cosifer.handlers.network_handler module¶
NetworkHandler interface.
-
class
cosifer.handlers.network_handler.
NetworkHandler
(filepath=None, **kwargs)¶ Bases:
cosifer.handlers.fs_handler.FileSystemHandler
NetwrokHandler interface.
-
trained
¶ flag to indicate whether the inference has been performed.
- Type
bool
-
filepath
¶ path to the file where the graph is stored.
- Type
str
-
parameters
¶ parameters for the inferencer.
- Type
dict
-
dump
(scaled=True, interaction_symbol='<->', threshold=None, compression='gzip')¶ Dump graph to the file.
- Parameters
scaled (bool, optional) – flag to activate min-max scaling of the edges. Defaults to True.
interaction_symbol (str, optional) – symbol to depict interactions between labels. Defaults to ‘<->’.
threshold (float, optional) – threshold to apply to the intensity. Defaults to None.
compression (str, optional) – compression type. Defaults to ‘gzip’.
-
filepath
= None
-
graph
= None
-
load
(compression='gzip')¶ Load graph from the file.
- Argd:
compression (str, optional): compression type. Defaults to ‘gzip’.
-
trained
= False
-