[Python] Why is base value in shap score plot different for different inputs?

Discussão em 'Python' iniciado por Stack, Novembro 23, 2024.

  1. Stack

    Stack Membro Participativo

    I am trying to implement shap score from shap python package following the example in the same link.


    data['text'][:3] gives me tbree examples:

    ['i didnt feel humiliated', 'i can go from feeling so hopeless to so damned hopeful just from being around someone who cares and is awake', 'im grabbing a minute to post i feel greedy wrong']
    ​

    I run the said emotion classifier and get the shap plots:

    [​IMG]

    My question is given I have selected "sadness" class in all 3 plots, why is the base value different in all 3 plots?

    I wanted to understand how base value is obtained and went through following links:

    1. https://datascience.stackexchange.c...w-is-the-base-value-of-shap-values-calculated
    2. https://medium.com/@makcedward/shap-will-provide-both-base-value-and-output-value-bfe2339edd44

    My understanding is base value (for a given class) is the average prediction score for that class across all training samples. Now, given that, should it be not same across the 3 test samples I have shown in image, as training data is fixed for model.

    I want to understand why the base values are different here. Thanks!

    Continue reading...

Compartilhe esta Página