IMP logo
IMP Reference Guide  2.14.0
The Integrative Modeling Platform
IMP::kmeans Namespace Reference

Interface to the GPL k-means clustering library More...

Detailed Description

Interface to the GPL k-means clustering library

This module allows clustering of multi-dimensional data points using the k-means algorithms, based on the GPL kmeans library.

Info

Author(s): Barak Raveh

Maintainer: barakr

License: GPL This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Publications:

Classes

class  KMeans
 

Enumerations

enum  KM_ALG_TYPE { KM_LLOYDS = 1, KM_LOCAL_SWAP = 2, KM_LOCAL_EZ_HYBRID = 3, KM_HYBRID = 4 }
 

Standard module functions

All IMP modules have a set of standard functions to help get information about the module and about files associated with the module.

std::string get_module_version ()
 Return the version of this module, as a string. More...
 
std::string get_module_name ()
 
std::string get_data_path (std::string file_name)
 Return the full path to one of this module's data files. More...
 
std::string get_example_path (std::string file_name)
 Return the full path to one of this module's example files. More...
 

Enumeration Type Documentation

Different k-means algorithm variants that are implemented in the library, see also http://www.cs.umd.edu/~mount/Projects/KMeans/

Enumerator
KM_LLOYDS 

Repeatedly applies Lloyd's algorithm with randomly sampled starting points.

KM_LOCAL_SWAP 

A local search heuristic, which works by performing swaps between existing centers and a set of candidate centers.

KM_LOCAL_EZ_HYBRID 

A simple hybrid algorithm, which does one swap followed by some number of iterations of Lloyd's.

KM_HYBRID 

A more complex hybrid of Lloyd's and Swap, which performs some number of swaps followed by some number of iterations of Lloyd's algorithm. To avoid getting trapped in local minima, an approach similar to simulated annealing is included as well.

Definition at line 35 of file kmeans/KMeans.h.

Function Documentation

std::string IMP::kmeans::get_data_path ( std::string  file_name)

Return the full path to one of this module's data files.

To read the data file "data_library" that was placed in the data directory of this module, do something like

std::ifstream in(IMP::kmeans::get_data_path("data_library"));

This will ensure that the code works both when IMP is installed or if used via the setup_environment.sh script.

Note
Each module has its own data directory, so be sure to use this function from the correct module.
std::string IMP::kmeans::get_example_path ( std::string  file_name)

Return the full path to one of this module's example files.

To read the example file "example_protein.pdb" that was placed in the examples directory of this module, do something like

std::ifstream in(IMP::kmeans::get_example_path("example_protein.pdb"));

This will ensure that the code works both when IMP is installed or if used via the setup_environment.sh script.

Note
Each module has its own example directory, so be sure to use this function from the correct module.
std::string IMP::kmeans::get_module_version ( )

Return the version of this module, as a string.

Note
This function is only available in Python.

Definition at line 5 of file EMageFit/__init__.py.