Skip to content

Commit

Permalink
restrict Jinja2<3.1 in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelFu1998-create committed Apr 13, 2022
1 parent 8e5933e commit ebcc6e4
Show file tree
Hide file tree
Showing 39 changed files with 2,721 additions and 2,279 deletions.
Binary file modified docs/_build/doctrees/conduct.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/contributing.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/doctrees/index.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/source/modules.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/source/pyexplainer.doctree
Binary file not shown.
Binary file modified docs/_build/doctrees/usage.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 2dc9210081928e74d5a6f5d2967dc749
config: b534122c30510fb718a6ee6c56b8a566
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file added docs/_build/html/_images/logo_50x50.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
141 changes: 19 additions & 122 deletions docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
@@ -1,202 +1,99 @@


<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
<meta charset="utf-8" />

<meta name="viewport" content="width=device-width, initial-scale=1.0" />

<title>Overview: module code &mdash; pyexplainer documentation</title>



<link rel="stylesheet" href="../_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />










<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 type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
<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/doctools.js"></script>

<script type="text/javascript" src="../_static/js/theme.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" />
</head>

<body class="wy-body-for-nav">


<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"> pyexplainer



</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" />
<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="main navigation">






<p class="caption"><span class="caption-text">Contents:</span></p>
</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>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usage.html">Usage</a></li>
<li class="toctree-l1"><a class="reference internal" href="../usage.html">Tutorial</a></li>
<li class="toctree-l1"><a class="reference internal" href="../contributing.html">Contributing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../conduct.html">Code of Conduct</a></li>
</ul>



</div>

</div>
</nav>

<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">


<nav class="wy-nav-top" aria-label="top navigation">

<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">pyexplainer</a>

</nav>


<div class="wy-nav-content">

<div class="rst-content">



















<div role="navigation" aria-label="breadcrumbs navigation">

<div role="navigation" aria-label="Page navigation">
<ul class="wy-breadcrumbs">

<li><a href="../index.html" class="icon icon-home"></a> &raquo;</li>

<li>Overview: module code</li>


<li class="wy-breadcrumbs-aside">

</li>

</ul>


<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">

<h1>All modules for which code is available</h1>
<ul><li><a href="pyexplainer/pyexplainer_pyexplainer.html">pyexplainer.pyexplainer_pyexplainer</a></li>
<li><a href="pyexplainer/rulefit.html">pyexplainer.rulefit</a></li>
<ul><li><a href="pyexplainer/rulefit.html">pyexplainer.rulefit</a></li>
</ul>

</div>

</div>
<footer>

<hr/>

<div role="contentinfo">
<p>
&#169; Copyright 2021, Michael Fu.

</p>
<p>&#169; Copyright 2021, Michael Fu.</p>
</div>



Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a


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>.
provided by <a href="https://readthedocs.org">Read the Docs</a>.


</footer>
</div>
</div>

</section>

</div>


<script type="text/javascript">
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>





</script>

</body>
</html>
1 change: 1 addition & 0 deletions docs/_build/html/_sources/index.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Welcome to pyexplainer's documentation!

.. image:: https://img.shields.io/badge/badges-shields.io-brightgreen
:target: https://shields.io/
.. image:: ../img/logo_50x50.png

python ML explainer for SEA

Expand Down
26 changes: 17 additions & 9 deletions docs/_build/html/_sources/installation.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ you through the process.

.. _pip: https://pip.pypa.io
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/
|
If you are with conda, simply run the command below to install pyexplainer under your conda environment.

.. code-block:: console
$ conda install -c conda-forge pyexplainer
From sources
------------

Expand All @@ -32,28 +37,31 @@ You can either clone the public repository:

.. code-block:: console
$ git clone git://github.com/MichaelFu1998-create/pyexplainer
$ git clone git://github.com/awsm-research/PyExplainer
Or download the `tarball`_:

.. code-block:: console
$ curl -OL https://github.com/MichaelFu1998-create/pyexplainer/tarball/main
Once you have a copy of the source, you can install it. The method of installation will depend on the packaging library being used.
$ curl -OL https://github.com/awsm-research/PyExplainer/tarball/main
For example, if `setuptools` is being used (a setup.py file is present), install pyexplainer with:
Once you have a copy of the source, cd to the main dir of pyexplainer:

.. code-block:: console
$ python setup.py install
$ cd pyexplainer
If `poetry` is being used (poetry.lock and pyproject.toml files are present), install pyexplainer with:
Then install it via `poetry <https://python-poetry.org/>`_:

.. code-block:: console
$ poetry install
If you do not have poetry installed yet, simply run the command below to install it, for more information, click `here <https://python-poetry.org/docs/>`_:

.. code-block:: console
$ (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py -UseBasicParsing).Content | python -
.. _Github repo: https://github.com/MichaelFu1998-create/pyexplainer
.. _tarball: https://github.com/MichaelFu1998-create/pyexplainer/tarball/master
.. _Github repo: https://github.com/awsm-research/PyExplainer
.. _tarball: https://github.com/awsm-research/PyExplainer/tarball/master
62 changes: 59 additions & 3 deletions docs/_build/html/_sources/usage.rst.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,63 @@
.. highlight:: python

=====
Usage
Tutorial
=====

To use pyexplainer in a project::
Quick start
--------------

To use pyexplainer in a project, first we need to import the required library::

from pyexplainer import pyexplainer_pyexplainer
We can obtain the default dataset and global model stored in a dictionary as below, which is necessary to initialise a PyExplainer object later ::
default_data_and_model = pyexplainer_pyexplainer.get_dflt()
"""
Important Note.
The default dictionary has the following keys:
1. X_train - Training features used to train the global model
2. y_train - Training labels used to train the global model
3. indep - The column names of features
4. dep - The column name of labels
5. blackbox_model - Trained global model (only support supervised classification models from sklearn)
6. X_explain - One row of features (independent variables) to be explained
7. y_explain - One row of label (dependent variable) to be explained
8. full_ft_names - Full column names of features
"""
Initialise PyExplainer object with X_train, y_train, indep, dep, and blackbox_model. Attention!! PyExplainer only supports `sklearn's supervised classification model <https://scikit-learn.org/stable/supervised_learning.html>`_ ::
# Note that full_ft_names is optional while other variables are necessary
py_explainer = pyexplainer_pyexplainer.PyExplainer(X_train = default_data_and_model['X_train'],
y_train = default_data_and_model['y_train'],
indep = default_data_and_model['indep'],
dep = default_data_and_model['dep'],
blackbox_model = default_data_and_model['blackbox_model']
full_ft_names = default_data_and_model['full_ft_names'])

Prepare data using default data dictionary to trigger explain function later::

# one row of features (independent variables) to be explained
X_explain = default_data_and_model['X_explain']
# one row of label (dependent variable) to be explained
y_explain = default_data_and_model['y_explain']

Trigger explain function under PyExplainer object to get rules::

created_rules = py_explainer.explain(X_explain=X_explain,
y_explain=y_explain,
search_function='crossoverinterpolation')

Visualise those rules using visualise function under PyExplainer object::

py_explainer.visualise(created_rule_obj)
Full tutorial
--------------



import pyexplainer
Simply click `here <https://github.com/awsm-research/PyExplainer/blob/master/TUTORIAL.ipynb>`_ to access our full tutorial Jupyter Notebook, in which we introduce the full workflow from data preparation to explainable prediction ::
Loading

0 comments on commit ebcc6e4

Please sign in to comment.