Coder Social home page Coder Social logo

friedman-rafsky-test's Introduction

friedman-rafsky-test

Distribution-based non-parametric similarity measure for multi-dimensional datasets

Introduction

Easy-to-use Perl implementation of the Friedman Rafsky Test as described in

EL Saddik, Abdulmotaleb; Vuong, Son; Griwodz, Carsten; Del Bimbo, Alberto; Candan, K. Selcuk; Jaimes, Alejandro et al. (2008): Distribution-based similarity measures for multi-dimensional point set retrieval applications. In: Proceeding of the 16th ACM international conference on Multimedia - MM '08: ACM Press, S. 429.

The code is written into a single script file called fr_test.pl and consists of a workflow with 5 steps:

  • Compute distance matrix,
  • Create minimal spanning tree MST using Prim Algorithm
  • Compute number of runs
  • Compute mean, variance, permutation parameter and quantity W
  • Compute similarity measure

Demo

Two example datasets dataset_a.txt and dataset_b.txt are located in the same directory as the actual script. An examplary similarity score can be computed via the command

./fr_test.pl dataset_a.txt dataset_b.txt 1 -1

Perl dependencies

Statistics::Distributions
List::Util qw(sum)

Input

The input takes two tab-delimited flat files (matrices l x n and m x n) with n attributes, followed by two flags {-1,1}. The first flag denotes whether the files contain headers, the second denotes whether to print the distance table or not.

Example:

path/to/fr_test.pl path/to/dataset1.txt  path/to/dataset2.txt 1 1

Output

Similarity score is in the interval of [0,1]. A score of 1 denotes the highest similarity.

Example:

Total weight of MST: 25528.1492793117
Number of FR-Runs: 38
FR-Permutation parameter C: 130
FR-Variance: 24.5808601478705
FR-Mean: 51
FR-Quantity W: -2.62207321631284
Datasets 'A' and 'B' have a similarity score of 0.436999999999999

friedman-rafsky-test's People

Contributors

matmu avatar

Stargazers

 avatar  avatar  avatar

Watchers

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