Help us understand the problem. What is going on with this article?

DeepChemのマルチタスク学習においてタスク毎の評価スコアをゲットする

はじめに

DeepChemでマルチタスク学習をさせた時に、deepchem.models.Modelクラスのevaluateメソッドでは各タスクのスコアの平均が得られる。しかし、それぞれのタスクのスコアがどうなったのかが知りたいのが人情である。今回その方法を調べてたのでメモっておく。

環境

  • python 3.6
  • deepchem 2.2.1.dev54
  • rdkit 2019.03.3.0

方法

evaluateメソッドを実行する際にper_task_metrics=Trueを指定すればいいだけ。
そうすると二番目の戻り値として、タスク毎のスコア得られる。

validation_score, validation_par_task_score = model.evaluate(validation_set, metrics, transformers, per_task_metrics=True)
print(validation_par_task_score)

例えば評価指標がroc_aucでタスクが9つある場合、以下のような形式で各タスクのroc_aucが得られる。

{'mean-roc_auc_score': array([0.77601105, 0.80917502, 0.85473596, 0.8459161 , 0.73406951,
       0.77492466, 0.65670436, 0.7812783 , 0.80639215])}

おわりに

DeepChem は、最初はとっつきにくいが、色々試行錯誤すればそれなりにやりたいことができるようになる奥が深いライブラリだ。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away