Git Product home page Git Product logo

speed-up-apss's Introduction

Speed Up All Pairs Similarity Search (APSS)

Introduction

Given a large collection of sparse vector data in a high dimensional space, the All pairs similarity search (APSS) or self-similarity join is the problem of finding all pairs of records that have a similarity score above a given threshold. Similarity between two records is defined via some similarity measure, such as the cosine similarity or the Tanimoto coefficient. APSS is a compute-intensive problem.

Problem Statement

The problem tackled in this project is called Min-πœ– Cosine π‘˜-Nearest Neighbor Graph Construction, and is defined as follows. Given a set of objects 𝐷, for each object 𝑑i in 𝐷, find the π‘˜ most similar other objects 𝑑j with cosine similarity cos(𝑑i,𝑑j) of at least πœ–. In this project, the problem must be solved exactly, i.e., all correct neighbors must be reported, along with their correct cosine similarities.

A baseline method, using IdxJoin and implemented in C, has been provided by Prof. David C. Anastasiu of CMPE department at San Jose State University (SJSU). The efficiency of the solution implemented as part of this project must be compared against IdxJoin on a variety of provided inputs (πœ–, π‘˜, datasets).

Approach and Methodology

The algorithm implemented as part of this project is the Basic Inverted Index-Based Approach proposed by the authors in their research. It is named All-Pairs-0 and appears in Figure 1. in the paper.

Algorithm Design and Implementation

The implemented algorithm (InvertedIdx) is in file findsim/invertedidx.cpp and has been set as the default mode of execution. All other files in findsim have been given by Prof. David C. Anastasiu. The command to execute the findsim program in invertedidx mode is

../build/findsim -m iidx -eps 0.3 -k 10 wiki1.csr wiki1.iidx.0.3.10.csr
Or
../build/findsim -eps 0.3 -k 10 wiki1.csr wiki1.iidx.0.3.10.csr
Or
../build/findsim wiki1.csr wiki1.iidx.0.3.10.csr

General usage and options of findsim command can be found in here

Input CSR matrix with empty columns removed V Vector of inverted indices I1, I2…, Im Vector of maps of similarity scores for each document and its corresponding index M Vector of similarity scores for every input document S Vector of candidate pairs C Given similarity threshold value t Given required no. of neighbors k Vector of neighbors N

picture1

A python script has been written to execute both the algorithms for all the below mentioned combinations and is available in findsim/scripts/test_script.py. This script also runs the findsim command in eq mode and displays the differences, if any, between the two output files.

  • πœ– ∈ {0.3,0.4,0.5,0.7,0.9}
  • π‘˜ ∈ {10,50,100} and
  • datasets ∈ {wiki1.csr, wiki2.csr}

References

  1. R. J. Bayardo, Y. Ma, and R. Srikant, β€œScaling up all pairs similarity search,” in Proceedings of the 16th International Conference on World Wide Web, ser. WWW ’07. New York, NY, USA: ACM, 2007, pp. 131–140.
  2. Classroom slides on k-nearest neighbor (knn) and IdxJoin Algorithms by Prof. David C. Anastasiu of CMPE department at San Jose State University (SJSU).

speed-up-apss's People

Contributors

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