Skip to content

Commit

Permalink
edit python-package-conda.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
kyosek committed Jul 15, 2023
1 parent 405619c commit 8f76c40
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 127
2 changes: 1 addition & 1 deletion .github/workflows/python-package-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
run: |
conda install flake8
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Black formatting
Expand Down
11 changes: 4 additions & 7 deletions focus/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Focus:
Parameters
----------
distance_function: str, optional (default="euclidean")
Distance function - one of
Distance function - one of followings;
- "euclidean"
- "cosine"
- "l1"
Expand Down Expand Up @@ -63,8 +63,7 @@ class Focus:
---------
Lucic, A., Oosterhuis, H., Haned, H., & de Rijke, M. (2022, June).
FOCUS: Flexible optimizable counterfactual explanations for tree ensembles.
In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 36,
No. 5, pp. 5313-5322).
In Proceedings of the AAAI Conference on Artificial Intelligence (Vol. 36, No. 5, pp. 5313-5322).
Examples
--------
Expand Down Expand Up @@ -125,11 +124,9 @@ def generate(self, model, X, x_train=None):
This method generates counterfactual explanations for the
predictions made by a tree-based model.
It uses the gradient descent method to optimize the input features
based on a combination of hinge loss, approximate probability and
a distance term.
based on a combination of hinge loss, approximate probability and a distance term.
The `model` should be an instance of a tree-based model,
such as DecisionTreeClassifier, RandomForestClassifier or
AdaBoostClassifier.
such as DecisionTreeClassifier, RandomForestClassifier or AdaBoostClassifier.
The `X` parameter represents the input features for which
counterfactual explanations are desired.
The `x_train` parameter is an optional argument that
Expand Down

0 comments on commit 8f76c40

Please sign in to comment.