0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

watsonx.governanceのmetricsで閾値を設定する方法

Posted at

このgithubのサンプルコード。各種metricを設定して可視化できる・・が、閾値の設定方法が書かれていなかったので、メモ。
https://github.com/IBM/ibm-watsonx-gov/blob/samples/notebooks/python_sdk/model_insights/Model%20Insights.ipynb

各種メトリックススは以下で設定されているが、

metrics = [
    AveragePrecisionMetric(),
    ContextRelevanceMetric(),
    FaithfulnessMetric(),
    HitRateMetric(),
    NDCGMetric(),
    ReciprocalRankMetric(),
    RetrievalPrecisionMetric(),
    UnsuccessfulRequestsMetric(),
]

閾値は以下のように設定できる。
他のメトリックも同様に設定できる模様。

metrics = [
    ContextRelevanceMetric(method="sentence_bert_mini_lm",thresholds=[MetricThreshold(type="lower_limit", value=0.1)]),
]

なお、初期値はtype=lower_limit, value=0.8になっている。
upper_limitも設定できる。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?