javaAnchorExplainer icon indicating copy to clipboard operation
javaAnchorExplainer copied to clipboard

Limited Results, Low Coverage

Open KuzonFyre opened this issue 11 months ago • 4 comments

I am using this with Anchors Adapter and my implementation is similar to the titanic dataset located in https://github.com/viadee/xai_examples/tree/master for the titanic dataset. My results are coming in with very low coverage. That is the first problem. What does this suggest about my data? Or is there a problem with how I encoded it?

IF *FeatureName* 1.0 {1, -0.98}
THEN PREDICT 0
WITH PRECISION 1 AND COVERAGE 0.02

A few details here, this is running in a streaming application. Data comes in by the line and I run data preprocessing on it. In order to get and explanation, I am forced to convert it to a TabularInstance along with discresionized version of the data. Here is a method I created.

        ArrayList<GenericColumn> anchorFeatures = new ArrayList<>();
        for (Field field : Prediction.class.getDeclaredFields()) {
            field.setAccessible(true);
            Object value = field.get(instance);
            if (value instanceof Integer) {
                anchorFeatures.add(new IntegerColumn(field.getName()));
            }else if (value instanceof Double){
                anchorFeatures.add(new DoubleColumn(field.getName()));
            }
        }
        return anchorFeatures.toArray(new GenericColumn[0]);
    }

First off it would be great that Adapters supported an easy way to convert one line of data using .build. Second, tabular.getVisualizer().visualizeResult(anchor)); is giving me an issue because IntegerColumn does set the discretionizer. I wish I could give an easy method for replicating this issue.

KuzonFyre avatar Aug 10 '23 16:08 KuzonFyre