Skip to content

Commit

Permalink
Fix Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
achamma723 committed Jul 12, 2024
1 parent 79b1fe5 commit 9131ebb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 6 additions & 2 deletions hidimstat/importance_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def compute_loco(X, y, ntree=100, problem_type="regression", use_dnn=True, seed=
)

loss_full = -np.sum(
y_test * np.log(clf_rf_full.predict_proba(X.iloc[test_ind, :]) + 1e-100), axis=1
y_test * np.log(clf_rf_full.predict_proba(X.iloc[test_ind, :]) + 1e-100),
axis=1,
)

# Retrain model
Expand Down Expand Up @@ -107,7 +108,10 @@ def compute_loco(X, y, ntree=100, problem_type="regression", use_dnn=True, seed=
) ** 2
else:
loss_retrain = np.sum(
y_test * np.log(clf_rf_retrain.predict_proba(X_minus_idx[test_ind, :]) + 1e-100),
y_test
* np.log(
clf_rf_retrain.predict_proba(X_minus_idx[test_ind, :]) + 1e-100
),
axis=1,
)
delta = loss_retrain - loss_full
Expand Down
4 changes: 3 additions & 1 deletion hidimstat/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,9 @@ class DNN(nn.Module):
Feedfoward Neural Network with 4 hidden layers
"""

def __init__(self, input_dim, group_stacking, list_grps, output_dimension, problem_type):
def __init__(
self, input_dim, group_stacking, list_grps, output_dimension, problem_type
):
super().__init__()
if problem_type == "classification":
self.accuracy = Accuracy(task="multiclass", num_classes=output_dimension)

Check warning on line 510 in hidimstat/utils.py

View check run for this annotation

Codecov / codecov/patch

hidimstat/utils.py#L510

Added line #L510 was not covered by tests
Expand Down

0 comments on commit 9131ebb

Please sign in to comment.