Skip to content

Commit

Permalink
flake arg in setup.cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
aikramer2 committed May 8, 2017
1 parent 2a9e86b commit c14c224
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lime/lime_tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,8 @@ def explain_regressor_instance(self, data_row, predict_fn, num_features=10,
min_y = min(yss)
max_y = max(yss)

if not isinstance(yss, np.ndarray): raise exceptions.ModelException("Your model needs to output numpy arrays")
if not isinstance(yss, np.ndarray):
raise(ValueError("Your model needs to output numpy arrays"))

# if predictions are a single column, then either the model is a predict_proba
# with only a single class (where probabilities are all one),
Expand All @@ -404,7 +405,7 @@ def explain_regressor_instance(self, data_row, predict_fn, num_features=10,
if len(yss.shape) == 1:
pass
else:
raise exceptions.ModelException("Your regressor model is outputting arrays with {} dimensions".format(len(yss.shape)))
raise(ValueError("Your regressor model is outputting arrays with {} dimensions".format(len(yss.shape))))

yss = yss[:, np.newaxis] #add a dimension

Expand Down
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 100

0 comments on commit c14c224

Please sign in to comment.