timeseriesAI / tsai

Time series Timeseries Deep Learning Machine Learning Python Pytorch fastai | State-of-the-art Deep Learning library for Time Series and Sequences in Pytorch / fastai
https://timeseriesai.github.io/tsai/
Apache License 2.0
5.21k stars 651 forks source link

error in permutation feature importance result (ablation method) #630

Closed Jalagarto closed 1 year ago

Jalagarto commented 1 year ago

Just one small error I found

https://github.com/timeseriesAI/tsai/blob/main/tsai/analysis.py#L132

'ablation' feature importance sometimes show wrong wrong accuracy_change sign and therefore wrong order. 'accuracy_change' needs sometimes to be multiplied by -1, but not always. then sorted again by accuracy change, so its results are similar to 'permutation method' results

Thanks for the great work!

PD: Could you confirm that the most important features will be those with a lower value on its accuracy result? (since higher accuracy is better, so low accuracy when not using this feature means this feature was important).

Jalagarto commented 1 year ago

Actually I haven't been able to reproduce it and it is working perfectly now. So mb I was mistaken