Code Monkey home page Code Monkey logo

salientfeat's Introduction

SalientFeat

SalientFeat is a Deep Learning model for the classification of categorical data, with subsequent interpretation through the Saliency Map method (https://medium.datadriveninvestor.com/visualizing-neural-networks-using-saliency-maps-in-pytorch-289d8e244ab4): features are ordered according to the absolute value of the loss function gradient (meaning that the largest gradients correspond to the most relevant features for the predicted classification). The saliency map is calculated for each entry of each category and for each test instance, and is then plotted as an average over all test data and for each category (together with an errorbar).

Here, categorial data rely on a pseudo-NLP vocabulary that consider whether each potential value of each categorical feature is present (1) or not (0).

The script data_generator.py allows for the creation of exemplary sets of categorical data (e.g. four categories), differently labeled according to customisable rules. Data consists in combinations or letters and numbers. Four examples are provided for a classification into 2 classes, according to four different rules:

  • Example A: label 1 if 'A' in string value of category 0, label 2 otherwise. Expected average saliency map: category 0 should be revealed as the only one relevant for classification.

  • Example B: label 1 if 'B' in string value of category 1, label 2 otherwise. Expected average saliency map: category 1 should be revealed as the only one relevant for classification.

  • Example C: label 1 if 'B' in string value of category 1 or 'C' in string value of category 2, label 2 otherwise. Expected average saliency map: categories 1 and 2 should be revealed as the only ones relevant for classification.

  • Example D: label 1 if 'A' in string value of category 0 or 'B' in string value of category 1 or 'C' in string value of category 1, label 2 otherwise. Expected average saliency map: categories 0 and 1 should be revealed as the only ones relevant for classification, with the latter to be more relevant than the former.

Required Libraries

Python modules required:

Example D: average saliency map

salientfeat's People

Contributors

alescrnjar avatar

Watchers

 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.