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

Add custom callable metric #934

Merged
merged 2 commits into from
Jan 10, 2024
Merged

Add custom callable metric #934

merged 2 commits into from
Jan 10, 2024

Conversation

mike0sv
Copy link
Collaborator

@mike0sv mike0sv commented Dec 29, 2023

import pandas as pd

from evidently.base_metric import InputData
from evidently.metrics.custom_metric import CustomCallableMetric
from evidently.report import Report


def func(data: InputData):
    return .5


def main():
    report = Report(metrics=[CustomCallableMetric(func=func, title="kek")])

    data = pd.DataFrame({"a": [1, 2, 3]})
    report.run(reference_data=data, current_data=data)

    report.save_html("CustomCallableMetric.html")
    report.to_snapshot().save("CustomCallableMetric.json")


if __name__ == '__main__':
    main()

@emeli-dral emeli-dral merged commit ccade89 into main Jan 10, 2024
24 checks passed
@emeli-dral emeli-dral deleted the feature/custom-callable-metric branch January 10, 2024 14:12
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

Successfully merging this pull request may close these issues.

2 participants