-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0204c4a
commit 3a418c2
Showing
65 changed files
with
21,842 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<!DOCTYPE html> | ||
<html class="writer-html5" lang="en" > | ||
<head> | ||
<meta charset="utf-8" /><meta name="generator" content="Docutils 0.18.1: http://docutils.sourceforge.net/" /> | ||
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>NMTF_link module — Web App NMTF_link 1.1 documentation</title> | ||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" /> | ||
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" /> | ||
<!--[if lt IE 9]> | ||
<script src="_static/js/html5shiv.min.js"></script> | ||
<![endif]--> | ||
|
||
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script> | ||
<script src="_static/jquery.js"></script> | ||
<script src="_static/underscore.js"></script> | ||
<script src="_static/_sphinx_javascript_frameworks_compat.js"></script> | ||
<script src="_static/doctools.js"></script> | ||
<script src="_static/sphinx_highlight.js"></script> | ||
<script src="_static/js/theme.js"></script> | ||
<link rel="index" title="Index" href="genindex.html" /> | ||
<link rel="search" title="Search" href="search.html" /> | ||
<link rel="next" title="app module" href="app.html" /> | ||
<link rel="prev" title="flaskProject" href="modules.html" /> | ||
</head> | ||
|
||
<body class="wy-body-for-nav"> | ||
<div class="wy-grid-for-nav"> | ||
<nav data-toggle="wy-nav-shift" class="wy-nav-side"> | ||
<div class="wy-side-scroll"> | ||
<div class="wy-side-nav-search" > | ||
|
||
|
||
|
||
<a href="index.html" class="icon icon-home"> | ||
Web App NMTF_link | ||
</a> | ||
<div role="search"> | ||
<form id="rtd-search-form" class="wy-form" action="search.html" method="get"> | ||
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" /> | ||
<input type="hidden" name="check_keywords" value="yes" /> | ||
<input type="hidden" name="area" value="default" /> | ||
</form> | ||
</div> | ||
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu"> | ||
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p> | ||
<ul class="current"> | ||
<li class="toctree-l1"><a class="reference internal" href="install.html">Installation</a></li> | ||
<li class="toctree-l1"><a class="reference internal" href="how_to.html">Parameters to be specified by the user in the setting file</a></li> | ||
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">flaskProject</a><ul class="current"> | ||
<li class="toctree-l2 current"><a class="current reference internal" href="#">NMTF_link module</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="app.html">app module</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="files_management.html">files_management module</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="scripts.html">scripts package</a></li> | ||
<li class="toctree-l2"><a class="reference internal" href="utils.html">utils package</a></li> | ||
</ul> | ||
</li> | ||
<li class="toctree-l1"><a class="reference internal" href="websocket_protocol.html">Websocket protocol</a></li> | ||
</ul> | ||
|
||
</div> | ||
</div> | ||
</nav> | ||
|
||
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" > | ||
<i data-toggle="wy-nav-top" class="fa fa-bars"></i> | ||
<a href="index.html">Web App NMTF_link</a> | ||
</nav> | ||
|
||
<div class="wy-nav-content"> | ||
<div class="rst-content"> | ||
<div role="navigation" aria-label="Page navigation"> | ||
<ul class="wy-breadcrumbs"> | ||
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li> | ||
<li class="breadcrumb-item"><a href="modules.html">flaskProject</a></li> | ||
<li class="breadcrumb-item active">NMTF_link module</li> | ||
<li class="wy-breadcrumbs-aside"> | ||
<a href="_sources/NMTF_link.rst.txt" rel="nofollow"> View page source</a> | ||
</li> | ||
</ul> | ||
<hr/> | ||
</div> | ||
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> | ||
<div itemprop="articleBody"> | ||
|
||
<section id="module-NMTF_link"> | ||
<span id="nmtf-link-module"></span><h1>NMTF_link module<a class="headerlink" href="#module-NMTF_link" title="Permalink to this heading"></a></h1> | ||
</section> | ||
|
||
|
||
</div> | ||
</div> | ||
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer"> | ||
<a href="modules.html" class="btn btn-neutral float-left" title="flaskProject" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a> | ||
<a href="app.html" class="btn btn-neutral float-right" title="app module" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a> | ||
</div> | ||
|
||
<hr/> | ||
|
||
<div role="contentinfo"> | ||
<p>© Copyright 2023, Giuseppe Bocci.</p> | ||
</div> | ||
|
||
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a | ||
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a> | ||
provided by <a href="https://readthedocs.org">Read the Docs</a>. | ||
|
||
|
||
</footer> | ||
</div> | ||
</div> | ||
</section> | ||
</div> | ||
<script> | ||
jQuery(function () { | ||
SphinxRtdTheme.Navigation.enable(true); | ||
}); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
NMTF\_link module | ||
================= | ||
|
||
.. automodule:: NMTF_link | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
app module | ||
========== | ||
|
||
.. automodule:: app | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
files\_management module | ||
======================== | ||
|
||
.. automodule:: files_management | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Parameters to be specified by the user in the setting file | ||
*********************************************************** | ||
|
||
|
||
To prerform an evaluation the graph_topology.yaml file is needed. It is the setup file and the user needs to specify the following parameters: | ||
|
||
* **integration.strategy** : mode of integration of datasets. When a dataset is present in several association matrices (e.g., the movies are present in three of the four association matrices of the multipartite network in the use case, there are two ways to integrate its elements: either using only its objects that are shared by all association matrices (intersection option), or using all its objects, which are present in at least one association matrix (union option). *Options: "intersection" or "union"*. | ||
|
||
* **initialization** : method to initialize the factor matrices, which are the three matrices that factorize each association matrix. *Options: "random", "kmeans" or "svd"*. | ||
|
||
* **metric** : performance evaluation metric. *Options: "APS" (Average Precision Score) or "AUROC" (Area Under the ROC curve)*. | ||
|
||
* **number.of.iterations** : number of maximum iterations for each run of the algorithm. *Options: any positive integer value* | ||
|
||
* **type.of.masking** : to evaluate the NMTF predictions, there is the need of choosing the masking strategy to be applied on the selected association matrix. It can either have a completely randomized distribution of masking elements, or have the same number of masking elements per row, randomly distributed within each row. *Options: "fully_random" or "per_row_random"*. | ||
|
||
* **stop.criterion** : stop criterion strategies for link prediction using the NMTF method. The options are: | ||
* "maximum_metric" option runs the algorithm 5 times with masking, chooses the iteration with best average evaluation metric, runs one more time (without masking and evaluation) until the chosen iteration and outputs the results; it also outputs evaluation plots to the main directory. | ||
* "relative_error" option runs the algorithm 5 times with masking, chooses the first iteration of each run with relative error < 0.001, runs one more time (without masking and evaluation) until the chosen iteration and outputs the results; it also outputs evaluation plots to the main directory. | ||
* "maximum_iterations" option runs the chosen number of iterations without masking and outputs the result for the last iteration. | ||
|
||
* **score.threshold** : minimum NMTF score value for the novel links predicted. *Options: any value between 0 and 1*. | ||
|
||
* **graph.datasets** : specifies datasets files. It has the following parameters for each file/AssociationMatrix: | ||
* nodes.left: name of the dataset on the left | ||
* nodes.right: name of the dataset on the right | ||
* filename: name of the file containg the bipartite graph | ||
* main: set to *1* if it is the graph being investigated, *0* otherwise | ||
|
||
* **ranks** : specifies the rank of a dataset. The parameters are: | ||
* dsname: dataset name | ||
* k: positive integer value representing the rank | ||
* **k_svd** : rank of all the datasets when the initialization choosed is *svd*. Use this parameter insead of *ranks* for *Compact SVD* (Recommended option). All the datasets will have the same rank of compression. *Options: any positive integer value*. | ||
|
||
|
||
|
||
For a better understanding the case_study should be seen. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.. Web App NMTF_link documentation master file, created by | ||
sphinx-quickstart on Fri Jun 2 00:29:45 2023. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to Web App NMTF_link's documentation! | ||
============================================= | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
install.rst | ||
|
||
how_to.rst | ||
|
||
modules | ||
|
||
websocket_protocol.rst | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
Installation | ||
************** | ||
|
||
Dowload repo | ||
============= | ||
You can downoal it from: https://github.com/DEIB-GECO/NMTF-link . | ||
|
||
Or you can download it using git command: | ||
|
||
.. code-block:: console | ||
git clone https://github.com/DEIB-GECO/NMTF-link | ||
Or wget: | ||
|
||
.. code-block:: console | ||
wget --no-check-certificate --content-disposition https://github.com/DEIB-GECO/NMTF-link | ||
Or curl: | ||
|
||
.. code-block:: console | ||
curl -LJO https://github.com/DEIB-GECO/NMTF-link | ||
Install requirements | ||
===================== | ||
|
||
On your computer | ||
----------------- | ||
You can install web_app_nmtf directly on you device: | ||
|
||
1. Be sure to have python 3.7 installed or you can create and eviorment with conda: | ||
|
||
.. code-block:: console | ||
pip install conda | ||
conda create -n my_env python=3.7 | ||
conda activate my_env | ||
2. Install requirements: | ||
|
||
.. code-block:: console | ||
pip install -r requirements.txt | ||
In a docker container | ||
---------------------- | ||
Or youc can use a docker container: | ||
|
||
.. code-block:: console | ||
docker load < web_app_nmtf.tar | ||
Run app | ||
========== | ||
If you installed requirements with pip use: | ||
|
||
.. code-block:: console | ||
python app.py | ||
If you loaded the docker map the port 5000 and run a container using: | ||
|
||
.. code-block:: console | ||
docker run -p 5000:5000 web_app_nmtf | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
flaskProject | ||
============ | ||
|
||
.. toctree:: | ||
:maxdepth: 4 | ||
|
||
NMTF_link | ||
app | ||
files_management | ||
scripts | ||
utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
scripts package | ||
=============== | ||
|
||
Submodules | ||
---------- | ||
|
||
scripts.AssociationMatrix module | ||
-------------------------------- | ||
|
||
.. automodule:: scripts.AssociationMatrix | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
scripts.Network module | ||
---------------------- | ||
|
||
.. automodule:: scripts.Network | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
scripts.processAssociationMatrix module | ||
--------------------------------------- | ||
|
||
.. automodule:: scripts.processAssociationMatrix | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
scripts.processNetwork module | ||
----------------------------- | ||
|
||
.. automodule:: scripts.processNetwork | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: scripts | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
utils package | ||
============= | ||
|
||
Submodules | ||
---------- | ||
|
||
utils.utils module | ||
------------------ | ||
|
||
.. automodule:: utils.utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
||
Module contents | ||
--------------- | ||
|
||
.. automodule:: utils | ||
:members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Websocket protocol | ||
******************* | ||
|
||
Websocket protocol used is very simple: | ||
|
||
1. The client open the connection | ||
2. The client send his unique id | ||
3. The server starts pushing program output in lines | ||
|
||
This is a simple diagram with possible codes: | ||
|
||
.. include:: websocket_sequence_diagram.txt | ||
:literal: |
Oops, something went wrong.