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

TargetByFeaturesTable does not save with JSON #1402

Open
ManavToor opened this issue Dec 19, 2024 · 0 comments
Open

TargetByFeaturesTable does not save with JSON #1402

ManavToor opened this issue Dec 19, 2024 · 0 comments

Comments

@ManavToor
Copy link

ManavToor commented Dec 19, 2024

When using TargetDriftPreset, the Target (Prediction) Behavior By Feature metric does not appear when saving report as html or json.

report = Report(metrics=[TargetDriftPreset()])
report.run(current_data=cur, reference_data=ref, column_mapping=column_mapping)
report.save_html('report.html')
report_json = report.json()

It seems to be the Aggregated visuals in plots feature that removes it. I'm aware the feature is suppose to reduce the size of the raw data, but is it suppose to remove the metric completely? When passing, raw_data=True, the html report shows the metric, but the JSON is still returning an empty dictionary. I also tried setting include_render=True for the save json method.

from evidently.options.agg_data import RenderOptions 
render = RenderOptions(raw_data=True)
report = Report(metrics=[TargetDriftPreset()], options=[render])
report.run(current_data=cur, reference_data=ref, column_mapping=column_mapping)
report_json = json.loads(report.json(include_render=True))
print(report_json['metrics'][4])

OUT:

{'metric': 'TargetByFeaturesTable', 'result': {}}

EDIT: Passing the TargetByFeaturesTable as an include parameter as follows seemed to work:

report_json = json.loads(report.json(include={'TargetByFeaturesTable': {'reference', 'current'}}))

It would still be nice to have the metric show up on its own instead of having to manually include it.

Evidently: 0.4.40
Python: 3.12.7

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

1 participant