From 05df472c0615dbebd69d45957028695824cf5820 Mon Sep 17 00:00:00 2001 From: Kyosuke Morita Date: Wed, 26 Jul 2023 23:26:06 +0100 Subject: [PATCH] format core.py --- cfxplorer/focus/core.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cfxplorer/focus/core.py b/cfxplorer/focus/core.py index 06a93c5..78f4160 100644 --- a/cfxplorer/focus/core.py +++ b/cfxplorer/focus/core.py @@ -67,12 +67,12 @@ class Focus: Examples -------- - - Initialize FOCUS with default parameters + - Initialize FOCUS on default parameters - Generate counterfactual explanations - cfxplorer = Focus() + focus = Focus() - cfe_features = cfxplorer.generate(model, X) + cfe_features = focus.generate(model, X) """ def __init__( @@ -475,16 +475,16 @@ def filter_hinge_loss( Calculates the filtered probabilities of each data point for the given model. Args: - - n_class (int): Number of classes. - - mask_vector (np.ndarray): A boolean mask indicating which data points should be considered. - - X (tf.Tensor): The feature input for the model. - - sigma (float): The value of sigma for computing the probabilities. - - temperature (float): The temperature to be used for the softmax function. - - model: The machine learning model; + n_class (int): Number of classes. + mask_vector (np.ndarray): A boolean mask indicating which data points should be considered. + X (tf.Tensor): The feature input for the model. + sigma (float): The value of sigma for computing the probabilities. + temperature (float): The temperature to be used for the softmax function. + model: The machine learning model; e.g., DecisionTreeClassifier, RandomForestClassifier, AdaBoostClassifier. Returns: - - hinge_loss (tf.Tensor): The filtered probabilities of each data point. + hinge_loss (tf.Tensor): The filtered probabilities of each data point. """ n_input = X.shape[0]