pyclustering
0.10.1
pyclustring is a Python, C++ data mining library.
|
Provides service to change clustering result representation. More...
Public Member Functions | |
def | __init__ (self, encoding, clusters, data) |
Constructor of clustering result representor. More... | |
def | get_encoding (self) |
Returns current cluster representation. | |
def | get_clusters (self) |
Returns clusters that are represented in line with type that is defined by get_encoding() . More... | |
def | get_data (self) |
Returns data that was used for cluster analysis. | |
def | set_encoding (self, encoding) |
Change clusters encoding to specified type (Index List, Object List, Labeling). More... | |
Provides service to change clustering result representation.
There are three general types of representation:
CLUSTER_INDEX_LIST_SEPARATION
, for example [[0, 1, 2], [3, 4], [5, 6, 7]
.CLUSTER_INDEX_LABELING
, for example [0, 0, 0, 1, 1, 2, 2, 2]
.CLUSTER_OBJECT_LIST_SEPARATION
, for example [[obj1, obj2, obj3], [obj4, obj5], [obj5, obj6, obj7]
.There is an example how to covert default Index List Separation to other types:
Output of the code above is following:
If there is no index or object in clusters that exists in an input data then it is going to be marked as NaN
in case of Index Labeling. Here is an example:
Here is an output of the code above. Pay attention to NaN
value for the object with index 2 [114.3, 54.1]
.
Definition at line 32 of file encoder.py.
def pyclustering.cluster.encoder.cluster_encoder.__init__ | ( | self, | |
encoding, | |||
clusters, | |||
data | |||
) |
Constructor of clustering result representor.
[in] | encoding | (type_encoding): Type of clusters representation (Index List, Object List or Labels). |
[in] | clusters | (list): Clusters that were allocated from an input data. |
[in] | data | (list): Data that was used for cluster analysis. |
Definition at line 103 of file encoder.py.
def pyclustering.cluster.encoder.cluster_encoder.get_clusters | ( | self | ) |
Returns clusters that are represented in line with type that is defined by get_encoding()
.
Definition at line 129 of file encoder.py.
Referenced by pyclustering.samples.answer_reader.get_cluster_lengths(), and pyclustering.cluster.optics.optics.process().
def pyclustering.cluster.encoder.cluster_encoder.set_encoding | ( | self, | |
encoding | |||
) |
Change clusters encoding to specified type (Index List, Object List, Labeling).
[in] | encoding | (type_encoding): New type of clusters representation. |
Definition at line 147 of file encoder.py.