How to use

OceanUI is a system that uses the OCEAN to generate counterfactuals explanations, but allowing a "walkthrough" in this process. The idea of ​​this system is to use graphics to study and understand possible counterfactuals and, with that, build a personalized counterfactual.

At first, we have the interface below. In it, we can select a dataset to work on using the combobox.

cleanInterface

When selecting a dataset, all its features will be displayed in a list with some information. Such features can be binary, categorical, discrete numeric, or continuous numeric so that a corresponding component will be added to the list depending on the type of feature. Besides that, we have a graph stating the importance of each feature to the prediction model used for class prediction and counterfactual calculation. It is noteworthy that the One-Hot-Encoding is used to transform training data, so we can see that some importance chart labels follow the "FeatureName_value" nomenclature.

selectedDataset

Once a dataset has been selected, we can use the "Random Point" option to fill the list components with values ​​from a random point of the dataset whose class is "0" or manually fill each one. If we go to manual filling, then we can better observe each of the possible components mentioned above.

In the component for binary features, we have only two possible values, so only one can be selected.

binaryComponent

In the component for categorical features, we have a combobox to select the desired value and a list on the right side that informs all available values. With this list, it is possible to mark which values ​​are allowed for the counterfactual and which are not; in this way, the counterfactual generated will not have any of the values ​​suggesting a change to a non-allowed value.

categoricalComponent

In the component for numerical features, we have a slider with three ranges to inform the upper and lower bounds and the desired value; it is also possible to adjust these limits using the spinboxes just below the respective ranges.

numericalComponent

Once the components are filled, we can use the option "Calculate Class" to get the corresponding class, and then we use the option "Next" to create the next scenario of iterative counterfactual generation.

selectedPoint

If the constraints are too restrictive, the OCEAN can not find a counterfactual; in this case, the OceanUI will show a message informing that.

counterfactualError

Otherwise the new scenario will be created. In this new scenario ("Scenario1"), we have a parallel coordinate chart, where each axis corresponds to a feature of the dataset except for the first axis, which corresponds to the class of each point, one referring to the chosen point in "Scenario0", another referring to the current point (since there has been no change in the current point values, the current point is equal to the point of "Scenario0") and the last one referring to a suggested counterfactual. Among these three, only the current point can be edited by clicking on the dot over the axis we want to change and then pulling it up or down. This graph starts with the features that were suggested to be changed by the counterfactual, but it is possible to add more or remove them from the graph using the combobox under "Select Features To Plot."

scenario1Initial

As said above, other features can be added or removed from the graph, and the current point values ​​can be changed (see the axis of the "health" feature). By clicking on a value (on one of the editable axes) of the current point, we can see on the right side the distribution of the clicked feature's data and also the associated component; in it, we can change the restrictions on the feature (the suggested counterfactual will only feel the change in the next scenario - see component of feature Mjob). While we are working on selecting features or on the restrictions on some features, the graph is updated.

scenario1Changed

After that, if the current point is placed in a value outside the allowed values, the corresponding axis will be changed to red to highlight this misunderstood. This behavior happens in all components if the value contradicts the respective constraints.

scenario1Contradictory

Finished studying "Scenario1", we use the option "Next" to create a new scenario. In this scenario, we can see the points referring to "Scenario0", the current, and the counterfactual, and we also have a point referring to the previous scenario to follow the "walk" to our counterfactual. Having changed some values again, we see that the current point has changed its color to indicate that we have reached the desired class. That way, we can then finish the search for the custom counterfactual by clicking on the option "Finish."

scenario2

By clicking on the option "Finish," we then have a parallel between the values ​​of "Scenario0" and the last scenario, where all values ​​different from each other are indicated with a blue background to facilitate identification.

finalScenario

With that, we conclude the presentation of the OceanUI.