Skip to content

Commit

Permalink
documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotcr committed Aug 10, 2017
1 parent 968d6cd commit 2703bcd
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 20 deletions.
6 changes: 5 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@
sys.path.insert(0, curr_path)

import mock
MOCK_MODULES = ['numpy', 'scipy', 'scipy.sparse', 'sklearn', 'sklearn.preprocessing', 'sklearn.linear_model', 'matplotlib']
MOCK_MODULES = ['numpy', 'scipy', 'scipy.sparse', 'sklearn',
'sklearn.preprocessing', 'sklearn.linear_model', 'matplotlib',
'sklearn.datasets', 'sklearn.ensemble', 'sklearn.cross_validation',
'sklearn.feature_extraction', 'sklearn.feature_extraction.text',
'sklearn.metrics', 'sklearn.naive_bayes', 'sklearn.pipeline']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = mock.Mock()

Expand Down
59 changes: 45 additions & 14 deletions doc/lime.rst
Original file line number Diff line number Diff line change
@@ -1,46 +1,77 @@
lime package
============

Subpackages
-----------

.. toctree::

lime.tests

Submodules
----------

lime.lime_tabular module
------------------------
lime\.discretize module
-----------------------

.. automodule:: lime.lime_tabular
.. automodule:: lime.discretize
:members:
:undoc-members:
:show-inheritance:

lime.lime_text module
---------------------
lime\.exceptions module
-----------------------

.. automodule:: lime.lime_text
.. automodule:: lime.exceptions
:members:
:undoc-members:
:show-inheritance:

lime.discretize module
----------------------
lime\.explanation module
------------------------

.. automodule:: lime.discretize
.. automodule:: lime.explanation
:members:
:undoc-members:
:show-inheritance:

lime.explanation module
lime\.lime\_base module
-----------------------

.. automodule:: lime.explanation
.. automodule:: lime.lime_base
:members:
:undoc-members:
:show-inheritance:

lime.lime_base module
---------------------
lime\.lime\_image module
------------------------

.. automodule:: lime.lime_base
.. automodule:: lime.lime_image
:members:
:undoc-members:
:show-inheritance:

lime\.lime\_tabular module
--------------------------

.. automodule:: lime.lime_tabular
:members:
:undoc-members:
:show-inheritance:

lime\.lime\_text module
-----------------------

.. automodule:: lime.lime_text
:members:
:undoc-members:
:show-inheritance:


Module contents
---------------

.. automodule:: lime
:members:
:undoc-members:
:show-inheritance:
10 changes: 5 additions & 5 deletions lime/lime_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def __init__(self,
categorical_names[x][y] represents the name of the yth value of
column x.
kernel_width: kernel width for the exponential kernel.
If None, defaults to sqrt(number of columns) * 0.75
If None, defaults to sqrt (number of columns) * 0.75
verbose: if true, print local prediction values from linear model
class_names: list of class names, ordered according to whatever the
classifier is using. If not present, class names will be '0',
Expand Down Expand Up @@ -229,8 +229,8 @@ def explain_instance(self,
function that takes a numpy array and outputs prediction
probabilities. For regressors, this takes a numpy array and
returns the predictions. For ScikitClassifiers, this is
`classifier.predict_proba()`. For ScikitRegressors, this
is `regressor.predict()`.
`classifier.predict_proba()`. For ScikitRegressors, this
is `regressor.predict()`.
labels: iterable with labels to be explained.
top_labels: if not None, ignore labels and produce explanations for
the K labels with highest prediction probabilities, where K is
Expand All @@ -239,8 +239,8 @@ def explain_instance(self,
num_samples: size of the neighborhood to learn the linear model
distance_metric: the distance metric to use for weights.
model_regressor: sklearn regressor to use in explanation. Defaults
to Ridge regression in LimeBase. Must have model_regressor.coef_
and 'sample_weight' as a parameter to model_regressor.fit()
to Ridge regression in LimeBase. Must have model_regressor.coef_
and 'sample_weight' as a parameter to model_regressor.fit()
Returns:
An Explanation object (see explanation.py) with the corresponding
Expand Down
4 changes: 4 additions & 0 deletions lime/tests/test_lime_tabular.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import unittest

import numpy as np
import sklearn
import sklearn.datasets
import sklearn.ensemble
import sklearn.linear_model
from sklearn.datasets import load_iris, make_classification
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import Lasso
Expand Down
1 change: 1 addition & 0 deletions lime/tests/test_lime_text.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import unittest

import sklearn
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.linear_model import Lasso
Expand Down

0 comments on commit 2703bcd

Please sign in to comment.