3 @brief pyclustering module for samples. 5 @authors Andrei Novikov (pyclustering@yandex.ru) 7 @copyright GNU Public License 9 @cond GNU_PUBLIC_LICENSE 10 PyClustering is free software: you can redistribute it and/or modify 11 it under the terms of the GNU General Public License as published by 12 the Free Software Foundation, either version 3 of the License, or 13 (at your option) any later version. 15 PyClustering is distributed in the hope that it will be useful, 16 but WITHOUT ANY WARRANTY; without even the implied warranty of 17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 GNU General Public License for more details. 20 You should have received a copy of the GNU General Public License 21 along with this program. If not, see <http://www.gnu.org/licenses/>. 29 @brief Answer reader for samples that are used by pyclustering library. 35 @brief Creates instance of answer reader to read proper clustering results of samples. 37 @param[in] answer_path (string): Path to clustering results (answers). 47 @brief Read proper clustering results. 49 @return (list) Clusters where each cluster is represented by list of index point from dataset. 58 @brief Read proper clustering results 60 @return (list) Noise where each outlier is represented by index point from dataset. 69 @brief Read proper cluster lengths. 70 @details Cluster length means amount of point in a cluster. 72 @return (list) Cluster lengths where each length means amount of points in a cluster. 76 return [len(cluster)
for cluster
in clusters]
79 def __read_answer_from_line(self, index_point, line):
81 @brief Read information about point from the specific line and place it to cluster or noise in line with that 84 @param[in] index_point (uint): Index point that should be placed to cluster or noise. 85 @param[in] line (string): Line where information about point should be read. 90 self.
__noise.append(index_point)
92 index_cluster = int(line)
96 self.
__clusters[index_cluster].append(index_point)
99 def __read_answer(self):
101 @brief Read information about proper clusters and noises from the file. Answer reader for samples that are used by pyclustering library.
def get_noise(self)
Read proper clustering results.
def get_cluster_lengths(self)
Read proper cluster lengths.
def __read_answer(self)
Read information about proper clusters and noises from the file.
def get_clusters(self)
Read proper clustering results.
def __init__(self, answer_path)
Creates instance of answer reader to read proper clustering results of samples.
def __read_answer_from_line(self, index_point, line)
Read information about point from the specific line and place it to cluster or noise in line with tha...