Giter VIP home page Giter VIP logo

dan-tan / iterative-label-spreading Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 10.2 MB

This is an implementation of a semi-supervised/unsupervised clustering method called Iterative Label Spreading. The main algorithm is written in c, and wrapped in cython for use in python. The algorithm is presented in the following paper by Amanda J. Parker and Amanda S. Barnard.

Python 57.47% C 29.32% Cython 13.21%
python semi-supervised-learning unsupervised-learning c cython-wrapper

iterative-label-spreading's Introduction

iterLS: An Implementation of Iterative Label Spreading

This is an implementation of a semi-supervised/unsupervised clustering method called Iterative Label Spreading. The main algorithm is written in c, and wrapped in cython for use in python. The algorithm is presented in the following paper by Amanda J. Parker and Amanda S. Barnard.

"Selecting Appropriate Clustering Methods for Materials Science Applications of Machine Learning". Published 09/10/2019. DOI: https://doi.org/10.1002/adts.201900145

To use the algorithm, I recommend reading the paper first as it describes how to use Iterative Label Spreading. Use cases go beyond simple clustering such as evaluating performance of a given clustering on a data set.

The current implementation is very minimal, providing methods and variables that should allow the user, with plotting techniques, to use Iterative Label Spreading effectively. Plotting techniques and suggested segmentation is on my todo list. Currently, I have not rigoroursly tested edge cases, feel free to raise an issue or pull request.

Installation

git clone git+https://github.com/Dan-Tan/Iterative-Label-Spreading.git
cd Iterative-Label-Spreading
pip install .

Usage

For more examples with plots see notebooks

from iterLS import ILS

data_set # 2-D numpy array of shape (n_points, dimensions)

example_ILS = ILS()
example_ILS.label_spreading(data_set)

segmentation_indices = [...] # pass in indices you wish to segment rmin 
indices, labels = example_ILS.segmentation(segmentation_indices)

example_ILS.label_spreading(data_set, indices, labels) # final label Spreading

example_ILS.labels # final label result for entire dataset
example_ILS.rmin # list of distances returned from label spreading

If you have any issues with install feel free to raise and issue.

Todo:

  • Add tests
  • Document code
  • Add additional plotting methods to aid with viewing results, segmentation and general QOL
  • Implementation reliable auto-segmentation method

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.