diff --git a/hidimstat/importance_functions.py b/hidimstat/importance_functions.py index 7681434..f8fb4e8 100644 --- a/hidimstat/importance_functions.py +++ b/hidimstat/importance_functions.py @@ -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 @@ -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 diff --git a/hidimstat/utils.py b/hidimstat/utils.py index f63dad9..7995161 100644 --- a/hidimstat/utils.py +++ b/hidimstat/utils.py @@ -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)