captum icon indicating copy to clipboard operation
captum copied to clipboard

VisualizationDataRecord with a regression task?

Open RylanSchaeffer opened this issue 4 years ago • 5 comments

I'm fine-tuning BERT (using the Transformers library) to perform a regression task and I can successfully extract the attributions. However, how am I supposed to visualize the importance of different words using VisualizationDataRecord?

Its arguments seem to require at least three "classes" in the context of classification and a pred_prob, none of which I have.

        word_attributions,
        pred_prob,
        pred_class,
        true_class,
        attr_class,
        attr_score,
        raw_input,
        convergence_score,

RylanSchaeffer avatar Oct 06 '21 16:10 RylanSchaeffer

As an aside, if the VisualizationDataRecord is designed for classification, shouldn't it be called ClassificationVisualizationDataRecord?

RylanSchaeffer avatar Oct 06 '21 16:10 RylanSchaeffer

Another question: Can the documentation for VisualizationDataRecord be improved? For instance, what is attr_score or attr_class?

RylanSchaeffer avatar Oct 06 '21 16:10 RylanSchaeffer

The regression tutorial (https://captum.ai/tutorials/House_Prices_Regression_Interpret) doesn't seem to use the VisualizationDataRecord. Is there another regression tutorial which does?

RylanSchaeffer avatar Oct 06 '21 16:10 RylanSchaeffer

VisualizationDataRecord is only for text, @RylanSchaeffer ! I hope that you were able to visualize it with custom visualization UI. Can we close this issue ?

NarineK avatar Dec 04 '21 01:12 NarineK

I am trying to visualize text. I think you might have misunderstood my question

RylanSchaeffer avatar Dec 04 '21 01:12 RylanSchaeffer