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

RegressionPerfomanceTab not working ! #43

Closed
pratikchhapolika opened this issue Aug 9, 2021 · 3 comments
Closed

RegressionPerfomanceTab not working ! #43

pratikchhapolika opened this issue Aug 9, 2021 · 3 comments

Comments

@pratikchhapolika
Copy link

pratikchhapolika commented Aug 9, 2021

regression_model_performance = Dashboard(tabs=[RegressionPerfomanceTab]) 
regression_model_performance.calculate(reference_data, current_data, column_mapping = column_mapping) 

NameError Traceback (most recent call last)
/usr/local/bin/kernel-launchers/python/scripts/launch_ipykernel.py in
----> 1 regression_model_performance = Dashboard(tabs=[RegressionPerfomanceTab])
2 regression_model_performance.calculate(reference_data, current_data, column_mapping = column_mapping)

NameError: name 'RegressionPerfomanceTab' is not defined


**Second part**

iris_data_and_target_drift_report = Dashboard(tabs=[DataDriftTab, CatTargetDriftTab])
iris_data_and_target_drift_report.calculate(iris_frame[:100], iris_frame[100:], column_mapping = None)
iris_data_and_target_drift_report.save("reports/my_report_with_2_tabs.html")



---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/usr/local/bin/kernel-launchers/python/scripts/launch_ipykernel.py in <module>
      1 iris_data_and_target_drift_report = Dashboard(tabs=[DataDriftTab, CatTargetDriftTab])
      2 iris_data_and_target_drift_report.calculate(iris_frame[:100], iris_frame[100:], column_mapping = None)
----> 3 iris_data_and_target_drift_report.save("reports/my_report_with_2_tabs.html")

~/.local/lib/python3.6/site-packages/evidently/dashboard/dashboard.py in save(self, filename)
    182             os.makedirs(parent_dir, exist_ok=True)
    183         f = open(filename, 'w')
--> 184         f.write(self.html())
    185         # f.write(self.__render(file_html_template))

~/.local/lib/python3.6/site-packages/evidently/dashboard/dashboard.py in html(self)
    175 
    176     def html(self):
--> 177         return self.__render(file_html_template)
    178 
    179     def save(self, filename):

~/.local/lib/python3.6/site-packages/evidently/dashboard/dashboard.py in __render(self, template)
    146     def __render(self, template: typing.Callable[[TemplateParams], str]):
    147         dashboard_id = "evidently_dashboard_" + str(uuid.uuid4()).replace("-", "")
--> 148         tab_widgets = [t.info() for t in self.tabsData]
    149 
    150         di = DashboardInfo(dashboard_id, [item for tab in tab_widgets for item in tab if item is not None])

~/.local/lib/python3.6/site-packages/evidently/dashboard/dashboard.py in <listcomp>(.0)
    146     def __render(self, template: typing.Callable[[TemplateParams], str]):
    147         dashboard_id = "evidently_dashboard_" + str(uuid.uuid4()).replace("-", "")
--> 148         tab_widgets = [t.info() for t in self.tabsData]
    149 
    150         di = DashboardInfo(dashboard_id, [item for tab in tab_widgets for item in tab if item is not None])

~/.local/lib/python3.6/site-packages/evidently/tabs/base_tab.py in info(self)
     31 
     32     def info(self) -> List[BaseWidgetInfo]:
---> 33         return [w.get_info() for w in self.widgets]
     34 
     35     @abc.abstractmethod

~/.local/lib/python3.6/site-packages/evidently/tabs/base_tab.py in <listcomp>(.0)
     31 
     32     def info(self) -> List[BaseWidgetInfo]:
---> 33         return [w.get_info() for w in self.widgets]
     34 
     35     @abc.abstractmethod

~/.local/lib/python3.6/site-packages/evidently/widgets/cat_target_pred_feature_table_widget.py in get_info(self)
     31         if self.wi:
     32             return self.wi
---> 33         raise ValueError("neither target nor prediction data provided")
     34 
     35     def calculate(self,

ValueError: neither target nor prediction data provided
@emeli-dral
Copy link
Contributor

Hi @pratikchhapolika !

The reason of this error is a misspelling in the Tab name. Instead of the “RegressionPerfomanceTab” there should be the “RegressionPerformanceTab”. I believe if you fix the name everything will be fine.

p.s. It is also important to make sure, that you imported this Tab earlier in your code correctly:
‘’’from evidently.tabs import RegressionPerformanceTab’’’
Here is an example of regression model analysis: https://github.com/evidentlyai/evidently/blob/main/evidently/examples/bike_sharing_demand_regression_performance.ipynb

@emeli-dral
Copy link
Contributor

The second part looks like you do not have either target or prediction (or both). To evaluate Categorical Target Drift it is necessary to have one of the target or prediction columns presented in both reference and current datasets. And if you do not provide the column mapping, then target column is expected to called ‘target’, prediction columns is expected to called ‘prediction’. It looks like you might fix the second issue by adding target column to your dataframes, for example like this:
‘’’iris_frame['target'] = iris.target’’’

Hope it will help!
If you share the structure of your dataframes I will be more specific with the solution.

@pratikchhapolika
Copy link
Author

Closing this issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants