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

RegressionPerformanceTab - categorical columns not supported #207

Closed
iuiu34 opened this issue Apr 26, 2022 · 2 comments
Closed

RegressionPerformanceTab - categorical columns not supported #207

iuiu34 opened this issue Apr 26, 2022 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@iuiu34
Copy link

iuiu34 commented Apr 26, 2022

Documentation link says it supports categorical columns.
But the following code

import pandas as pd
from evidently import ColumnMapping
from evidently.dashboard import Dashboard
from evidently.dashboard.tabs import (
    RegressionPerformanceTab
)
from sklearn import datasets

iris = datasets.load_iris()
iris_frame = pd.DataFrame(iris.data, columns=iris.feature_names)
iris_frame['target'] = iris.target
iris_frame['prediction'] = iris.target + 0.1
column_mapping = ColumnMapping(target='target', prediction='prediction')
# first column as string
iris_frame['sepal length (cm)'] = iris_frame['sepal length (cm)'].apply(lambda x: f"value_str_{x}")

iris_data_drift_report = Dashboard(tabs=[RegressionPerformanceTab()])
iris_data_drift_report.calculate(iris_frame[:100], iris_frame[100:], column_mapping=column_mapping)

raises error

  File "C:\...\lib\site-packages\evidently\analyzers\regression_performance_analyzer.py", line 234, in _error_cat_feature_bias
    majority=float(ref_overal_value),
ValueError: could not convert string to float: 'value_str_value_str_5.0'
@emeli-dral emeli-dral added the bug Something isn't working label Apr 29, 2022
@emeli-dral
Copy link
Contributor

Hi @iuiu34 ,
thank you for reporting this! Categorical columns are meant to be supported in all Dashboards. We add this fix to the closest release.

@0lgaF
Copy link
Contributor

0lgaF commented Aug 3, 2022

Hi @iuiu34 !
Thanks for pointing this out!
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

4 participants