ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

Feature Importance

Open Qiwei97 opened this issue 2 years ago • 2 comments

Hi,

Is it possible to obtain feature importance plots from the agents? Or perhaps getting it to work with the SHap library?

Thank you!

Qiwei97 avatar Mar 24 '22 02:03 Qiwei97

Yes. It is possible.

For example, see https://github.com/AI4Finance-Foundation/ElegantRL/blob/fb35e25f01c50af61fa4697824025be50b2e53f1/elegantrl/agents/AgentPPO.py#L276

The fucntion agent.update_net( ) return the training logging. The training process will print these information on the terminal.

https://github.com/AI4Finance-Foundation/ElegantRL/blob/fb35e25f01c50af61fa4697824025be50b2e53f1/elegantrl/train/evaluator.py#L79-L81

################################################################################
ID     Step    maxR |    avgR   stdR   avgS  stdS |    expR   objC   etc.
6  4.09e+03  244.72 |
6  4.09e+03  244.72 |  244.72    3.5    124     2 |    0.11   0.74   0.26   0.05
6  1.21e+05  244.72 |  239.92    0.0    105     0 |    0.29   0.18  16.41   0.09
6  1.79e+05  244.72 |  193.45    0.0     92     0 |    0.31   0.29  31.29   0.16
6  2.25e+05  325.86 |
6  2.25e+05  325.86 |  325.86    2.4    144     0 |    0.30   0.34  37.28   0.18
6  2.64e+05  325.86 |  226.47    0.0    109     0 |    0.31   0.40  38.07   0.22
6  2.99e+05  558.23 |
6  2.99e+05  558.23 |  558.23    5.6    354     0 |    0.18   0.35  44.14   0.21
6  3.31e+05  558.23 |  324.83    0.0    147     0 |    0.29   0.32  47.91   0.18
6  3.64e+05 1451.47 |
6  3.64e+05 1451.47 | 1451.47  632.2    626   272 |    0.33   0.29  45.99   0.17
6  3.94e+05 2104.08 | 2104.08   10.2   1000     0 |    0.28   0.26  45.76   0.17

Yonv1943 avatar Mar 26 '22 12:03 Yonv1943

Hi,

Thank you for the reply. I was thinking of something along the lines of this: https://towardsdatascience.com/dear-reinforcement-learning-agent-please-explain-your-actions-da6635390d4d

Will it be possible to integrate the SHap library with the agents? Or perhaps an official tutorial or demo will be good.

Qiwei97 avatar Mar 29 '22 08:03 Qiwei97