Skip to content

Computes the Bhattacharyya distance for feature selection in machine learning.

License

Notifications You must be signed in to change notification settings

lchmo444/bhattacharyya-distance

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bhattacharyya-distance

Computes the Bhattacharyya distance for feature selection in machine learning.

The function accepts discrete data and is not limited to a particular probability distribution (eg. a normal Gaussian distribution). Included are four different methods of calculating the Bhattacharyya coefficient--in most cases I recommend using the 'continuous' method.

Contents

  • bhatta_dist.py - Contains functions for calculating Bhattacharyya distance.
  • iris_example.py - Usage example
  • bhatta_test.py - Verification of the calculations in bhatta_dist()

Notes

In it's current form, the function can only accept one feature at at time, and can only compare two classes. Use multiple function calls to analyze multiple features and multiple classes.

It is not necessary to apply any scaling or normalization to your data before using this function. However, other forms of preprocessing that might alter the class separation within the feature should be applied prior.

About

Computes the Bhattacharyya distance for feature selection in machine learning.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%