Git Product home page Git Product logo

learning-to-link's Introduction

Learning-to-Link

This repository contains the source code for the paper Learning to Link by Maria-Florina Balcan, Travis Dick and Manuel Lang. We solve the problem of finding the best linkage strategy for bottom up clustering algorithms. Also, we learn a weighted combination of metrics to find the best feature representation of the given dataset.

Contributors

Running the code

We provide two scripts for running the experiments, one for the algorithm selection and the other for learning the metric. To create the executables, please use the CMakeLists.txt by running cmake . and make in the root directory.

Algorithm selection

./AlphaLinkage <argument list>

You can use the following command line arguments.

Argument Description
--help Display usage options
--batch Select the n-th set of the given number of points for each class
--folder Evaluate all csv files in the given folder
--input Evaluate the given csv file
--job Create an MNIST job (e.g. --job 0 will run labels 0,1,2,3,4)
--labels Select the CSV encoded labels only (e.g. --labels 1,2,4)
--majority Use Majority distance instead of Hamming distance
--noaverage Directly output the results without averaging them over multiple files
--output Path where the result will be stored
--points Number of points used for each class
--verbose Output the ranges to the console
--averagecomplete (Default) Interpolate between average and complete linkage
--singleaverage Interpolate between single and average linkage
--singlecomplete Interpolate between single and complete linkage

Example:

./AlphaLinkage --input ./input.csv --output ./output.csv --points 200 --singlecomplete

This command will read 200 points for each class from the file input.csv, interpolate between single and complete linkage, and output the results to output.csv.

Optimizing the Metric

./DistanceLearning <parameter_string> <input1.csv> <input2.csv>

The parameter string is a list of the four following characters.

Index Description
1 Cost function: 'm' for Majority or 'h' for Hamming cost
2 Linkage type: 's' for single linkage or 'c' for complete linkage
3 File type of the first file: 'd' for distance matrix, 'c' for cosine distance (raw features) or 'e' for the Euclidean distance (raw features)
4 File type of the second file: 'd' for distance matrix, 'c' for cosine distance (raw features) or 'e' for the Euclidean distance (raw features)

Example:

./DistanceLearning hcee input1.csv input2.csv

This example loads the two files input1.csv and input2.csv, learns the best metric using complete linkage and the Hamming cost, and output the results to the console. The pointwise distances are calculated using the Euclidean distances in both cases.

learning-to-link's People

Contributors

manuel-lang avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

chrisseiler

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.