Commit 4ed48096 authored by Baptiste Bauvin's avatar Baptiste Bauvin
Browse files

Doc

parent 4d0493da
Pipeline #7406 failed with stage
in 1 minute
This diff is collapsed.
......@@ -190,12 +190,12 @@
"* the complementary ones tagged `_c-` and\n",
"<!-- * the filling ones tagged `example_`. -->\n",
"\n",
"To get a visualization on these properties, we will use SuMMIT with decision trees on each view. "
"To get a visualization on these properties, we will use [SuMMIT](https://gitlab.lis-lab.fr/baptiste.bauvin/summit) with decision trees on each view. "
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 5,
"metadata": {
"pycharm": {
"is_executing": false,
......@@ -219,7 +219,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 6,
"metadata": {
"pycharm": {
"is_executing": false
......@@ -233,17 +233,17 @@
" <iframe\n",
" width=\"900\"\n",
" height=\"500\"\n",
" src=\"supplementary_material/tuto/started_2021_06_10-09_11_/error_analysis_2D.html\"\n",
" src=\"supplementary_material/error_analysis_2D.html\"\n",
" frameborder=\"0\"\n",
" allowfullscreen\n",
" ></iframe>\n",
" "
],
"text/plain": [
"<IPython.lib.display.IFrame at 0x7f149d3a6f98>"
"<IPython.lib.display.IFrame at 0x7ff88f74e4a8>"
]
},
"execution_count": 7,
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
......@@ -268,7 +268,7 @@
"experiment_directory = fetch_latest_dir(os.listdir(os.path.join('supplementary_material', 'tuto')))\n",
"error_fig_path = os.path.join('supplementary_material','tuto', experiment_directory, \"error_analysis_2D.html\")\n",
"\n",
"IFrame(src=error_fig_path, width=900, height=500)\n"
"IFrame(src=os.path.join('supplementary_material',\"error_analysis_2D.html\") , width=900, height=500)\n"
]
},
{
......@@ -280,7 +280,7 @@
},
"source": [
"This graph represents the failure of each classifier on each sample. So a black rectangle on row i, column j means that classifier j always failed to classify example i. \n",
"So, by [zooming in](link_to_gif), we can focus on several samples and we see that the type of samples are well defined as the mutual error ones are systematically misclassified by the decision trees, the redundant ones are well-classified and the complementary ones are classified only by a portion of the views. \n",
"So, by [zooming in](https://baptiste.bauvin.pages.lis-lab.fr/summit/_images/zoom_plotly.gif), we can focus on several samples and we see that the type of samples are well defined as the mutual error ones are systematically misclassified by the decision trees, the redundant ones are well-classified and the complementary ones are classified only by a portion of the views. \n",
" \n",
"\n"
]
......
This diff is collapsed.
......@@ -12,11 +12,18 @@
#
import os
import sys
sys.path.insert(0, os.path.abspath('../../multiview_generator'))
repo_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# print(repo_path)
# print(os.path.join(repo_path, "multiview_generator", "base"))
# quit()
sys.path.insert(0, os.path.abspath('.'))
sys.path.insert(0, os.path.join(repo_path, "multiview_generator'"))
sys.path.insert(0, repo_path)
# -- Project information -----------------------------------------------------
project = 'Mulitivew Generator'
project = 'MAGE'
copyright = '2020, Baptiste Bauvin'
author = 'Baptiste Bauvin'
......@@ -31,6 +38,7 @@ release = '0.0'
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.extlinks',
'sphinx_rtd_theme',
# 'sphinx.ext.doctest',
# 'sphinx.ext.intersphinx',
# 'sphinx.ext.todo',
......@@ -42,11 +50,24 @@ extensions = ['sphinx.ext.autodoc',
# 'sphinx.ext.viewcode',
# 'sphinx.ext.githubpages',
'sphinx.ext.napoleon',
"autoapi.extension",
'nbsphinx',
"nbsphinx_link"
# 'm2r'
]
autoapi_type = 'python'
autoapi_dirs = [os.path.join(repo_path, "multiview_generator",""),]
autoapi_options = ["members", "show-module-summary", 'undoc-members']
autoapi_ignore = ["*tests*"]
autoapi_keep_files = False
autoapi_add_toctree_entry = False
add_module_names = False
autoapi_template_dir = os.path.join(repo_path, "docs", "source", "templates_autoapi")
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates', 'templates_autoapi']
source_suffix = ['.rst', '.md', '.ipynb', ".nblink"]
# Add any paths that contain templates here, relative to this directory.
......@@ -63,12 +84,12 @@ exclude_patterns = ['_build', '**.ipynb_checkpoints']
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'nature'
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ['_static',]
rst_prolog = """
.. role:: python(code)
......@@ -77,18 +98,18 @@ rst_prolog = """
.. role :: yaml(code)
:language: yaml
.. |gene| replace:: SMuDGE
.. |gene| replace:: MAGE
.. |gene_f| replace:: Supervised MUltimodal Dataset Generation Engine
.. |gene_f| replace:: Multi-view Artificial Generation Engine
.. |HPO| replace:: hyper-parameters optimization
"""
extlinks = {'base_source': (
'https://gitlab.lis-lab.fr/baptiste.bauvin/smudge/-/tree/master/',
'https://gitlab.lis-lab.fr/dev/multiview_generator',
"base_source"),
'base_doc': (
'http://baptiste.bauvin.pages.lis-lab.fr/smudge/', 'base_doc'),
'https://dev.pages.lis-lab.fr/multiview_generator/', 'base_doc'),
'summit':('https://gitlab.lis-lab.fr/baptiste.bauvin/summit', 'summit')}
html_js_files = [
......
|gene| documentation
====================
.. automodule:: multiple_sub_problems
.. toctree::
:maxdepth: 2
.. autoclass:: MultiViewSubProblemsGenerator
:members:
autoapi/multiview_generator/base/index
autoapi/multiview_generator/gaussian_classes/index
autoapi/multiview_generator/sub_problems/index
autoapi/multiview_generator/utils/index
\ No newline at end of file
......@@ -3,10 +3,10 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to multiview_generator's documentation!
Welcome to |gene|'s documentation
===============================================
To install MAGE, clone the gitlab repository and run
To install |gene|, clone the gitlab repository and run
.. code-block::
......@@ -24,8 +24,8 @@ To install MAGE, clone the gitlab repository and run
include_tuto3
documentation
Read me
=========
Read Me
=======
.. include:: readme_link.rst
......
import numpy as np
import itertools
import math
......@@ -22,7 +21,6 @@ class MultiViewGaussianSubProblemsGenerator(MultiViewSubProblemsGenerator):
sub_problem_generators="StumpsGenerator", random_vertices=False,
min_rndm_val=-1, max_rndm_val=1, **kwargs):
"""
:param random_state: int or np.random.RandomState object to fix the
random seed
:param n_samples: int representing the number of samples in the dataset
......@@ -74,18 +72,15 @@ class MultiViewGaussianSubProblemsGenerator(MultiViewSubProblemsGenerator):
def generate_multi_view_dataset(self, ):
"""
This is the main method. It will generate a multiview dataset according
to the configuration.
This is the main method. It will generate a multiview dataset according to the configuration.
To do so,
* it generates the labels of the multiview dataset,
* then it assigns all the subsets of samples (redundant, ...)
* finally, for each view it generates a monoview dataset according
to the configuration
* finally, for each view it generates a monoview dataset according to the configuration
:return: view_data a list containing the views np.ndarrays and y, the
label array.
:return: view_data a list containing the views np.ndarrays and y, the label array.
"""
# Generate the labels
......
......@@ -59,7 +59,7 @@ class StumpsGenerator(BaseSubProblem):
uniform noise features : all the remaining ones
:return: data a np.ndarray of dimension n_classes, n_samples_per_class,
:return: data a np.ndarray of dimension n_classes, n_samples_per_class, \
n_features containing the samples' descriptions, sorted by class
"""
self.n_relevant_features = math.ceil(math.log2(self.n_classes))
......@@ -223,16 +223,14 @@ class TreesGenerator(BaseSubProblem): # pragma: no cover
class RingsGenerator(BaseSubProblem):
def gen_data(self):
"""
Generates the samples according to gaussian distributions with scales
r"""Generates the samples according to gaussian distributions with scales
computed with the given error and class separation. The generator first
computes a radius according to the gaussian distribution, then
generates n_features-1 random angles to build the polar coordinates of
the samples. The dataset returned is the cartesian version of this
"polar" dataset.
:return: data a np.ndarray of dimension n_classes, n_samples_per_class,
n_features containing the samples' descriptions, sorted by class
:return: data a np.ndarray of dimension n_classes, n_samples_per_class, n_features containing the samples' descriptions, sorted by class
"""
if self.n_features<2:
raise ValueError("n_features for view {} must be at least 2, (now: {})".format(1, self.n_features))
......
......@@ -180,9 +180,11 @@ def setup_package():
extras_require = {
'dev': ['pytest', 'pytest-cov'],
'doc': ['sphinx>=1.8', 'numpydoc', 'sphinx_gallery', 'matplotlib', "jupyter",
'pandoc', 'nbshpinx', 'nbsphinx_link']}
'pandoc', 'nbshpinx', 'nbsphinx_link', 'sphinx_rtd_theme']}
include_package_data = True
command_options = {'build_sphinx': {'build_dir':('setup.py', './docs/build/')}}
setup(name=name,
version=version,
description=description,
......@@ -198,7 +200,8 @@ def setup_package():
install_requires=install_requires,
python_requires=python_requires,
extras_require=extras_require,
include_package_data=include_package_data)
include_package_data=include_package_data,
command_options=command_options)
if __name__ == "__main__":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment