Skip to content

Apply changes from juan5508/sc-3259/Create-Metric-V2-class #1

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

Merged
merged 33 commits into from
Mar 8, 2024

Conversation

nrichers
Copy link
Collaborator

@nrichers nrichers commented Feb 26, 2024

Internal Notes for Reviewers

This PR transfers the changes from @juanmleng's private branch to our public open-source repository.

External Release Notes

This pull request introduces the Unit Metric feature, a new single value measure designed to streamline the risk assessment process in Machine Learning and AI model development. The Unit Metric simplifies complex evidence into actionable insights, allowing for efficient monitoring and comparison of risks across different models or datasets.

Example:

metric_id = "validmind.unit_metrics.sklearn.classification.F1"

inputs = {
    "model": vm_model,
    "dataset": vm_test_ds
}

result = vm.unit_metrics.run_metric(
    metric_id=metric_id, 
    inputs=inputs,
)
result.value
>>> 0.5709401709401709
result.summary
>>> {'f1': 0.5709401709401709}

Changes

  • Implemented the UnitMetric class.
  • Implemented sklearn classification metrics as unit metrics: F1, Accuracy, Precision, Recall and ROC_AUC
  • Added vm.unit_metrics.run_metric to the ValidMind client library to support running metrics.

Testing

  • Provided a notebook on defining, executing, and extracting results from Unit Metrics using a customer churn use case. See run_unit_metrics.ipynb

@nrichers nrichers added the enhancement New feature or request label Feb 26, 2024
Copy link

This pull request has been linked to Shortcut Story #3259: UnitMetric class POC.

Copy link
Contributor

Pull requests must include a description in the release notes section.

1 similar comment
Copy link
Contributor

Pull requests must include a description in the release notes section.

@nrichers nrichers force-pushed the juan5508/sc-3259/Create-Metric-V2-class branch from 226db0f to 6dd9218 Compare February 27, 2024 00:04
@CLAassistant
Copy link

CLAassistant commented Feb 27, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Pull requests must include a description in the release notes section.

Copy link
Contributor

Pull requests must include a description in the release notes section.

Copy link
Contributor

github-actions bot commented Mar 7, 2024

Pull requests must include a description in the release notes section.

@juanmleng juanmleng requested a review from cachafla March 7, 2024 21:41
@juanmleng juanmleng requested a review from cachafla March 8, 2024 14:25
Copy link
Contributor

@cachafla cachafla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job 👏 I left a final comment to remove unused object keys. Other than that it's ready to go 🚀

@nrichers
Copy link
Collaborator Author

nrichers commented Mar 8, 2024

@juanmleng looks like Andres approved your pull request. Congratulations on making the very first contribution to our developer framework as open-source software. This will forever be pull request #1 in this repository! 🙌

@juanmleng juanmleng merged commit 6771e79 into main Mar 8, 2024
@johnwalz97 johnwalz97 deleted the juan5508/sc-3259/Create-Metric-V2-class branch June 3, 2024 17:50
cachafla pushed a commit that referenced this pull request Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants