Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

apply corrections to docstrings #57

Merged
merged 4 commits into from
Sep 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions src/facet/inspection/_explainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def make_explainer(
"""
Construct a new :class:`~shap.Explainer` to compute shap values.

:param model: learner for which to compute shap values
:param model: fitted learner for which to compute shap values
:param data: background dataset (optional)
:return: the new explainer object
"""
Expand Down Expand Up @@ -147,13 +147,7 @@ def uses_background_dataset(self) -> bool:
def make_explainer(
self, model: LearnerDF, data: Optional[pd.DataFrame] = None
) -> Explainer:
"""
Construct a new :class:`~shap.TreeExplainer` to compute shap values.

:param model: learner for which to compute shap values
:param data: background dataset (optional)
:return: the new explainer object
"""
"""[see superclass]"""

self._validate_background_dataset(data=data)

Expand All @@ -176,7 +170,7 @@ def make_explainer(
return explainer


# @inheritdoc(match="[see superclass]")
@inheritdoc(match="[see superclass]")
class KernelExplainerFactory(ExplainerFactory):
"""
A factory constructing class:`~shap.KernelExplainer` objects.
Expand Down Expand Up @@ -219,13 +213,7 @@ def uses_background_dataset(self) -> bool:
return True

def make_explainer(self, model: LearnerDF, data: pd.DataFrame) -> Explainer:
"""
Construct a new :class:`~shap.KernelExplainer` to compute shap values.

:param model: learner for which to compute shap values
:param data: background dataset
:return: the new explainer object
"""
"""[see superclass]"""

self._validate_background_dataset(data=data)

Expand Down
2 changes: 1 addition & 1 deletion src/facet/selection/_selection.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def __init__(
:param scoring: a scorer to use when doing CV within GridSearch, defaults to \
``None``
:param ranking_scorer: a function to calculate a scalar score for every \
crossfit, taking a :class:`.CrossfitScore` and returning a float. \
crossfit, taking a :class:`.CrossfitScores` and returning a float. \
The resulting score is used to rank all crossfits (highest score is best). \
Defaults to :meth:`.default_ranking_scorer`, calculating \
`mean(scores) - 2 * std(scores)`.
Expand Down
4 changes: 2 additions & 2 deletions src/facet/validation/_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def split(
:param X: features
:param y: target
:param groups: not used
:return a generator yielding `(train, test)` tuples where train and test are \
:return: a generator yielding `(train, test)` tuples where train and test are \
numpy arrays with train/test indices
"""

Expand Down Expand Up @@ -302,7 +302,7 @@ def split(
:param X: features
:param y: target
:param groups: not used
:return a generator yielding `(train, test)` tuples where train and test are \
:return: a generator yielding `(train, test)` tuples where train and test are \
numpy arrays with train/test indices
"""
indices = np.arange(len(X))
Expand Down