Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String categorical features causes error in "Error Bias Predicted vs Actual" visualization #265

Closed
frtendero opened this issue Jul 8, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@frtendero
Copy link

frtendero commented Jul 8, 2022

I have a dataset with some string categorical features. When generating regression performance report, I'm encountering the following error with the "Predicted vs Actual" scatter plot:

ValueError:
    Invalid value of type 'builtins.str' received for the 'cmax' property of scatter.marker       
        Received value: 'mycategoricalvalue'

    The 'cmax' property is a number and may be specified as:
      - An int or float

Root of the error is in the creation of the scatter plot segment_fig for categorical features, at site-packages\evidently\dashboard\widgets\reg_underperform_segments_table_widget.py", line 211, in calculate, which tries to create a color bar, which could make sense if categorical variable is ordinal, but not for this case.

A potential fix creating the figure for string feature types as follows:

segment_fig = px.scatter(
    merged_data,
    x=target_name,
    y=prediction_name,
    color=feature_name,
    facet_col='dataset',
)

merged_data is already created (from error bias histogram plot) and contains dataset column to make distinction of 'reference' / 'current' dataset.

This modification would result in:

image

@emeli-dral emeli-dral added the bug Something isn't working label Jul 15, 2022
@0lgaF
Copy link
Contributor

0lgaF commented Aug 3, 2022

Hi @frtendero !
Thanks for reporting!
The bug is fixed. 👩‍🔧 The update will be published in the next release.
#291

@0lgaF 0lgaF closed this as completed Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants