Feature importance analysis by accumulated local effects (ALE) in photoacoustic oximetry by learned spectral decoloring (LSD).
Based on numpy
and matplotllib.pyplot
we implemented a method of determining the impact a feature (i.e. an illumination wavelength) has on the decision process of machine learning regressors in learned spectral decoloring (LDS) and multiple illumination learned spectral decoloring (MI-LSD). The implementation is particularly suited for histogram-based gradient boosters (LightGBM, XGBoost, sklearn), because they are usually not too computationally expensive. Using our method of determining a feature's importance, we were able to demonstrate that the absolute prediction errors remain almost unchanged when more than half of the initially available features/wavelengths are removed (i.e. only the 8 or even 6 most important instead of all 16 illumination wavelengths are used for training). Our method also compares to the current approach of uniformally removing features/wavelengths while maintaining the wavelength span width as large as possible [3].
ale.py
contains theAccumulatedLocalEffects()
class.examples.ipynb
contains some basic examples based on an example data set stored in the folderdata/
.plots.ipynb
can be used to reproduce all plots displayed in the thesis.
All rCu data is available at
The following examples serf to briefly demonstrate the most important methods included in the AccumulatedLocalEffects()
class:
Obtain an ordered list of your features, sorted according to ascending importance in the decision making progress of your regressor.
feature_importance = array([5, 1, 14, 4, 13, 9, 12, 6, 8, 11, 7, 3, 10, 2, 15, 0])
This plot shows the accumulated local effects (ALE) function [2] for each wavelength and one illumination position.
... or for multiple illumination positions.
This plot displays the progression of the absolute error while sequentially excluding a feature from the training process according to some criterion, e.g. with the clipping orders 'state_of_the_art'
[3] (features clipped uniformally), 'min_ALE'
(features clipped according to the feature importances, determined by the total variation [4] of the ALE functions), and 'updated_min_ALE'
(least important feature in every round is removed).
... and now for MI-LSD, with different clipping orders: 'alternating'
(first remove even, then odd feature indices), 'random'
(random clipping order), and 'custom'
(order is passed via the ordered_indices parameter).
[1] T. Kirchner and M. Frenz (2021). "Quantitative photoacoustic oximetry imaging by multiple illumination learned spectral decoloring". arXiv:2102.11201v1
[2] D. W. Apley and J. Zhu (2019). "Visualizing the Effects of Predictor Variables in Black Box Supervised Learning Models". arXiv:1612.08468v2
[3] G. P. Luke, S. Y. Nam, and S. Y. Emelianov (2013). “Optical wavelength selection for improved spectroscopic photoacoustic imaging”. https://doi.org/10.1016/j.pacs.2013.08.001
[4] B. I. Golubov and A. G. Vitushkin (2001). "Variation of a function". Encyclopedia of Mathematics, EMS Press.