GithubHelp home page GithubHelp logo

lkampoli / ale-lsd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fmatti/ale-lsd

0.0 0.0 0.0 68.96 MB

Feature importance analysis by accumulated local effects (ALE) in photoacoustic oximetry by learned spectral decoloring (LSD).

License: BSD 3-Clause "New" or "Revised" License

Python 5.34% Jupyter Notebook 94.66%

ale-lsd's Introduction

ALE-LSD

Feature importance analysis by accumulated local effects (ALE) in photoacoustic oximetry by learned spectral decoloring (LSD).

Summary

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].

File structure

  • ale.py contains the AccumulatedLocalEffects() class.
  • examples.ipynb contains some basic examples based on an example data set stored in the folder data/.
  • plots.ipynb can be used to reproduce all plots displayed in the thesis.

Data

All rCu data is available at

DOI

Examples

The following examples serf to briefly demonstrate the most important methods included in the AccumulatedLocalEffects() class:

Feature importance indices

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])

Plot the ALE function

This plot shows the accumulated local effects (ALE) function [2] for each wavelength and one illumination position.

ALE_function example

... or for multiple illumination positions.

ALE_function example MI-LSD

Plot the progression of the absolute errors by 'clipping features'

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).

feature clipping example

... 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).

feature clipping example MI-LSD

References

[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.

ale-lsd's People

Contributors

fmatti avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.