partition
stringclasses
3 values
func_name
stringlengths
1
134
docstring
stringlengths
1
46.9k
path
stringlengths
4
223
original_string
stringlengths
75
104k
code
stringlengths
75
104k
docstring_tokens
listlengths
1
1.97k
repo
stringlengths
7
55
language
stringclasses
1 value
url
stringlengths
87
315
code_tokens
listlengths
19
28.4k
sha
stringlengths
40
40
valid
hhn_network.__update_central_neurons
! @brief Update of central neurons in line with new values of current in channels. @param[in] t (doubles): Current time of simulation. @param[in] next_membrane (list): New values of membrane potentials for central neurons. @Param[in] next_active_sodium (list): New values of...
pyclustering/nnet/hhn.py
def __update_central_neurons(self, t, next_cn_membrane, next_cn_active_sodium, next_cn_inactive_sodium, next_cn_active_potassium): """! @brief Update of central neurons in line with new values of current in channels. @param[in] t (doubles): Current time of simulation. @para...
def __update_central_neurons(self, t, next_cn_membrane, next_cn_active_sodium, next_cn_inactive_sodium, next_cn_active_potassium): """! @brief Update of central neurons in line with new values of current in channels. @param[in] t (doubles): Current time of simulation. @para...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hhn.py#L439-L462
[ "def", "__update_central_neurons", "(", "self", ",", "t", ",", "next_cn_membrane", ",", "next_cn_active_sodium", ",", "next_cn_inactive_sodium", ",", "next_cn_active_potassium", ")", ":", "for", "index", "in", "range", "(", "0", ",", "len", "(", "self", ".", "_c...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hhn_network.hnn_state
! @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator. @param[in] inputs (list): States of oscillator for integration [v, m, h, n] (see description below). @param[in] t (double): Current time of simulation. @param[in] argv ...
pyclustering/nnet/hhn.py
def hnn_state(self, inputs, t, argv): """! @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator. @param[in] inputs (list): States of oscillator for integration [v, m, h, n] (see description below). @param[in] t (double): Cur...
def hnn_state(self, inputs, t, argv): """! @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator. @param[in] inputs (list): States of oscillator for integration [v, m, h, n] (see description below). @param[in] t (double): Cur...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hhn.py#L465-L549
[ "def", "hnn_state", "(", "self", ",", "inputs", ",", "t", ",", "argv", ")", ":", "index", "=", "argv", "v", "=", "inputs", "[", "0", "]", "# membrane potential (v).\r", "m", "=", "inputs", "[", "1", "]", "# activation conductance of the sodium channel (m).\r",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hhn_network.__alfa_function
! @brief Calculates value of alfa-function for difference between spike generation time and current simulation time. @param[in] time (double): Difference between last spike generation time and current time. @param[in] alfa (double): Alfa parameter for alfa-function. @param[...
pyclustering/nnet/hhn.py
def __alfa_function(self, time, alfa, betta): """! @brief Calculates value of alfa-function for difference between spike generation time and current simulation time. @param[in] time (double): Difference between last spike generation time and current time. @param[in] alfa (d...
def __alfa_function(self, time, alfa, betta): """! @brief Calculates value of alfa-function for difference between spike generation time and current simulation time. @param[in] time (double): Difference between last spike generation time and current time. @param[in] alfa (d...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hhn.py#L565-L577
[ "def", "__alfa_function", "(", "self", ",", "time", ",", "alfa", ",", "betta", ")", ":", "return", "alfa", "*", "time", "*", "math", ".", "exp", "(", "-", "betta", "*", "time", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique_visualizer.show_grid
! @brief Show CLIQUE blocks as a grid in data space. @details Each block contains points and according to this density is displayed. CLIQUE grid helps to visualize grid that was used for clustering process. @param[in] cells (list): List of cells that is produced by CLIQUE...
pyclustering/cluster/clique.py
def show_grid(cells, data): """! @brief Show CLIQUE blocks as a grid in data space. @details Each block contains points and according to this density is displayed. CLIQUE grid helps to visualize grid that was used for clustering process. @param[in] cells (list): ...
def show_grid(cells, data): """! @brief Show CLIQUE blocks as a grid in data space. @details Each block contains points and according to this density is displayed. CLIQUE grid helps to visualize grid that was used for clustering process. @param[in] cells (list): ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L61-L88
[ "def", "show_grid", "(", "cells", ",", "data", ")", ":", "dimension", "=", "cells", "[", "0", "]", ".", "dimensions", "amount_canvases", "=", "1", "if", "dimension", ">", "1", ":", "amount_canvases", "=", "int", "(", "dimension", "*", "(", "dimension", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique_visualizer.show_clusters
! @brief Display CLIQUE clustering results. @param[in] data (list): Data that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. @param[in] noise (array_like): Noise that were allocated by the algorithm.
pyclustering/cluster/clique.py
def show_clusters(data, clusters, noise=None): """! @brief Display CLIQUE clustering results. @param[in] data (list): Data that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. @param[in] noise (array_like): Noise th...
def show_clusters(data, clusters, noise=None): """! @brief Display CLIQUE clustering results. @param[in] data (list): Data that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. @param[in] noise (array_like): Noise th...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L92-L104
[ "def", "show_clusters", "(", "data", ",", "clusters", ",", "noise", "=", "None", ")", ":", "visualizer", "=", "cluster_visualizer", "(", ")", "visualizer", ".", "append_clusters", "(", "clusters", ",", "data", ")", "visualizer", ".", "append_cluster", "(", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique_visualizer.__draw_two_dimension_data
! @brief Display data in two-dimensional canvas. @param[in] ax (Axis): Canvas where data should be displayed. @param[in] data (list): Data points that should be displayed. @param[in] pair (tuple): Pair of dimension indexes.
pyclustering/cluster/clique.py
def __draw_two_dimension_data(ax, data, pair): """! @brief Display data in two-dimensional canvas. @param[in] ax (Axis): Canvas where data should be displayed. @param[in] data (list): Data points that should be displayed. @param[in] pair (tuple): Pair of dimension indexes....
def __draw_two_dimension_data(ax, data, pair): """! @brief Display data in two-dimensional canvas. @param[in] ax (Axis): Canvas where data should be displayed. @param[in] data (list): Data points that should be displayed. @param[in] pair (tuple): Pair of dimension indexes....
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L108-L125
[ "def", "__draw_two_dimension_data", "(", "ax", ",", "data", ",", "pair", ")", ":", "ax", ".", "set_xlabel", "(", "\"x%d\"", "%", "pair", "[", "0", "]", ")", "ax", ".", "set_ylabel", "(", "\"x%d\"", "%", "pair", "[", "1", "]", ")", "for", "point", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique_block.capture_points
! @brief Finds points that belong to this block using availability map to reduce computational complexity by checking whether the point belongs to the block. @details Algorithm complexity of this method is O(n). @param[in] data (array_like): Data where points are represente...
pyclustering/cluster/clique.py
def capture_points(self, data, point_availability): """! @brief Finds points that belong to this block using availability map to reduce computational complexity by checking whether the point belongs to the block. @details Algorithm complexity of this method is O(n). ...
def capture_points(self, data, point_availability): """! @brief Finds points that belong to this block using availability map to reduce computational complexity by checking whether the point belongs to the block. @details Algorithm complexity of this method is O(n). ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L350-L364
[ "def", "capture_points", "(", "self", ",", "data", ",", "point_availability", ")", ":", "for", "index_point", "in", "range", "(", "len", "(", "data", ")", ")", ":", "if", "(", "point_availability", "[", "index_point", "]", "is", "True", ")", "and", "(", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique_block.get_location_neighbors
! @brief Forms list of logical location of each neighbor for this particular CLIQUE block. @param[in] edge (uint): Amount of intervals in each dimension that is used for clustering process. @return (list) Logical location of each neighbor for this particular CLIQUE block.
pyclustering/cluster/clique.py
def get_location_neighbors(self, edge): """! @brief Forms list of logical location of each neighbor for this particular CLIQUE block. @param[in] edge (uint): Amount of intervals in each dimension that is used for clustering process. @return (list) Logical location of each neighbo...
def get_location_neighbors(self, edge): """! @brief Forms list of logical location of each neighbor for this particular CLIQUE block. @param[in] edge (uint): Amount of intervals in each dimension that is used for clustering process. @return (list) Logical location of each neighbo...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L367-L389
[ "def", "get_location_neighbors", "(", "self", ",", "edge", ")", ":", "neighbors", "=", "[", "]", "for", "index_dimension", "in", "range", "(", "len", "(", "self", ".", "__logical_location", ")", ")", ":", "if", "self", ".", "__logical_location", "[", "inde...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
coordinate_iterator.increment
! @brief Forms logical location for next block.
pyclustering/cluster/clique.py
def increment(self): """! @brief Forms logical location for next block. """ for index_dimension in range(self.__dimension): if self.__coordiate[index_dimension] + 1 < self.__intervals: self.__coordiate[index_dimension] += 1 return ...
def increment(self): """! @brief Forms logical location for next block. """ for index_dimension in range(self.__dimension): if self.__coordiate[index_dimension] + 1 < self.__intervals: self.__coordiate[index_dimension] += 1 return ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L421-L433
[ "def", "increment", "(", "self", ")", ":", "for", "index_dimension", "in", "range", "(", "self", ".", "__dimension", ")", ":", "if", "self", ".", "__coordiate", "[", "index_dimension", "]", "+", "1", "<", "self", ".", "__intervals", ":", "self", ".", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__process_by_ccore
! @brief Performs cluster analysis using C++ implementation of CLIQUE algorithm that is used by default if user's target platform is supported.
pyclustering/cluster/clique.py
def __process_by_ccore(self): """! @brief Performs cluster analysis using C++ implementation of CLIQUE algorithm that is used by default if user's target platform is supported. """ (self.__clusters, self.__noise, block_logical_locations, block_max_corners, block_mi...
def __process_by_ccore(self): """! @brief Performs cluster analysis using C++ implementation of CLIQUE algorithm that is used by default if user's target platform is supported. """ (self.__clusters, self.__noise, block_logical_locations, block_max_corners, block_mi...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L598-L612
[ "def", "__process_by_ccore", "(", "self", ")", ":", "(", "self", ".", "__clusters", ",", "self", ".", "__noise", ",", "block_logical_locations", ",", "block_max_corners", ",", "block_min_corners", ",", "block_points", ")", "=", "wrapper", ".", "clique", "(", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__validate_arguments
! @brief Check input arguments of CLIQUE algorithm and if one of them is not correct then appropriate exception is thrown.
pyclustering/cluster/clique.py
def __validate_arguments(self): """! @brief Check input arguments of CLIQUE algorithm and if one of them is not correct then appropriate exception is thrown. """ if len(self.__data) == 0: raise ValueError("Empty input data. Data should contain at lea...
def __validate_arguments(self): """! @brief Check input arguments of CLIQUE algorithm and if one of them is not correct then appropriate exception is thrown. """ if len(self.__data) == 0: raise ValueError("Empty input data. Data should contain at lea...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L626-L640
[ "def", "__validate_arguments", "(", "self", ")", ":", "if", "len", "(", "self", ".", "__data", ")", "==", "0", ":", "raise", "ValueError", "(", "\"Empty input data. Data should contain at least one point.\"", ")", "if", "self", ".", "__amount_intervals", "<=", "0"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__allocate_clusters
! @brief Performs cluster analysis using formed CLIQUE blocks.
pyclustering/cluster/clique.py
def __allocate_clusters(self): """! @brief Performs cluster analysis using formed CLIQUE blocks. """ for cell in self.__cells: if cell.visited is False: self.__expand_cluster(cell)
def __allocate_clusters(self): """! @brief Performs cluster analysis using formed CLIQUE blocks. """ for cell in self.__cells: if cell.visited is False: self.__expand_cluster(cell)
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L643-L650
[ "def", "__allocate_clusters", "(", "self", ")", ":", "for", "cell", "in", "self", ".", "__cells", ":", "if", "cell", ".", "visited", "is", "False", ":", "self", ".", "__expand_cluster", "(", "cell", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__expand_cluster
! @brief Tries to expand cluster from specified cell. @details During expanding points are marked as noise or append to new cluster. @param[in] cell (clique_block): CLIQUE block from that cluster should be expanded.
pyclustering/cluster/clique.py
def __expand_cluster(self, cell): """! @brief Tries to expand cluster from specified cell. @details During expanding points are marked as noise or append to new cluster. @param[in] cell (clique_block): CLIQUE block from that cluster should be expanded. """ cell....
def __expand_cluster(self, cell): """! @brief Tries to expand cluster from specified cell. @details During expanding points are marked as noise or append to new cluster. @param[in] cell (clique_block): CLIQUE block from that cluster should be expanded. """ cell....
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L653-L680
[ "def", "__expand_cluster", "(", "self", ",", "cell", ")", ":", "cell", ".", "visited", "=", "True", "if", "len", "(", "cell", ".", "points", ")", "<=", "self", ".", "__density_threshold", ":", "if", "len", "(", "cell", ".", "points", ")", ">", "0", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__get_neighbors
! @brief Returns neighbors for specified CLIQUE block as clique_block objects. @return (list) Neighbors as clique_block objects.
pyclustering/cluster/clique.py
def __get_neighbors(self, cell): """! @brief Returns neighbors for specified CLIQUE block as clique_block objects. @return (list) Neighbors as clique_block objects. """ neighbors = [] location_neighbors = cell.get_location_neighbors(self.__amount_intervals) ...
def __get_neighbors(self, cell): """! @brief Returns neighbors for specified CLIQUE block as clique_block objects. @return (list) Neighbors as clique_block objects. """ neighbors = [] location_neighbors = cell.get_location_neighbors(self.__amount_intervals) ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L683-L701
[ "def", "__get_neighbors", "(", "self", ",", "cell", ")", ":", "neighbors", "=", "[", "]", "location_neighbors", "=", "cell", ".", "get_location_neighbors", "(", "self", ".", "__amount_intervals", ")", "for", "i", "in", "range", "(", "len", "(", "location_nei...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__create_grid
! @brief Creates CLIQUE grid that consists of CLIQUE blocks for clustering process.
pyclustering/cluster/clique.py
def __create_grid(self): """! @brief Creates CLIQUE grid that consists of CLIQUE blocks for clustering process. """ data_sizes, min_corner, max_corner = self.__get_data_size_derscription() dimension = len(self.__data[0]) cell_sizes = [dimension_length / self.__a...
def __create_grid(self): """! @brief Creates CLIQUE grid that consists of CLIQUE blocks for clustering process. """ data_sizes, min_corner, max_corner = self.__get_data_size_derscription() dimension = len(self.__data[0]) cell_sizes = [dimension_length / self.__a...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L704-L730
[ "def", "__create_grid", "(", "self", ")", ":", "data_sizes", ",", "min_corner", ",", "max_corner", "=", "self", ".", "__get_data_size_derscription", "(", ")", "dimension", "=", "len", "(", "self", ".", "__data", "[", "0", "]", ")", "cell_sizes", "=", "[", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__get_spatial_location
! @brief Calculates spatial location for CLIQUE block with logical coordinates defined by logical_location. @param[in] logical_location (list): Logical location of CLIQUE block for that spatial location should be calculated. @param[in] min_corner (list): Minimum corner of an input data. ...
pyclustering/cluster/clique.py
def __get_spatial_location(self, logical_location, min_corner, max_corner, cell_sizes): """! @brief Calculates spatial location for CLIQUE block with logical coordinates defined by logical_location. @param[in] logical_location (list): Logical location of CLIQUE block for that spatial locati...
def __get_spatial_location(self, logical_location, min_corner, max_corner, cell_sizes): """! @brief Calculates spatial location for CLIQUE block with logical coordinates defined by logical_location. @param[in] logical_location (list): Logical location of CLIQUE block for that spatial locati...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L743-L766
[ "def", "__get_spatial_location", "(", "self", ",", "logical_location", ",", "min_corner", ",", "max_corner", ",", "cell_sizes", ")", ":", "cur_min_corner", "=", "min_corner", "[", ":", "]", "cur_max_corner", "=", "min_corner", "[", ":", "]", "dimension", "=", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
clique.__get_data_size_derscription
! @brief Calculates input data description that is required to create CLIQUE grid. @return (list, list, list): Data size in each dimension, minimum and maximum corners.
pyclustering/cluster/clique.py
def __get_data_size_derscription(self): """! @brief Calculates input data description that is required to create CLIQUE grid. @return (list, list, list): Data size in each dimension, minimum and maximum corners. """ min_corner = self.__data[0][:] max_corner = se...
def __get_data_size_derscription(self): """! @brief Calculates input data description that is required to create CLIQUE grid. @return (list, list, list): Data size in each dimension, minimum and maximum corners. """ min_corner = self.__data[0][:] max_corner = se...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/clique.py#L769-L794
[ "def", "__get_data_size_derscription", "(", "self", ")", ":", "min_corner", "=", "self", ".", "__data", "[", "0", "]", "[", ":", "]", "max_corner", "=", "self", ".", "__data", "[", "0", "]", "[", ":", "]", "dimension", "=", "len", "(", "self", ".", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
xmeans.process
! @brief Performs cluster analysis in line with rules of X-Means algorithm. @remark Results of clustering can be obtained using corresponding gets methods. @see get_clusters() @see get_centers()
pyclustering/cluster/xmeans.py
def process(self): """! @brief Performs cluster analysis in line with rules of X-Means algorithm. @remark Results of clustering can be obtained using corresponding gets methods. @see get_clusters() @see get_centers() """ ...
def process(self): """! @brief Performs cluster analysis in line with rules of X-Means algorithm. @remark Results of clustering can be obtained using corresponding gets methods. @see get_clusters() @see get_centers() """ ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/xmeans.py#L157-L185
[ "def", "process", "(", "self", ")", ":", "if", "(", "self", ".", "__ccore", "is", "True", ")", ":", "self", ".", "__clusters", ",", "self", ".", "__centers", "=", "wrapper", ".", "xmeans", "(", "self", ".", "__pointer_data", ",", "self", ".", "__cent...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
xmeans.__improve_parameters
! @brief Performs k-means clustering in the specified region. @param[in] centers (list): Centers of clusters. @param[in] available_indexes (list): Indexes that defines which points can be used for k-means clustering, if None - then all points are used. @return (li...
pyclustering/cluster/xmeans.py
def __improve_parameters(self, centers, available_indexes = None): """! @brief Performs k-means clustering in the specified region. @param[in] centers (list): Centers of clusters. @param[in] available_indexes (list): Indexes that defines which points can be used for k-means...
def __improve_parameters(self, centers, available_indexes = None): """! @brief Performs k-means clustering in the specified region. @param[in] centers (list): Centers of clusters. @param[in] available_indexes (list): Indexes that defines which points can be used for k-means...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/xmeans.py#L229-L261
[ "def", "__improve_parameters", "(", "self", ",", "centers", ",", "available_indexes", "=", "None", ")", ":", "if", "available_indexes", "and", "len", "(", "available_indexes", ")", "==", "1", ":", "index_center", "=", "available_indexes", "[", "0", "]", "retur...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
xmeans.__local_to_global_clusters
! @brief Converts clusters in local region define by 'available_indexes' to global clusters. @param[in] local_clusters (list): Local clusters in specific region. @param[in] available_indexes (list): Map between local and global point's indexes. @return Global clusters.
pyclustering/cluster/xmeans.py
def __local_to_global_clusters(self, local_clusters, available_indexes): """! @brief Converts clusters in local region define by 'available_indexes' to global clusters. @param[in] local_clusters (list): Local clusters in specific region. @param[in] available_indexes (list): Map bet...
def __local_to_global_clusters(self, local_clusters, available_indexes): """! @brief Converts clusters in local region define by 'available_indexes' to global clusters. @param[in] local_clusters (list): Local clusters in specific region. @param[in] available_indexes (list): Map bet...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/xmeans.py#L264-L283
[ "def", "__local_to_global_clusters", "(", "self", ",", "local_clusters", ",", "available_indexes", ")", ":", "clusters", "=", "[", "]", "for", "local_cluster", "in", "local_clusters", ":", "current_cluster", "=", "[", "]", "for", "index_point", "in", "local_cluste...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
xmeans.__improve_structure
! @brief Check for best structure: divides each cluster into two and checks for best results using splitting criterion. @param[in] clusters (list): Clusters that have been allocated (each cluster contains indexes of points from data). @param[in] centers (list): Centers of clusters. ...
pyclustering/cluster/xmeans.py
def __improve_structure(self, clusters, centers): """! @brief Check for best structure: divides each cluster into two and checks for best results using splitting criterion. @param[in] clusters (list): Clusters that have been allocated (each cluster contains indexes of points from da...
def __improve_structure(self, clusters, centers): """! @brief Check for best structure: divides each cluster into two and checks for best results using splitting criterion. @param[in] clusters (list): Clusters that have been allocated (each cluster contains indexes of points from da...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/xmeans.py#L286-L333
[ "def", "__improve_structure", "(", "self", ",", "clusters", ",", "centers", ")", ":", "allocated_centers", "=", "[", "]", "amount_free_centers", "=", "self", ".", "__kmax", "-", "len", "(", "centers", ")", "for", "index_cluster", "in", "range", "(", "len", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
xmeans.__splitting_criterion
! @brief Calculates splitting criterion for input clusters. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. @param[in] centers (list): Centers of the clusters. @return (double) Returns splitting criterion. High value of spl...
pyclustering/cluster/xmeans.py
def __splitting_criterion(self, clusters, centers): """! @brief Calculates splitting criterion for input clusters. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. @param[in] centers (list): Centers of the clusters. ...
def __splitting_criterion(self, clusters, centers): """! @brief Calculates splitting criterion for input clusters. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. @param[in] centers (list): Centers of the clusters. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/xmeans.py#L336-L357
[ "def", "__splitting_criterion", "(", "self", ",", "clusters", ",", "centers", ")", ":", "if", "self", ".", "__criterion", "==", "splitting_type", ".", "BAYESIAN_INFORMATION_CRITERION", ":", "return", "self", ".", "__bayesian_information_criterion", "(", "clusters", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
xmeans.__minimum_noiseless_description_length
! @brief Calculates splitting criterion for input clusters using minimum noiseless description length criterion. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. @param[in] centers (list): Centers of the clusters. @return (d...
pyclustering/cluster/xmeans.py
def __minimum_noiseless_description_length(self, clusters, centers): """! @brief Calculates splitting criterion for input clusters using minimum noiseless description length criterion. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. ...
def __minimum_noiseless_description_length(self, clusters, centers): """! @brief Calculates splitting criterion for input clusters using minimum noiseless description length criterion. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/xmeans.py#L360-L409
[ "def", "__minimum_noiseless_description_length", "(", "self", ",", "clusters", ",", "centers", ")", ":", "scores", "=", "float", "(", "'inf'", ")", "W", "=", "0.0", "K", "=", "len", "(", "clusters", ")", "N", "=", "0.0", "sigma_sqrt", "=", "0.0", "alpha"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
xmeans.__bayesian_information_criterion
! @brief Calculates splitting criterion for input clusters using bayesian information criterion. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. @param[in] centers (list): Centers of the clusters. @return (double) Splitting...
pyclustering/cluster/xmeans.py
def __bayesian_information_criterion(self, clusters, centers): """! @brief Calculates splitting criterion for input clusters using bayesian information criterion. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. @param[in] centers (li...
def __bayesian_information_criterion(self, clusters, centers): """! @brief Calculates splitting criterion for input clusters using bayesian information criterion. @param[in] clusters (list): Clusters for which splitting criterion should be calculated. @param[in] centers (li...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/xmeans.py#L412-L460
[ "def", "__bayesian_information_criterion", "(", "self", ",", "clusters", ",", "centers", ")", ":", "scores", "=", "[", "float", "(", "'inf'", ")", "]", "*", "len", "(", "clusters", ")", "# splitting criterion\r", "dimension", "=", "len", "(", "self", ".", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
segmentation_image_simple1
Perfect
pyclustering/nnet/examples/legion_segmentation.py
def segmentation_image_simple1(): "Perfect" parameters = legion_parameters(); parameters.eps = 0.02; parameters.alpha = 0.005; parameters.betta = 0.1; parameters.gamma = 7.0; parameters.teta = 0.9; parameters.lamda = 0.1; parameters.teta_x = -0.5; parameters.teta_p = 7....
def segmentation_image_simple1(): "Perfect" parameters = legion_parameters(); parameters.eps = 0.02; parameters.alpha = 0.005; parameters.betta = 0.1; parameters.gamma = 7.0; parameters.teta = 0.9; parameters.lamda = 0.1; parameters.teta_x = -0.5; parameters.teta_p = 7....
[ "Perfect" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/examples/legion_segmentation.py#L66-L85
[ "def", "segmentation_image_simple1", "(", ")", ":", "parameters", "=", "legion_parameters", "(", ")", "parameters", ".", "eps", "=", "0.02", "parameters", ".", "alpha", "=", "0.005", "parameters", ".", "betta", "=", "0.1", "parameters", ".", "gamma", "=", "7...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bsas_visualizer.show_clusters
! @brief Display BSAS clustering results. @param[in] sample (list): Dataset that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. @param[in] representatives (array_like): Allocated representatives correspond to clusters. @...
pyclustering/cluster/bsas.py
def show_clusters(sample, clusters, representatives, **kwargs): """! @brief Display BSAS clustering results. @param[in] sample (list): Dataset that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. @param[in] representative...
def show_clusters(sample, clusters, representatives, **kwargs): """! @brief Display BSAS clustering results. @param[in] sample (list): Dataset that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. @param[in] representative...
[ "!", "@brief", "Display", "BSAS", "clustering", "results", "." ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bsas.py#L46-L74
[ "def", "show_clusters", "(", "sample", ",", "clusters", ",", "representatives", ",", "*", "*", "kwargs", ")", ":", "figure", "=", "kwargs", ".", "get", "(", "'figure'", ",", "None", ")", "display", "=", "kwargs", ".", "get", "(", "'display'", ",", "Tru...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bsas._find_nearest_cluster
! @brief Find nearest cluster to the specified point. @param[in] point (list): Point from dataset. @return (uint, double) Index of nearest cluster and distance to it.
pyclustering/cluster/bsas.py
def _find_nearest_cluster(self, point): """! @brief Find nearest cluster to the specified point. @param[in] point (list): Point from dataset. @return (uint, double) Index of nearest cluster and distance to it. """ index_cluster = -1; nearest_distance = float('i...
def _find_nearest_cluster(self, point): """! @brief Find nearest cluster to the specified point. @param[in] point (list): Point from dataset. @return (uint, double) Index of nearest cluster and distance to it. """ index_cluster = -1; nearest_distance = float('i...
[ "!", "@brief", "Find", "nearest", "cluster", "to", "the", "specified", "point", "." ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bsas.py#L221-L239
[ "def", "_find_nearest_cluster", "(", "self", ",", "point", ")", ":", "index_cluster", "=", "-", "1", "nearest_distance", "=", "float", "(", "'inf'", ")", "for", "index", "in", "range", "(", "len", "(", "self", ".", "_representatives", ")", ")", ":", "dis...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bsas._update_representative
! @brief Update cluster representative in line with new cluster size and added point to it. @param[in] index_cluster (uint): Index of cluster whose representative should be updated. @param[in] point (list): Point that was added to cluster.
pyclustering/cluster/bsas.py
def _update_representative(self, index_cluster, point): """! @brief Update cluster representative in line with new cluster size and added point to it. @param[in] index_cluster (uint): Index of cluster whose representative should be updated. @param[in] point (list): Point that was added ...
def _update_representative(self, index_cluster, point): """! @brief Update cluster representative in line with new cluster size and added point to it. @param[in] index_cluster (uint): Index of cluster whose representative should be updated. @param[in] point (list): Point that was added ...
[ "!", "@brief", "Update", "cluster", "representative", "in", "line", "with", "new", "cluster", "size", "and", "added", "point", "to", "it", "." ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bsas.py#L242-L254
[ "def", "_update_representative", "(", "self", ",", "index_cluster", ",", "point", ")", ":", "length", "=", "len", "(", "self", ".", "_clusters", "[", "index_cluster", "]", ")", "rep", "=", "self", ".", "_representatives", "[", "index_cluster", "]", "for", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm_visualizer.show_second_layer_dynamic
! @brief Shows output dynamic of the second layer. @param[in] analyser (syncsegm_analyser): Analyser of output dynamic of the 'syncsegm' oscillatory network.
pyclustering/nnet/syncsegm.py
def show_second_layer_dynamic(analyser): """! @brief Shows output dynamic of the second layer. @param[in] analyser (syncsegm_analyser): Analyser of output dynamic of the 'syncsegm' oscillatory network. """ second_layer_analysers = analyser.get_s...
def show_second_layer_dynamic(analyser): """! @brief Shows output dynamic of the second layer. @param[in] analyser (syncsegm_analyser): Analyser of output dynamic of the 'syncsegm' oscillatory network. """ second_layer_analysers = analyser.get_s...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L64-L75
[ "def", "show_second_layer_dynamic", "(", "analyser", ")", ":", "second_layer_analysers", "=", "analyser", ".", "get_second_layer_analysers", "(", ")", "analysers_sequence", "=", "[", "object_segment_analyser", "[", "'analyser'", "]", "for", "object_segment_analyser", "in"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm_analyser.allocate_colors
! @brief Allocates color segments. @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one segment. @param[in] noise_size (uint): Threshold that defines noise - segments size (in pixels) that is less then the threshold is consider...
pyclustering/nnet/syncsegm.py
def allocate_colors(self, eps = 0.01, noise_size = 1): """! @brief Allocates color segments. @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one segment. @param[in] noise_size (uint): Threshold that defines noise - se...
def allocate_colors(self, eps = 0.01, noise_size = 1): """! @brief Allocates color segments. @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one segment. @param[in] noise_size (uint): Threshold that defines noise - se...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L115-L128
[ "def", "allocate_colors", "(", "self", ",", "eps", "=", "0.01", ",", "noise_size", "=", "1", ")", ":", "segments", "=", "self", ".", "__color_analyser", ".", "allocate_clusters", "(", "eps", ")", "real_segments", "=", "[", "cluster", "for", "cluster", "in"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm_analyser.allocate_objects
! @brief Allocates object segments. @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one segment. @param[in] noise_size (uint): Threshold that defines noise - segments size (in pixels) that is less then the threshold is conside...
pyclustering/nnet/syncsegm.py
def allocate_objects(self, eps = 0.01, noise_size = 1): """! @brief Allocates object segments. @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one segment. @param[in] noise_size (uint): Threshold that defines noise - ...
def allocate_objects(self, eps = 0.01, noise_size = 1): """! @brief Allocates object segments. @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one segment. @param[in] noise_size (uint): Threshold that defines noise - ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L131-L153
[ "def", "allocate_objects", "(", "self", ",", "eps", "=", "0.01", ",", "noise_size", "=", "1", ")", ":", "if", "(", "self", ".", "__object_segment_analysers", "is", "None", ")", ":", "return", "[", "]", "segments", "=", "[", "]", "for", "object_segment_an...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm.process
! @brief Performs image segmentation. @param[in] image_source (string): Path to image file that should be processed. @param[in] collect_dynamic (bool): If 'True' then whole dynamic of each layer of the network is collected. @param[in] order_color (double): Local synchroniza...
pyclustering/nnet/syncsegm.py
def process(self, image_source, collect_dynamic = False, order_color = 0.9995, order_object = 0.999): """! @brief Performs image segmentation. @param[in] image_source (string): Path to image file that should be processed. @param[in] collect_dynamic (bool): If 'True' then wh...
def process(self, image_source, collect_dynamic = False, order_color = 0.9995, order_object = 0.999): """! @brief Performs image segmentation. @param[in] image_source (string): Path to image file that should be processed. @param[in] collect_dynamic (bool): If 'True' then wh...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L207-L230
[ "def", "process", "(", "self", ",", "image_source", ",", "collect_dynamic", "=", "False", ",", "order_color", "=", "0.9995", ",", "order_object", "=", "0.999", ")", ":", "self", ".", "__order_color", "=", "order_color", "self", ".", "__order_object", "=", "o...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm.__analyse_colors
! @brief Performs color segmentation by the first layer. @param[in] image_data (array_like): Image sample as a array-like structure. @param[in] collect_dynamic (bool): If 'True' then whole dynamic of the first layer of the network is collected. @return (syncnet_an...
pyclustering/nnet/syncsegm.py
def __analyse_colors(self, image_data, collect_dynamic): """! @brief Performs color segmentation by the first layer. @param[in] image_data (array_like): Image sample as a array-like structure. @param[in] collect_dynamic (bool): If 'True' then whole dynamic of the first laye...
def __analyse_colors(self, image_data, collect_dynamic): """! @brief Performs color segmentation by the first layer. @param[in] image_data (array_like): Image sample as a array-like structure. @param[in] collect_dynamic (bool): If 'True' then whole dynamic of the first laye...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L233-L247
[ "def", "__analyse_colors", "(", "self", ",", "image_data", ",", "collect_dynamic", ")", ":", "network", "=", "syncnet", "(", "image_data", ",", "self", ".", "__color_radius", ",", "initial_phases", "=", "initial_type", ".", "RANDOM_GAUSSIAN", ",", "ccore", "=", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm.__analyse_objects
! @brief Performs object segmentation by the second layer. @param[in] image_source (string): Path to image file that should be processed. @param[in] color_analyser (syncnet_analyser): Analyser of color segmentation results. @param[in] collect_dynamic (bool): If 'True' then ...
pyclustering/nnet/syncsegm.py
def __analyse_objects(self, image_source, color_analyser, collect_dynamic): """! @brief Performs object segmentation by the second layer. @param[in] image_source (string): Path to image file that should be processed. @param[in] color_analyser (syncnet_analyser): Analyser of...
def __analyse_objects(self, image_source, color_analyser, collect_dynamic): """! @brief Performs object segmentation by the second layer. @param[in] image_source (string): Path to image file that should be processed. @param[in] color_analyser (syncnet_analyser): Analyser of...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L250-L276
[ "def", "__analyse_objects", "(", "self", ",", "image_source", ",", "color_analyser", ",", "collect_dynamic", ")", ":", "# continue analysis\r", "pointer_image", "=", "Image", ".", "open", "(", "image_source", ")", "image_size", "=", "pointer_image", ".", "size", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm.__analyse_color_segment
! @brief Performs object segmentation of separate segment. @param[in] image_size (list): Image size presented as a [width x height]. @param[in] color_segment (list): Image segment that should be processed. @param[in] collect_dynamic (bool): If 'True' then whole dynamic of t...
pyclustering/nnet/syncsegm.py
def __analyse_color_segment(self, image_size, color_segment, collect_dynamic): """! @brief Performs object segmentation of separate segment. @param[in] image_size (list): Image size presented as a [width x height]. @param[in] color_segment (list): Image segment that should ...
def __analyse_color_segment(self, image_size, color_segment, collect_dynamic): """! @brief Performs object segmentation of separate segment. @param[in] image_size (list): Image size presented as a [width x height]. @param[in] color_segment (list): Image segment that should ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L279-L298
[ "def", "__analyse_color_segment", "(", "self", ",", "image_size", ",", "color_segment", ",", "collect_dynamic", ")", ":", "coordinates", "=", "self", ".", "__extract_location_coordinates", "(", "image_size", ",", "color_segment", ")", "if", "(", "len", "(", "coord...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncsegm.__extract_location_coordinates
! @brief Extracts coordinates of specified image segment. @param[in] image_size (list): Image size presented as a [width x height]. @param[in] color_segment (list): Image segment whose coordinates should be extracted. @return (list) Coordinates of each pixel.
pyclustering/nnet/syncsegm.py
def __extract_location_coordinates(self, image_size, color_segment): """! @brief Extracts coordinates of specified image segment. @param[in] image_size (list): Image size presented as a [width x height]. @param[in] color_segment (list): Image segment whose coordinates shoul...
def __extract_location_coordinates(self, image_size, color_segment): """! @brief Extracts coordinates of specified image segment. @param[in] image_size (list): Image size presented as a [width x height]. @param[in] color_segment (list): Image segment whose coordinates shoul...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/syncsegm.py#L301-L318
[ "def", "__extract_location_coordinates", "(", "self", ",", "image_size", ",", "color_segment", ")", ":", "coordinates", "=", "[", "]", "for", "index", "in", "color_segment", ":", "y", "=", "floor", "(", "index", "/", "image_size", "[", "0", "]", ")", "x", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
dsatur.process
! @brief Perform graph coloring using DSATUR algorithm. @see get_colors()
pyclustering/gcolor/dsatur.py
def process(self): """! @brief Perform graph coloring using DSATUR algorithm. @see get_colors() """ color_counter = 1; degrees = list(); saturation_degrees = [0] * len(self.__data_pointer); self.__coloring = [0] ...
def process(self): """! @brief Perform graph coloring using DSATUR algorithm. @see get_colors() """ color_counter = 1; degrees = list(); saturation_degrees = [0] * len(self.__data_pointer); self.__coloring = [0] ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/dsatur.py#L47-L123
[ "def", "process", "(", "self", ")", ":", "color_counter", "=", "1", "degrees", "=", "list", "(", ")", "saturation_degrees", "=", "[", "0", "]", "*", "len", "(", "self", ".", "__data_pointer", ")", "self", ".", "__coloring", "=", "[", "0", "]", "*", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
dsatur.__get_amount_color
! @brief Countes how many nodes has color 'color_number'. @param[in] node_indexes (list): Indexes of graph nodes for checking. @param[in] color_number (uint): Number of color that is searched in nodes. @return (uint) Number found nodes with the specified color 'color_nu...
pyclustering/gcolor/dsatur.py
def __get_amount_color(self, node_indexes, color_number): """! @brief Countes how many nodes has color 'color_number'. @param[in] node_indexes (list): Indexes of graph nodes for checking. @param[in] color_number (uint): Number of color that is searched in nodes. ...
def __get_amount_color(self, node_indexes, color_number): """! @brief Countes how many nodes has color 'color_number'. @param[in] node_indexes (list): Indexes of graph nodes for checking. @param[in] color_number (uint): Number of color that is searched in nodes. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/dsatur.py#L138-L154
[ "def", "__get_amount_color", "(", "self", ",", "node_indexes", ",", "color_number", ")", ":", "color_counter", "=", "0", "for", "index", "in", "node_indexes", ":", "if", "(", "self", ".", "__coloring", "[", "index", "]", "==", "color_number", ")", ":", "co...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
dsatur.__get_neighbors
! @brief Returns indexes of neighbors of the specified node. @param[in] node_index (uint): @return (list) Neighbors of the specified node.
pyclustering/gcolor/dsatur.py
def __get_neighbors(self, node_index): """! @brief Returns indexes of neighbors of the specified node. @param[in] node_index (uint): @return (list) Neighbors of the specified node. """ return [ index for index in range(len(self.__data_p...
def __get_neighbors(self, node_index): """! @brief Returns indexes of neighbors of the specified node. @param[in] node_index (uint): @return (list) Neighbors of the specified node. """ return [ index for index in range(len(self.__data_p...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/dsatur.py#L157-L167
[ "def", "__get_neighbors", "(", "self", ",", "node_index", ")", ":", "return", "[", "index", "for", "index", "in", "range", "(", "len", "(", "self", ".", "__data_pointer", "[", "node_index", "]", ")", ")", "if", "self", ".", "__data_pointer", "[", "node_i...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_visualizer.show_blocks
! @brief Show BANG-blocks (leafs only) in data space. @details BANG-blocks represents grid that was used for clustering process. @param[in] directory (bang_directory): Directory that was created by BANG algorithm during clustering process.
pyclustering/cluster/bang.py
def show_blocks(directory): """! @brief Show BANG-blocks (leafs only) in data space. @details BANG-blocks represents grid that was used for clustering process. @param[in] directory (bang_directory): Directory that was created by BANG algorithm during clustering process. ...
def show_blocks(directory): """! @brief Show BANG-blocks (leafs only) in data space. @details BANG-blocks represents grid that was used for clustering process. @param[in] directory (bang_directory): Directory that was created by BANG algorithm during clustering process. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L59-L85
[ "def", "show_blocks", "(", "directory", ")", ":", "dimension", "=", "len", "(", "directory", ".", "get_data", "(", ")", "[", "0", "]", ")", "amount_canvases", "=", "1", "if", "dimension", ">", "1", ":", "amount_canvases", "=", "int", "(", "dimension", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_visualizer.show_dendrogram
! @brief Display dendrogram of BANG-blocks. @param[in] dendrogram (list): List representation of dendrogram of BANG-blocks. @see bang.get_dendrogram()
pyclustering/cluster/bang.py
def show_dendrogram(dendrogram): """! @brief Display dendrogram of BANG-blocks. @param[in] dendrogram (list): List representation of dendrogram of BANG-blocks. @see bang.get_dendrogram() """ plt.figure() axis = plt.subplot(1, 1, 1) current_...
def show_dendrogram(dendrogram): """! @brief Display dendrogram of BANG-blocks. @param[in] dendrogram (list): List representation of dendrogram of BANG-blocks. @see bang.get_dendrogram() """ plt.figure() axis = plt.subplot(1, 1, 1) current_...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L89-L115
[ "def", "show_dendrogram", "(", "dendrogram", ")", ":", "plt", ".", "figure", "(", ")", "axis", "=", "plt", ".", "subplot", "(", "1", ",", "1", ",", "1", ")", "current_position", "=", "0", "for", "index_cluster", "in", "range", "(", "len", "(", "dendr...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_visualizer.__draw_blocks
! @brief Display BANG-blocks on specified figure. @param[in] ax (Axis): Axis where bang-blocks should be displayed. @param[in] blocks (list): List of blocks that should be displyed. @param[in] pair (tuple): Pair of coordinate index that should be displayed.
pyclustering/cluster/bang.py
def __draw_blocks(ax, blocks, pair): """! @brief Display BANG-blocks on specified figure. @param[in] ax (Axis): Axis where bang-blocks should be displayed. @param[in] blocks (list): List of blocks that should be displyed. @param[in] pair (tuple): Pair of coordinate index t...
def __draw_blocks(ax, blocks, pair): """! @brief Display BANG-blocks on specified figure. @param[in] ax (Axis): Axis where bang-blocks should be displayed. @param[in] blocks (list): List of blocks that should be displyed. @param[in] pair (tuple): Pair of coordinate index t...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L156-L169
[ "def", "__draw_blocks", "(", "ax", ",", "blocks", ",", "pair", ")", ":", "ax", ".", "grid", "(", "False", ")", "density_scale", "=", "blocks", "[", "-", "1", "]", ".", "get_density", "(", ")", "for", "block", "in", "blocks", ":", "bang_visualizer", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_visualizer.__draw_block
! @brief Display BANG-block on the specified ax. @param[in] ax (Axis): Axis where block should be displayed. @param[in] pair (tuple): Pair of coordinate index that should be displayed. @param[in] block (bang_block): BANG-block that should be displayed. @param[in] density_s...
pyclustering/cluster/bang.py
def __draw_block(ax, pair, block, density_scale): """! @brief Display BANG-block on the specified ax. @param[in] ax (Axis): Axis where block should be displayed. @param[in] pair (tuple): Pair of coordinate index that should be displayed. @param[in] block (bang_block): BANG...
def __draw_block(ax, pair, block, density_scale): """! @brief Display BANG-block on the specified ax. @param[in] ax (Axis): Axis where block should be displayed. @param[in] pair (tuple): Pair of coordinate index that should be displayed. @param[in] block (bang_block): BANG...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L173-L198
[ "def", "__draw_block", "(", "ax", ",", "pair", ",", "block", ",", "density_scale", ")", ":", "max_corner", ",", "min_corner", "=", "bang_visualizer", ".", "__get_rectangle_description", "(", "block", ",", "pair", ")", "belong_cluster", "=", "block", ".", "get_...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_visualizer.__get_rectangle_description
! @brief Create rectangle description for block in specific dimension. @param[in] pair (tuple): Pair of coordinate index that should be displayed. @param[in] block (bang_block): BANG-block that should be displayed @return (tuple) Pair of corners that describes rectangle.
pyclustering/cluster/bang.py
def __get_rectangle_description(block, pair): """! @brief Create rectangle description for block in specific dimension. @param[in] pair (tuple): Pair of coordinate index that should be displayed. @param[in] block (bang_block): BANG-block that should be displayed @return ...
def __get_rectangle_description(block, pair): """! @brief Create rectangle description for block in specific dimension. @param[in] pair (tuple): Pair of coordinate index that should be displayed. @param[in] block (bang_block): BANG-block that should be displayed @return ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L202-L220
[ "def", "__get_rectangle_description", "(", "block", ",", "pair", ")", ":", "max_corner", ",", "min_corner", "=", "block", ".", "get_spatial_block", "(", ")", ".", "get_corners", "(", ")", "max_corner", "=", "[", "max_corner", "[", "pair", "[", "0", "]", "]...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_animator.__increment_block
! @brief Increment BANG block safely by updating block index, level and level block.
pyclustering/cluster/bang.py
def __increment_block(self): """! @brief Increment BANG block safely by updating block index, level and level block. """ self.__current_block += 1 if self.__current_block >= len(self.__level_blocks): self.__current_block = 0 self.__current_level +...
def __increment_block(self): """! @brief Increment BANG block safely by updating block index, level and level block. """ self.__current_block += 1 if self.__current_block >= len(self.__level_blocks): self.__current_block = 0 self.__current_level +...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L285-L296
[ "def", "__increment_block", "(", "self", ")", ":", "self", ".", "__current_block", "+=", "1", "if", "self", ".", "__current_block", ">=", "len", "(", "self", ".", "__level_blocks", ")", ":", "self", ".", "__current_block", "=", "0", "self", ".", "__current...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_animator.__draw_block
! @brief Display single BANG block on axis. @param[in] block (bang_block): BANG block that should be displayed. @param[in] block_alpha (double): Transparency level - value of alpha.
pyclustering/cluster/bang.py
def __draw_block(self, block, block_alpha=0.0): """! @brief Display single BANG block on axis. @param[in] block (bang_block): BANG block that should be displayed. @param[in] block_alpha (double): Transparency level - value of alpha. """ max_corner, min_corner = ...
def __draw_block(self, block, block_alpha=0.0): """! @brief Display single BANG block on axis. @param[in] block (bang_block): BANG block that should be displayed. @param[in] block_alpha (double): Transparency level - value of alpha. """ max_corner, min_corner = ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L299-L317
[ "def", "__draw_block", "(", "self", ",", "block", ",", "block_alpha", "=", "0.0", ")", ":", "max_corner", ",", "min_corner", "=", "block", ".", "get_spatial_block", "(", ")", ".", "get_corners", "(", ")", "face_color", "=", "matplotlib", ".", "colors", "."...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_animator.__draw_leaf_density
! @brief Display densities by filling blocks by appropriate colors.
pyclustering/cluster/bang.py
def __draw_leaf_density(self): """! @brief Display densities by filling blocks by appropriate colors. """ leafs = self.__directory.get_leafs() density_scale = leafs[-1].get_density() if density_scale == 0.0: density_scale = 1.0 for block in leafs: ...
def __draw_leaf_density(self): """! @brief Display densities by filling blocks by appropriate colors. """ leafs = self.__directory.get_leafs() density_scale = leafs[-1].get_density() if density_scale == 0.0: density_scale = 1.0 for block in leafs: ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L320-L332
[ "def", "__draw_leaf_density", "(", "self", ")", ":", "leafs", "=", "self", ".", "__directory", ".", "get_leafs", "(", ")", "density_scale", "=", "leafs", "[", "-", "1", "]", ".", "get_density", "(", ")", "if", "density_scale", "==", "0.0", ":", "density_...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_animator.__draw_clusters
! @brief Display clusters and outliers using different colors.
pyclustering/cluster/bang.py
def __draw_clusters(self): """! @brief Display clusters and outliers using different colors. """ data = self.__directory.get_data() for index_cluster in range(len(self.__clusters)): color = color_list.get_color(index_cluster) self.__draw_cluster(d...
def __draw_clusters(self): """! @brief Display clusters and outliers using different colors. """ data = self.__directory.get_data() for index_cluster in range(len(self.__clusters)): color = color_list.get_color(index_cluster) self.__draw_cluster(d...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L335-L345
[ "def", "__draw_clusters", "(", "self", ")", ":", "data", "=", "self", ".", "__directory", ".", "get_data", "(", ")", "for", "index_cluster", "in", "range", "(", "len", "(", "self", ".", "__clusters", ")", ")", ":", "color", "=", "color_list", ".", "get...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_animator.__draw_cluster
! @brief Draw 2-D single cluster on axis using specified color and marker.
pyclustering/cluster/bang.py
def __draw_cluster(self, data, cluster, color, marker): """! @brief Draw 2-D single cluster on axis using specified color and marker. """ for item in cluster: self.__ax.plot(data[item][0], data[item][1], color=color, marker=marker)
def __draw_cluster(self, data, cluster, color, marker): """! @brief Draw 2-D single cluster on axis using specified color and marker. """ for item in cluster: self.__ax.plot(data[item][0], data[item][1], color=color, marker=marker)
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L348-L354
[ "def", "__draw_cluster", "(", "self", ",", "data", ",", "cluster", ",", "color", ",", "marker", ")", ":", "for", "item", "in", "cluster", ":", "self", ".", "__ax", ".", "plot", "(", "data", "[", "item", "]", "[", "0", "]", ",", "data", "[", "item...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_animator.animate
! @brief Animates clustering process that is performed by BANG algorithm. @param[in] animation_velocity (uint): Interval between frames in milliseconds (for run-time animation only). @param[in] movie_fps (uint): Defines frames per second (for rendering movie only). @param[in] movie...
pyclustering/cluster/bang.py
def animate(self, animation_velocity=75, movie_fps=25, movie_filename=None): """! @brief Animates clustering process that is performed by BANG algorithm. @param[in] animation_velocity (uint): Interval between frames in milliseconds (for run-time animation only). @param[in] movie_fp...
def animate(self, animation_velocity=75, movie_fps=25, movie_filename=None): """! @brief Animates clustering process that is performed by BANG algorithm. @param[in] animation_velocity (uint): Interval between frames in milliseconds (for run-time animation only). @param[in] movie_fp...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L357-L411
[ "def", "animate", "(", "self", ",", "animation_velocity", "=", "75", ",", "movie_fps", "=", "25", ",", "movie_filename", "=", "None", ")", ":", "def", "init_frame", "(", ")", ":", "self", ".", "__figure", ".", "clf", "(", ")", "self", ".", "__ax", "=...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_directory.__create_directory
! @brief Create BANG directory as a tree with separate storage for leafs.
pyclustering/cluster/bang.py
def __create_directory(self): """! @brief Create BANG directory as a tree with separate storage for leafs. """ min_corner, max_corner = data_corners(self.__data) data_block = spatial_block(max_corner, min_corner) cache_require = (self.__levels == 1) s...
def __create_directory(self): """! @brief Create BANG directory as a tree with separate storage for leafs. """ min_corner, max_corner = data_corners(self.__data) data_block = spatial_block(max_corner, min_corner) cache_require = (self.__levels == 1) s...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L506-L522
[ "def", "__create_directory", "(", "self", ")", ":", "min_corner", ",", "max_corner", "=", "data_corners", "(", "self", ".", "__data", ")", "data_block", "=", "spatial_block", "(", "max_corner", ",", "min_corner", ")", "cache_require", "=", "(", "self", ".", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_directory.__store_level_blocks
! @brief Store level blocks if observing is enabled. @param[in] level_blocks (list): Created blocks on a new level.
pyclustering/cluster/bang.py
def __store_level_blocks(self, level_blocks): """! @brief Store level blocks if observing is enabled. @param[in] level_blocks (list): Created blocks on a new level. """ self.__size += len(level_blocks) if self.__observe is True: self.__level_blocks....
def __store_level_blocks(self, level_blocks): """! @brief Store level blocks if observing is enabled. @param[in] level_blocks (list): Created blocks on a new level. """ self.__size += len(level_blocks) if self.__observe is True: self.__level_blocks....
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L525-L534
[ "def", "__store_level_blocks", "(", "self", ",", "level_blocks", ")", ":", "self", ".", "__size", "+=", "len", "(", "level_blocks", ")", "if", "self", ".", "__observe", "is", "True", ":", "self", ".", "__level_blocks", ".", "append", "(", "level_blocks", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_directory.__build_directory_levels
! @brief Build levels of direction if amount of level is greater than one.
pyclustering/cluster/bang.py
def __build_directory_levels(self): """! @brief Build levels of direction if amount of level is greater than one. """ previous_level_blocks = [ self.__root ] for level in range(1, self.__levels): previous_level_blocks = self.__build_level(previous_level_bl...
def __build_directory_levels(self): """! @brief Build levels of direction if amount of level is greater than one. """ previous_level_blocks = [ self.__root ] for level in range(1, self.__levels): previous_level_blocks = self.__build_level(previous_level_bl...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L538-L550
[ "def", "__build_directory_levels", "(", "self", ")", ":", "previous_level_blocks", "=", "[", "self", ".", "__root", "]", "for", "level", "in", "range", "(", "1", ",", "self", ".", "__levels", ")", ":", "previous_level_blocks", "=", "self", ".", "__build_leve...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_directory.__build_level
! @brief Build new level of directory. @param[in] previous_level_blocks (list): BANG-blocks on the previous level. @param[in] level (uint): Level number that should be built. @return (list) New block on the specified level.
pyclustering/cluster/bang.py
def __build_level(self, previous_level_blocks, level): """! @brief Build new level of directory. @param[in] previous_level_blocks (list): BANG-blocks on the previous level. @param[in] level (uint): Level number that should be built. @return (list) New block on the specif...
def __build_level(self, previous_level_blocks, level): """! @brief Build new level of directory. @param[in] previous_level_blocks (list): BANG-blocks on the previous level. @param[in] level (uint): Level number that should be built. @return (list) New block on the specif...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L553-L574
[ "def", "__build_level", "(", "self", ",", "previous_level_blocks", ",", "level", ")", ":", "current_level_blocks", "=", "[", "]", "split_dimension", "=", "level", "%", "len", "(", "self", ".", "__data", "[", "0", "]", ")", "cache_require", "=", "(", "level...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_directory.__split_block
! @brief Split specific block in specified dimension. @details Split is not performed for block whose density is lower than threshold value, such blocks are putted to leafs. @param[in] block (bang_block): BANG-block that should be split. @param[in] split_dimensio...
pyclustering/cluster/bang.py
def __split_block(self, block, split_dimension, cache_require, current_level_blocks): """! @brief Split specific block in specified dimension. @details Split is not performed for block whose density is lower than threshold value, such blocks are putted to leafs. ...
def __split_block(self, block, split_dimension, cache_require, current_level_blocks): """! @brief Split specific block in specified dimension. @details Split is not performed for block whose density is lower than threshold value, such blocks are putted to leafs. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L577-L595
[ "def", "__split_block", "(", "self", ",", "block", ",", "split_dimension", ",", "cache_require", ",", "current_level_blocks", ")", ":", "if", "block", ".", "get_density", "(", ")", "<=", "self", ".", "__density_threshold", "or", "len", "(", "block", ")", "<=...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
spatial_block.split
! @brief Split current block into two spatial blocks in specified dimension. @param[in] dimension (uint): Dimension where current block should be split. @return (tuple) Pair of new split blocks from current block.
pyclustering/cluster/bang.py
def split(self, dimension): """! @brief Split current block into two spatial blocks in specified dimension. @param[in] dimension (uint): Dimension where current block should be split. @return (tuple) Pair of new split blocks from current block. """ first_max_c...
def split(self, dimension): """! @brief Split current block into two spatial blocks in specified dimension. @param[in] dimension (uint): Dimension where current block should be split. @return (tuple) Pair of new split blocks from current block. """ first_max_c...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L667-L684
[ "def", "split", "(", "self", ",", "dimension", ")", ":", "first_max_corner", "=", "self", ".", "__max_corner", "[", ":", "]", "second_min_corner", "=", "self", ".", "__min_corner", "[", ":", "]", "split_border", "=", "(", "self", ".", "__max_corner", "[", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
spatial_block.is_neighbor
! @brief Performs calculation to identify whether specified block is neighbor of current block. @details It also considers diagonal blocks as neighbors. @param[in] block (spatial_block): Another block that is check whether it is neighbor. @return (bool) True is blocks are neighbo...
pyclustering/cluster/bang.py
def is_neighbor(self, block): """! @brief Performs calculation to identify whether specified block is neighbor of current block. @details It also considers diagonal blocks as neighbors. @param[in] block (spatial_block): Another block that is check whether it is neighbor. ...
def is_neighbor(self, block): """! @brief Performs calculation to identify whether specified block is neighbor of current block. @details It also considers diagonal blocks as neighbors. @param[in] block (spatial_block): Another block that is check whether it is neighbor. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L687-L705
[ "def", "is_neighbor", "(", "self", ",", "block", ")", ":", "if", "block", "is", "not", "self", ":", "block_max_corner", ",", "_", "=", "block", ".", "get_corners", "(", ")", "dimension", "=", "len", "(", "block_max_corner", ")", "neighborhood_score", "=", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
spatial_block.__calculate_neighborhood
! @brief Calculates neighborhood score that defined whether blocks are neighbors. @param[in] block_max_corner (list): Maximum coordinates of other block. @return (uint) Neighborhood score.
pyclustering/cluster/bang.py
def __calculate_neighborhood(self, block_max_corner): """! @brief Calculates neighborhood score that defined whether blocks are neighbors. @param[in] block_max_corner (list): Maximum coordinates of other block. @return (uint) Neighborhood score. """ dimension ...
def __calculate_neighborhood(self, block_max_corner): """! @brief Calculates neighborhood score that defined whether blocks are neighbors. @param[in] block_max_corner (list): Maximum coordinates of other block. @return (uint) Neighborhood score. """ dimension ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L708-L728
[ "def", "__calculate_neighborhood", "(", "self", ",", "block_max_corner", ")", ":", "dimension", "=", "len", "(", "block_max_corner", ")", "length_edges", "=", "[", "self", ".", "__max_corner", "[", "i", "]", "-", "self", ".", "__min_corner", "[", "i", "]", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
spatial_block.__calculate_volume
! @brief Calculates volume of current spatial block. @details If empty dimension is detected (where all points has the same value) then such dimension is ignored during calculation of volume. @return (double) Volume of current spatial block.
pyclustering/cluster/bang.py
def __calculate_volume(self): """! @brief Calculates volume of current spatial block. @details If empty dimension is detected (where all points has the same value) then such dimension is ignored during calculation of volume. @return (double) Volume of current spa...
def __calculate_volume(self): """! @brief Calculates volume of current spatial block. @details If empty dimension is detected (where all points has the same value) then such dimension is ignored during calculation of volume. @return (double) Volume of current spa...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L731-L749
[ "def", "__calculate_volume", "(", "self", ")", ":", "volume", "=", "0.0", "for", "i", "in", "range", "(", "0", ",", "len", "(", "self", ".", "__max_corner", ")", ")", ":", "side_length", "=", "self", ".", "__max_corner", "[", "i", "]", "-", "self", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_block.split
! @brief Split BANG-block into two new blocks in specified dimension. @param[in] split_dimension (uint): Dimension where block should be split. @param[in] cache_points (bool): If True then covered points are cached. Used for leaf blocks. @return (tuple) Pair of BANG-block that we...
pyclustering/cluster/bang.py
def split(self, split_dimension, cache_points): """! @brief Split BANG-block into two new blocks in specified dimension. @param[in] split_dimension (uint): Dimension where block should be split. @param[in] cache_points (bool): If True then covered points are cached. Used for leaf b...
def split(self, split_dimension, cache_points): """! @brief Split BANG-block into two new blocks in specified dimension. @param[in] split_dimension (uint): Dimension where block should be split. @param[in] cache_points (bool): If True then covered points are cached. Used for leaf b...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L874-L892
[ "def", "split", "(", "self", ",", "split_dimension", ",", "cache_points", ")", ":", "left_region_number", "=", "self", ".", "__region_number", "right_region_number", "=", "self", ".", "__region_number", "+", "2", "**", "self", ".", "__level", "first_spatial_block"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_block.__calculate_density
! @brief Calculates BANG-block density. @param[in] amount_points (uint): Amount of points in block. @return (double) BANG-block density.
pyclustering/cluster/bang.py
def __calculate_density(self, amount_points): """! @brief Calculates BANG-block density. @param[in] amount_points (uint): Amount of points in block. @return (double) BANG-block density. """ volume = self.__spatial_block.get_volume() if volume != 0.0: ...
def __calculate_density(self, amount_points): """! @brief Calculates BANG-block density. @param[in] amount_points (uint): Amount of points in block. @return (double) BANG-block density. """ volume = self.__spatial_block.get_volume() if volume != 0.0: ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L895-L908
[ "def", "__calculate_density", "(", "self", ",", "amount_points", ")", ":", "volume", "=", "self", ".", "__spatial_block", ".", "get_volume", "(", ")", "if", "volume", "!=", "0.0", ":", "return", "amount_points", "/", "volume", "return", "0.0" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_block.__get_amount_points
! @brief Count covered points by the BANG-block and if cache is enable then covered points are stored. @return (uint) Amount of covered points.
pyclustering/cluster/bang.py
def __get_amount_points(self): """! @brief Count covered points by the BANG-block and if cache is enable then covered points are stored. @return (uint) Amount of covered points. """ amount = 0 for index in range(len(self.__data)): if self.__data[ind...
def __get_amount_points(self): """! @brief Count covered points by the BANG-block and if cache is enable then covered points are stored. @return (uint) Amount of covered points. """ amount = 0 for index in range(len(self.__data)): if self.__data[ind...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L911-L924
[ "def", "__get_amount_points", "(", "self", ")", ":", "amount", "=", "0", "for", "index", "in", "range", "(", "len", "(", "self", ".", "__data", ")", ")", ":", "if", "self", ".", "__data", "[", "index", "]", "in", "self", ".", "__spatial_block", ":", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_block.__cache_covered_data
! @brief Cache covered data.
pyclustering/cluster/bang.py
def __cache_covered_data(self): """! @brief Cache covered data. """ self.__cache_points = True self.__points = [] for index_point in range(len(self.__data)): if self.__data[index_point] in self.__spatial_block: self.__cache_point(in...
def __cache_covered_data(self): """! @brief Cache covered data. """ self.__cache_points = True self.__points = [] for index_point in range(len(self.__data)): if self.__data[index_point] in self.__spatial_block: self.__cache_point(in...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L927-L937
[ "def", "__cache_covered_data", "(", "self", ")", ":", "self", ".", "__cache_points", "=", "True", "self", ".", "__points", "=", "[", "]", "for", "index_point", "in", "range", "(", "len", "(", "self", ".", "__data", ")", ")", ":", "if", "self", ".", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang_block.__cache_point
! @brief Store index points. @param[in] index (uint): Index point that should be stored.
pyclustering/cluster/bang.py
def __cache_point(self, index): """! @brief Store index points. @param[in] index (uint): Index point that should be stored. """ if self.__cache_points: if self.__points is None: self.__points = [] self.__points.append(index)
def __cache_point(self, index): """! @brief Store index points. @param[in] index (uint): Index point that should be stored. """ if self.__cache_points: if self.__points is None: self.__points = [] self.__points.append(index)
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L940-L951
[ "def", "__cache_point", "(", "self", ",", "index", ")", ":", "if", "self", ".", "__cache_points", ":", "if", "self", ".", "__points", "is", "None", ":", "self", ".", "__points", "=", "[", "]", "self", ".", "__points", ".", "append", "(", "index", ")"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.process
! @brief Performs clustering process in line with rules of BANG clustering algorithm. @return (bang) Returns itself (BANG instance). @see get_clusters() @see get_noise() @see get_directory() @see get_dendrogram()
pyclustering/cluster/bang.py
def process(self): """! @brief Performs clustering process in line with rules of BANG clustering algorithm. @return (bang) Returns itself (BANG instance). @see get_clusters() @see get_noise() @see get_directory() @see get_dendrogram() """ ...
def process(self): """! @brief Performs clustering process in line with rules of BANG clustering algorithm. @return (bang) Returns itself (BANG instance). @see get_clusters() @see get_noise() @see get_directory() @see get_dendrogram() """ ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1039-L1056
[ "def", "process", "(", "self", ")", ":", "self", ".", "__directory", "=", "bang_directory", "(", "self", ".", "__data", ",", "self", ".", "__levels", ",", "density_threshold", "=", "self", ".", "__density_threshold", ",", "amount_threshold", "=", "self", "."...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.__validate_arguments
! @brief Check input arguments of BANG algorithm and if one of them is not correct then appropriate exception is thrown.
pyclustering/cluster/bang.py
def __validate_arguments(self): """! @brief Check input arguments of BANG algorithm and if one of them is not correct then appropriate exception is thrown. """ if self.__levels <= 0: raise ValueError("Incorrect amount of levels '%d'. Level value should...
def __validate_arguments(self): """! @brief Check input arguments of BANG algorithm and if one of them is not correct then appropriate exception is thrown. """ if self.__levels <= 0: raise ValueError("Incorrect amount of levels '%d'. Level value should...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1128-L1141
[ "def", "__validate_arguments", "(", "self", ")", ":", "if", "self", ".", "__levels", "<=", "0", ":", "raise", "ValueError", "(", "\"Incorrect amount of levels '%d'. Level value should be greater than 0.\"", "%", "self", ".", "__levels", ")", "if", "len", "(", "self"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.__allocate_clusters
! @brief Performs cluster allocation using leafs of tree in BANG directory (the smallest cells).
pyclustering/cluster/bang.py
def __allocate_clusters(self): """! @brief Performs cluster allocation using leafs of tree in BANG directory (the smallest cells). """ leaf_blocks = self.__directory.get_leafs() unhandled_block_indexes = set([i for i in range(len(leaf_blocks)) if leaf_blocks[i].get_density...
def __allocate_clusters(self): """! @brief Performs cluster allocation using leafs of tree in BANG directory (the smallest cells). """ leaf_blocks = self.__directory.get_leafs() unhandled_block_indexes = set([i for i in range(len(leaf_blocks)) if leaf_blocks[i].get_density...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1144-L1164
[ "def", "__allocate_clusters", "(", "self", ")", ":", "leaf_blocks", "=", "self", ".", "__directory", ".", "get_leafs", "(", ")", "unhandled_block_indexes", "=", "set", "(", "[", "i", "for", "i", "in", "range", "(", "len", "(", "leaf_blocks", ")", ")", "i...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.__expand_cluster_block
! @brief Expand cluster from specific block that is considered as a central block. @param[in] block (bang_block): Block that is considered as a central block for cluster. @param[in] cluster_index (uint): Index of cluster that is assigned to blocks that forms new cluster. @param[in]...
pyclustering/cluster/bang.py
def __expand_cluster_block(self, block, cluster_index, leaf_blocks, unhandled_block_indexes): """! @brief Expand cluster from specific block that is considered as a central block. @param[in] block (bang_block): Block that is considered as a central block for cluster. @param[in] clu...
def __expand_cluster_block(self, block, cluster_index, leaf_blocks, unhandled_block_indexes): """! @brief Expand cluster from specific block that is considered as a central block. @param[in] block (bang_block): Block that is considered as a central block for cluster. @param[in] clu...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1167-L1191
[ "def", "__expand_cluster_block", "(", "self", ",", "block", ",", "cluster_index", ",", "leaf_blocks", ",", "unhandled_block_indexes", ")", ":", "block", ".", "set_cluster", "(", "cluster_index", ")", "self", ".", "__update_cluster_dendrogram", "(", "cluster_index", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.__store_clustering_results
! @brief Stores clustering results in a convenient way. @param[in] amount_clusters (uint): Amount of cluster that was allocated during processing. @param[in] leaf_blocks (list): Leaf BANG-blocks (the smallest cells).
pyclustering/cluster/bang.py
def __store_clustering_results(self, amount_clusters, leaf_blocks): """! @brief Stores clustering results in a convenient way. @param[in] amount_clusters (uint): Amount of cluster that was allocated during processing. @param[in] leaf_blocks (list): Leaf BANG-blocks (the smallest ce...
def __store_clustering_results(self, amount_clusters, leaf_blocks): """! @brief Stores clustering results in a convenient way. @param[in] amount_clusters (uint): Amount of cluster that was allocated during processing. @param[in] leaf_blocks (list): Leaf BANG-blocks (the smallest ce...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1194-L1212
[ "def", "__store_clustering_results", "(", "self", ",", "amount_clusters", ",", "leaf_blocks", ")", ":", "self", ".", "__clusters", "=", "[", "[", "]", "for", "_", "in", "range", "(", "amount_clusters", ")", "]", "for", "block", "in", "leaf_blocks", ":", "i...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.__find_block_center
! @brief Search block that is cluster center for new cluster. @return (bang_block) Central block for new cluster, if cluster is not found then None value is returned.
pyclustering/cluster/bang.py
def __find_block_center(self, level_blocks, unhandled_block_indexes): """! @brief Search block that is cluster center for new cluster. @return (bang_block) Central block for new cluster, if cluster is not found then None value is returned. """ for i in reversed(range(len...
def __find_block_center(self, level_blocks, unhandled_block_indexes): """! @brief Search block that is cluster center for new cluster. @return (bang_block) Central block for new cluster, if cluster is not found then None value is returned. """ for i in reversed(range(len...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1215-L1230
[ "def", "__find_block_center", "(", "self", ",", "level_blocks", ",", "unhandled_block_indexes", ")", ":", "for", "i", "in", "reversed", "(", "range", "(", "len", "(", "level_blocks", ")", ")", ")", ":", "if", "level_blocks", "[", "i", "]", ".", "get_densit...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.__find_block_neighbors
! @brief Search block neighbors that are parts of new clusters (density is greater than threshold and that are not cluster members yet), other neighbors are ignored. @param[in] block (bang_block): BANG-block for which neighbors should be found (which can be part of cluster). ...
pyclustering/cluster/bang.py
def __find_block_neighbors(self, block, level_blocks, unhandled_block_indexes): """! @brief Search block neighbors that are parts of new clusters (density is greater than threshold and that are not cluster members yet), other neighbors are ignored. @param[in] block (bang_bl...
def __find_block_neighbors(self, block, level_blocks, unhandled_block_indexes): """! @brief Search block neighbors that are parts of new clusters (density is greater than threshold and that are not cluster members yet), other neighbors are ignored. @param[in] block (bang_bl...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1233-L1260
[ "def", "__find_block_neighbors", "(", "self", ",", "block", ",", "level_blocks", ",", "unhandled_block_indexes", ")", ":", "neighbors", "=", "[", "]", "handled_block_indexes", "=", "[", "]", "for", "unhandled_index", "in", "unhandled_block_indexes", ":", "if", "bl...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
bang.__update_cluster_dendrogram
! @brief Append clustered blocks to dendrogram. @param[in] index_cluster (uint): Cluster index that was assigned to blocks. @param[in] blocks (list): Blocks that were clustered.
pyclustering/cluster/bang.py
def __update_cluster_dendrogram(self, index_cluster, blocks): """! @brief Append clustered blocks to dendrogram. @param[in] index_cluster (uint): Cluster index that was assigned to blocks. @param[in] blocks (list): Blocks that were clustered. """ if len(self.__d...
def __update_cluster_dendrogram(self, index_cluster, blocks): """! @brief Append clustered blocks to dendrogram. @param[in] index_cluster (uint): Cluster index that was assigned to blocks. @param[in] blocks (list): Blocks that were clustered. """ if len(self.__d...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/bang.py#L1263-L1275
[ "def", "__update_cluster_dendrogram", "(", "self", ",", "index_cluster", ",", "blocks", ")", ":", "if", "len", "(", "self", ".", "__dendrogram", ")", "<=", "index_cluster", ":", "self", ".", "__dendrogram", ".", "append", "(", "[", "]", ")", "blocks", "=",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hysteresis_analyser.allocate_map_coloring
! @brief Returns list of color indexes that are assigned to each object from input data space accordingly. @param[in] tolerance (double): Tolerance level that define maximal difference between outputs of oscillators in one synchronous ensemble. @param[in] threshold_steps (uint): Number ...
pyclustering/gcolor/hysteresis.py
def allocate_map_coloring(self, tolerance, threshold_steps = 10): """! @brief Returns list of color indexes that are assigned to each object from input data space accordingly. @param[in] tolerance (double): Tolerance level that define maximal difference between outputs of oscillators in...
def allocate_map_coloring(self, tolerance, threshold_steps = 10): """! @brief Returns list of color indexes that are assigned to each object from input data space accordingly. @param[in] tolerance (double): Tolerance level that define maximal difference between outputs of oscillators in...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/hysteresis.py#L67-L91
[ "def", "allocate_map_coloring", "(", "self", ",", "tolerance", ",", "threshold_steps", "=", "10", ")", ":", "clusters", "=", "self", ".", "allocate_clusters", "(", "tolerance", ",", "threshold_steps", ")", "coloring_map", "=", "[", "0", "]", "*", "len", "(",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hysteresisgcolor.process
! @brief Peforms graph coloring analysis using simulation of the oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of simulation. @param[in] collect_dynamic (bool): Specified requirement to collect whole d...
pyclustering/gcolor/hysteresis.py
def process(self, steps, time, collect_dynamic=True): """! @brief Peforms graph coloring analysis using simulation of the oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of simulation. @param[in]...
def process(self, steps, time, collect_dynamic=True): """! @brief Peforms graph coloring analysis using simulation of the oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of simulation. @param[in]...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/hysteresis.py#L161-L174
[ "def", "process", "(", "self", ",", "steps", ",", "time", ",", "collect_dynamic", "=", "True", ")", ":", "output_dynamic", "=", "super", "(", ")", ".", "simulate", "(", "steps", ",", "time", ",", "collect_dynamic", "=", "collect_dynamic", ")", "return", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
rock.process
! @brief Performs cluster analysis in line with rules of ROCK algorithm. @remark Results of clustering can be obtained using corresponding get methods. @see get_clusters()
pyclustering/cluster/rock.py
def process(self): """! @brief Performs cluster analysis in line with rules of ROCK algorithm. @remark Results of clustering can be obtained using corresponding get methods. @see get_clusters() """ # TODO: (Not related to spec...
def process(self): """! @brief Performs cluster analysis in line with rules of ROCK algorithm. @remark Results of clustering can be obtained using corresponding get methods. @see get_clusters() """ # TODO: (Not related to spec...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/rock.py#L97-L123
[ "def", "process", "(", "self", ")", ":", "# TODO: (Not related to specification, just idea) First iteration should be investigated. Euclidean distance should be used for clustering between two \r", "# points and rock algorithm between clusters because we consider non-categorical samples. But it is req...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
rock.__find_pair_clusters
! @brief Returns pair of clusters that are best candidates for merging in line with goodness measure. The pair of clusters for which the above goodness measure is maximum is the best pair of clusters to be merged. @param[in] clusters (list): List of clusters that have ...
pyclustering/cluster/rock.py
def __find_pair_clusters(self, clusters): """! @brief Returns pair of clusters that are best candidates for merging in line with goodness measure. The pair of clusters for which the above goodness measure is maximum is the best pair of clusters to be merged. @...
def __find_pair_clusters(self, clusters): """! @brief Returns pair of clusters that are best candidates for merging in line with goodness measure. The pair of clusters for which the above goodness measure is maximum is the best pair of clusters to be merged. @...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/rock.py#L152-L174
[ "def", "__find_pair_clusters", "(", "self", ",", "clusters", ")", ":", "maximum_goodness", "=", "0.0", "cluster_indexes", "=", "[", "-", "1", ",", "-", "1", "]", "for", "i", "in", "range", "(", "0", ",", "len", "(", "clusters", ")", ")", ":", "for", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
rock.__calculate_links
! @brief Returns number of link between two clusters. @details Link between objects (points) exists only if distance between them less than connectivity radius. @param[in] cluster1 (list): The first cluster. @param[in] cluster2 (list): The second cluster. ...
pyclustering/cluster/rock.py
def __calculate_links(self, cluster1, cluster2): """! @brief Returns number of link between two clusters. @details Link between objects (points) exists only if distance between them less than connectivity radius. @param[in] cluster1 (list): The first cluster. @par...
def __calculate_links(self, cluster1, cluster2): """! @brief Returns number of link between two clusters. @details Link between objects (points) exists only if distance between them less than connectivity radius. @param[in] cluster1 (list): The first cluster. @par...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/rock.py#L177-L195
[ "def", "__calculate_links", "(", "self", ",", "cluster1", ",", "cluster2", ")", ":", "number_links", "=", "0", "for", "index1", "in", "cluster1", ":", "for", "index2", "in", "cluster2", ":", "number_links", "+=", "self", ".", "__adjacency_matrix", "[", "inde...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
rock.__create_adjacency_matrix
! @brief Creates 2D adjacency matrix (list of lists) where each element described existence of link between points (means that points are neighbors).
pyclustering/cluster/rock.py
def __create_adjacency_matrix(self): """! @brief Creates 2D adjacency matrix (list of lists) where each element described existence of link between points (means that points are neighbors). """ size_data = len(self.__pointer_data); self.__adjace...
def __create_adjacency_matrix(self): """! @brief Creates 2D adjacency matrix (list of lists) where each element described existence of link between points (means that points are neighbors). """ size_data = len(self.__pointer_data); self.__adjace...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/rock.py#L198-L212
[ "def", "__create_adjacency_matrix", "(", "self", ")", ":", "size_data", "=", "len", "(", "self", ".", "__pointer_data", ")", "self", ".", "__adjacency_matrix", "=", "[", "[", "0", "for", "i", "in", "range", "(", "size_data", ")", "]", "for", "j", "in", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
rock.__calculate_goodness
! @brief Calculates coefficient 'goodness measurement' between two clusters. The coefficient defines level of suitability of clusters for merging. @param[in] cluster1 (list): The first cluster. @param[in] cluster2 (list): The second cluster. @return Goodness measu...
pyclustering/cluster/rock.py
def __calculate_goodness(self, cluster1, cluster2): """! @brief Calculates coefficient 'goodness measurement' between two clusters. The coefficient defines level of suitability of clusters for merging. @param[in] cluster1 (list): The first cluster. @param[in] cluster2 (list...
def __calculate_goodness(self, cluster1, cluster2): """! @brief Calculates coefficient 'goodness measurement' between two clusters. The coefficient defines level of suitability of clusters for merging. @param[in] cluster1 (list): The first cluster. @param[in] cluster2 (list...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/rock.py#L216-L230
[ "def", "__calculate_goodness", "(", "self", ",", "cluster1", ",", "cluster2", ")", ":", "number_links", "=", "self", ".", "__calculate_links", "(", "cluster1", ",", "cluster2", ")", "devider", "=", "(", "len", "(", "cluster1", ")", "+", "len", "(", "cluste...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__process_by_ccore
! @brief Performs processing using CCORE (C/C++ part of pyclustering library).
pyclustering/cluster/silhouette.py
def __process_by_ccore(self): """! @brief Performs processing using CCORE (C/C++ part of pyclustering library). """ ccore_metric = metric_wrapper.create_instance(self.__metric) self.__score = wrapper.silhoeutte(self.__data, self.__clusters, ccore_metric.get_pointer())
def __process_by_ccore(self): """! @brief Performs processing using CCORE (C/C++ part of pyclustering library). """ ccore_metric = metric_wrapper.create_instance(self.__metric) self.__score = wrapper.silhoeutte(self.__data, self.__clusters, ccore_metric.get_pointer())
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L132-L138
[ "def", "__process_by_ccore", "(", "self", ")", ":", "ccore_metric", "=", "metric_wrapper", ".", "create_instance", "(", "self", ".", "__metric", ")", "self", ".", "__score", "=", "wrapper", ".", "silhoeutte", "(", "self", ".", "__data", ",", "self", ".", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__process_by_python
! @brief Performs processing using python code.
pyclustering/cluster/silhouette.py
def __process_by_python(self): """! @brief Performs processing using python code. """ for index_cluster in range(len(self.__clusters)): for index_point in self.__clusters[index_cluster]: self.__score[index_point] = self.__calculate_score(index_point, i...
def __process_by_python(self): """! @brief Performs processing using python code. """ for index_cluster in range(len(self.__clusters)): for index_point in self.__clusters[index_cluster]: self.__score[index_point] = self.__calculate_score(index_point, i...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L141-L148
[ "def", "__process_by_python", "(", "self", ")", ":", "for", "index_cluster", "in", "range", "(", "len", "(", "self", ".", "__clusters", ")", ")", ":", "for", "index_point", "in", "self", ".", "__clusters", "[", "index_cluster", "]", ":", "self", ".", "__...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__calculate_score
! @brief Calculates Silhouette score for the specific object defined by index_point. @param[in] index_point (uint): Index point from input data for which Silhouette score should be calculated. @param[in] index_cluster (uint): Index cluster to which the point belongs to. @return (...
pyclustering/cluster/silhouette.py
def __calculate_score(self, index_point, index_cluster): """! @brief Calculates Silhouette score for the specific object defined by index_point. @param[in] index_point (uint): Index point from input data for which Silhouette score should be calculated. @param[in] index_cluster (uin...
def __calculate_score(self, index_point, index_cluster): """! @brief Calculates Silhouette score for the specific object defined by index_point. @param[in] index_point (uint): Index point from input data for which Silhouette score should be calculated. @param[in] index_cluster (uin...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L161-L176
[ "def", "__calculate_score", "(", "self", ",", "index_point", ",", "index_cluster", ")", ":", "difference", "=", "self", ".", "__calculate_dataset_difference", "(", "index_point", ")", "a_score", "=", "self", ".", "__calculate_within_cluster_score", "(", "index_cluster...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__calculate_within_cluster_score
! @brief Calculates 'A' score for the specific object in cluster to which it belongs to. @param[in] index_point (uint): Index point from input data for which 'A' score should be calculated. @param[in] index_cluster (uint): Index cluster to which the point is belong to. @return (f...
pyclustering/cluster/silhouette.py
def __calculate_within_cluster_score(self, index_cluster, difference): """! @brief Calculates 'A' score for the specific object in cluster to which it belongs to. @param[in] index_point (uint): Index point from input data for which 'A' score should be calculated. @param[in] index_c...
def __calculate_within_cluster_score(self, index_cluster, difference): """! @brief Calculates 'A' score for the specific object in cluster to which it belongs to. @param[in] index_point (uint): Index point from input data for which 'A' score should be calculated. @param[in] index_c...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L179-L193
[ "def", "__calculate_within_cluster_score", "(", "self", ",", "index_cluster", ",", "difference", ")", ":", "score", "=", "self", ".", "__calculate_cluster_difference", "(", "index_cluster", ",", "difference", ")", "if", "len", "(", "self", ".", "__clusters", "[", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__calculate_cluster_score
! @brief Calculates 'B*' score for the specific object for specific cluster. @param[in] index_point (uint): Index point from input data for which 'B*' score should be calculated. @param[in] index_cluster (uint): Index cluster to which the point is belong to. @return (float) 'B*' ...
pyclustering/cluster/silhouette.py
def __calculate_cluster_score(self, index_cluster, difference): """! @brief Calculates 'B*' score for the specific object for specific cluster. @param[in] index_point (uint): Index point from input data for which 'B*' score should be calculated. @param[in] index_cluster (uint): Ind...
def __calculate_cluster_score(self, index_cluster, difference): """! @brief Calculates 'B*' score for the specific object for specific cluster. @param[in] index_point (uint): Index point from input data for which 'B*' score should be calculated. @param[in] index_cluster (uint): Ind...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L196-L208
[ "def", "__calculate_cluster_score", "(", "self", ",", "index_cluster", ",", "difference", ")", ":", "score", "=", "self", ".", "__calculate_cluster_difference", "(", "index_cluster", ",", "difference", ")", "return", "score", "/", "len", "(", "self", ".", "__clu...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__caclulate_optimal_neighbor_cluster_score
! @brief Calculates 'B' score for the specific object for the nearest cluster. @param[in] index_point (uint): Index point from input data for which 'B' score should be calculated. @param[in] index_cluster (uint): Index cluster to which the point is belong to. @return (float) 'B' ...
pyclustering/cluster/silhouette.py
def __caclulate_optimal_neighbor_cluster_score(self, index_cluster, difference): """! @brief Calculates 'B' score for the specific object for the nearest cluster. @param[in] index_point (uint): Index point from input data for which 'B' score should be calculated. @param[in] index_c...
def __caclulate_optimal_neighbor_cluster_score(self, index_cluster, difference): """! @brief Calculates 'B' score for the specific object for the nearest cluster. @param[in] index_point (uint): Index point from input data for which 'B' score should be calculated. @param[in] index_c...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L211-L232
[ "def", "__caclulate_optimal_neighbor_cluster_score", "(", "self", ",", "index_cluster", ",", "difference", ")", ":", "optimal_score", "=", "float", "(", "'inf'", ")", "for", "index_neighbor_cluster", "in", "range", "(", "len", "(", "self", ".", "__clusters", ")", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__calculate_cluster_difference
! @brief Calculates distance from each object in specified cluster to specified object. @param[in] index_point (uint): Index point for which difference is calculated. @return (list) Distance from specified object to each object from input data in specified cluster.
pyclustering/cluster/silhouette.py
def __calculate_cluster_difference(self, index_cluster, difference): """! @brief Calculates distance from each object in specified cluster to specified object. @param[in] index_point (uint): Index point for which difference is calculated. @return (list) Distance from specified ob...
def __calculate_cluster_difference(self, index_cluster, difference): """! @brief Calculates distance from each object in specified cluster to specified object. @param[in] index_point (uint): Index point for which difference is calculated. @return (list) Distance from specified ob...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L235-L248
[ "def", "__calculate_cluster_difference", "(", "self", ",", "index_cluster", ",", "difference", ")", ":", "cluster_difference", "=", "0.0", "for", "index_point", "in", "self", ".", "__clusters", "[", "index_cluster", "]", ":", "cluster_difference", "+=", "difference"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette.__calculate_dataset_difference
! @brief Calculate distance from each object to specified object. @param[in] index_point (uint): Index point for which difference with other points is calculated. @return (list) Distance to each object from input data from the specified.
pyclustering/cluster/silhouette.py
def __calculate_dataset_difference(self, index_point): """! @brief Calculate distance from each object to specified object. @param[in] index_point (uint): Index point for which difference with other points is calculated. @return (list) Distance to each object from input data from...
def __calculate_dataset_difference(self, index_point): """! @brief Calculate distance from each object to specified object. @param[in] index_point (uint): Index point for which difference with other points is calculated. @return (list) Distance to each object from input data from...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L251-L266
[ "def", "__calculate_dataset_difference", "(", "self", ",", "index_point", ")", ":", "if", "self", ".", "__metric", ".", "get_type", "(", ")", "!=", "type_metric", ".", "USER_DEFINED", ":", "dataset_differences", "=", "self", ".", "__metric", "(", "self", ".", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette_ksearch_type.get_type
! @brief Returns algorithm type that corresponds to specified enumeration value. @return (type) Algorithm type for cluster analysis.
pyclustering/cluster/silhouette.py
def get_type(self): """! @brief Returns algorithm type that corresponds to specified enumeration value. @return (type) Algorithm type for cluster analysis. """ if self == silhouette_ksearch_type.KMEANS: return kmeans elif self == silhouette_ksearch_...
def get_type(self): """! @brief Returns algorithm type that corresponds to specified enumeration value. @return (type) Algorithm type for cluster analysis. """ if self == silhouette_ksearch_type.KMEANS: return kmeans elif self == silhouette_ksearch_...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L287-L301
[ "def", "get_type", "(", "self", ")", ":", "if", "self", "==", "silhouette_ksearch_type", ".", "KMEANS", ":", "return", "kmeans", "elif", "self", "==", "silhouette_ksearch_type", ".", "KMEDIANS", ":", "return", "kmedians", "elif", "self", "==", "silhouette_ksearc...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette_ksearch.__process_by_ccore
! @brief Performs processing using CCORE (C/C++ part of pyclustering library).
pyclustering/cluster/silhouette.py
def __process_by_ccore(self): """! @brief Performs processing using CCORE (C/C++ part of pyclustering library). """ results = wrapper.silhoeutte_ksearch(self.__data, self.__kmin, self.__kmax, self.__algorithm) self.__amount = results[0] self.__score = results[1]...
def __process_by_ccore(self): """! @brief Performs processing using CCORE (C/C++ part of pyclustering library). """ results = wrapper.silhoeutte_ksearch(self.__data, self.__kmin, self.__kmax, self.__algorithm) self.__amount = results[0] self.__score = results[1]...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L401-L410
[ "def", "__process_by_ccore", "(", "self", ")", ":", "results", "=", "wrapper", ".", "silhoeutte_ksearch", "(", "self", ".", "__data", ",", "self", ".", "__kmin", ",", "self", ".", "__kmax", ",", "self", ".", "__algorithm", ")", "self", ".", "__amount", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette_ksearch.__process_by_python
! @brief Performs processing using python code.
pyclustering/cluster/silhouette.py
def __process_by_python(self): """! @brief Performs processing using python code. """ self.__scores = {} for k in range(self.__kmin, self.__kmax): clusters = self.__calculate_clusters(k) if len(clusters) != k: self.__scores[k] =...
def __process_by_python(self): """! @brief Performs processing using python code. """ self.__scores = {} for k in range(self.__kmin, self.__kmax): clusters = self.__calculate_clusters(k) if len(clusters) != k: self.__scores[k] =...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L413-L432
[ "def", "__process_by_python", "(", "self", ")", ":", "self", ".", "__scores", "=", "{", "}", "for", "k", "in", "range", "(", "self", ".", "__kmin", ",", "self", ".", "__kmax", ")", ":", "clusters", "=", "self", ".", "__calculate_clusters", "(", "k", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette_ksearch.__calculate_clusters
! @brief Performs cluster analysis using specified K value. @param[in] k (uint): Amount of clusters that should be allocated. @return (array_like) Allocated clusters.
pyclustering/cluster/silhouette.py
def __calculate_clusters(self, k): """! @brief Performs cluster analysis using specified K value. @param[in] k (uint): Amount of clusters that should be allocated. @return (array_like) Allocated clusters. """ initial_values = kmeans_plusplus_initializer(self._...
def __calculate_clusters(self, k): """! @brief Performs cluster analysis using specified K value. @param[in] k (uint): Amount of clusters that should be allocated. @return (array_like) Allocated clusters. """ initial_values = kmeans_plusplus_initializer(self._...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L471-L482
[ "def", "__calculate_clusters", "(", "self", ",", "k", ")", ":", "initial_values", "=", "kmeans_plusplus_initializer", "(", "self", ".", "__data", ",", "k", ")", ".", "initialize", "(", "return_index", "=", "self", ".", "__return_index", ")", "algorithm_type", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
silhouette_ksearch.__verify_arguments
! @brief Checks algorithm's arguments and if some of them is incorrect then exception is thrown.
pyclustering/cluster/silhouette.py
def __verify_arguments(self): """! @brief Checks algorithm's arguments and if some of them is incorrect then exception is thrown. """ if self.__kmax > len(self.__data): raise ValueError("K max value '" + str(self.__kmax) + "' is bigger than amount of objects '" + ...
def __verify_arguments(self): """! @brief Checks algorithm's arguments and if some of them is incorrect then exception is thrown. """ if self.__kmax > len(self.__data): raise ValueError("K max value '" + str(self.__kmax) + "' is bigger than amount of objects '" + ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/silhouette.py#L485-L496
[ "def", "__verify_arguments", "(", "self", ")", ":", "if", "self", ".", "__kmax", ">", "len", "(", "self", ".", "__data", ")", ":", "raise", "ValueError", "(", "\"K max value '\"", "+", "str", "(", "self", ".", "__kmax", ")", "+", "\"' is bigger than amount...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans_observer.notify
! @brief This method is called by K-Means algorithm to notify about changes. @param[in] clusters (array_like): Allocated clusters by K-Means algorithm. @param[in] centers (array_like): Allocated centers by K-Means algorithm.
pyclustering/cluster/kmeans.py
def notify(self, clusters, centers): """! @brief This method is called by K-Means algorithm to notify about changes. @param[in] clusters (array_like): Allocated clusters by K-Means algorithm. @param[in] centers (array_like): Allocated centers by K-Means algorithm. ...
def notify(self, clusters, centers): """! @brief This method is called by K-Means algorithm to notify about changes. @param[in] clusters (array_like): Allocated clusters by K-Means algorithm. @param[in] centers (array_like): Allocated centers by K-Means algorithm. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L75-L84
[ "def", "notify", "(", "self", ",", "clusters", ",", "centers", ")", ":", "self", ".", "__evolution_clusters", ".", "append", "(", "clusters", ")", "self", ".", "__evolution_centers", ".", "append", "(", "centers", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans_visualizer.show_clusters
! @brief Display K-Means clustering results. @param[in] sample (list): Dataset that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. @param[in] centers (array_like): Centers that were allocated by the algorithm. ...
pyclustering/cluster/kmeans.py
def show_clusters(sample, clusters, centers, initial_centers = None, **kwargs): """! @brief Display K-Means clustering results. @param[in] sample (list): Dataset that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. ...
def show_clusters(sample, clusters, centers, initial_centers = None, **kwargs): """! @brief Display K-Means clustering results. @param[in] sample (list): Dataset that was used for clustering. @param[in] clusters (array_like): Clusters that were allocated by the algorithm. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L144-L181
[ "def", "show_clusters", "(", "sample", ",", "clusters", ",", "centers", ",", "initial_centers", "=", "None", ",", "*", "*", "kwargs", ")", ":", "visualizer", "=", "cluster_visualizer", "(", ")", "visualizer", ".", "append_clusters", "(", "clusters", ",", "sa...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans_visualizer.animate_cluster_allocation
! @brief Animates clustering process that is performed by K-Means algorithm. @param[in] data (list): Dataset that is used for clustering. @param[in] observer (kmeans_observer): EM observer that was used for collection information about clustering process. @param[in] animation_veloc...
pyclustering/cluster/kmeans.py
def animate_cluster_allocation(data, observer, animation_velocity = 500, movie_fps = 1, save_movie = None): """! @brief Animates clustering process that is performed by K-Means algorithm. @param[in] data (list): Dataset that is used for clustering. @param[in] observer (kmeans_obser...
def animate_cluster_allocation(data, observer, animation_velocity = 500, movie_fps = 1, save_movie = None): """! @brief Animates clustering process that is performed by K-Means algorithm. @param[in] data (list): Dataset that is used for clustering. @param[in] observer (kmeans_obser...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L232-L268
[ "def", "animate_cluster_allocation", "(", "data", ",", "observer", ",", "animation_velocity", "=", "500", ",", "movie_fps", "=", "1", ",", "save_movie", "=", "None", ")", ":", "figure", "=", "plt", ".", "figure", "(", ")", "def", "init_frame", "(", ")", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans.process
! @brief Performs cluster analysis in line with rules of K-Means algorithm. @return (kmeans) Returns itself (K-Means instance). @remark Results of clustering can be obtained using corresponding get methods. @see get_clusters() @see get_centers()
pyclustering/cluster/kmeans.py
def process(self): """! @brief Performs cluster analysis in line with rules of K-Means algorithm. @return (kmeans) Returns itself (K-Means instance). @remark Results of clustering can be obtained using corresponding get methods. @see get_clusters() @se...
def process(self): """! @brief Performs cluster analysis in line with rules of K-Means algorithm. @return (kmeans) Returns itself (K-Means instance). @remark Results of clustering can be obtained using corresponding get methods. @see get_clusters() @se...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L365-L386
[ "def", "process", "(", "self", ")", ":", "if", "len", "(", "self", ".", "__pointer_data", "[", "0", "]", ")", "!=", "len", "(", "self", ".", "__centers", "[", "0", "]", ")", ":", "raise", "ValueError", "(", "\"Dimension of the input data and dimension of t...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans.__process_by_ccore
! @brief Performs cluster analysis using CCORE (C/C++ part of pyclustering library).
pyclustering/cluster/kmeans.py
def __process_by_ccore(self): """! @brief Performs cluster analysis using CCORE (C/C++ part of pyclustering library). """ ccore_metric = metric_wrapper.create_instance(self.__metric) results = wrapper.kmeans(self.__pointer_data, self.__centers, self.__tolerance, self.__i...
def __process_by_ccore(self): """! @brief Performs cluster analysis using CCORE (C/C++ part of pyclustering library). """ ccore_metric = metric_wrapper.create_instance(self.__metric) results = wrapper.kmeans(self.__pointer_data, self.__centers, self.__tolerance, self.__i...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L389-L404
[ "def", "__process_by_ccore", "(", "self", ")", ":", "ccore_metric", "=", "metric_wrapper", ".", "create_instance", "(", "self", ".", "__metric", ")", "results", "=", "wrapper", ".", "kmeans", "(", "self", ".", "__pointer_data", ",", "self", ".", "__centers", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans.__process_by_python
! @brief Performs cluster analysis using python code.
pyclustering/cluster/kmeans.py
def __process_by_python(self): """! @brief Performs cluster analysis using python code. """ maximum_change = float('inf') iteration = 0 if self.__observer is not None: initial_clusters = self.__update_clusters() self.__observer.notify...
def __process_by_python(self): """! @brief Performs cluster analysis using python code. """ maximum_change = float('inf') iteration = 0 if self.__observer is not None: initial_clusters = self.__update_clusters() self.__observer.notify...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L407-L432
[ "def", "__process_by_python", "(", "self", ")", ":", "maximum_change", "=", "float", "(", "'inf'", ")", "iteration", "=", "0", "if", "self", ".", "__observer", "is", "not", "None", ":", "initial_clusters", "=", "self", ".", "__update_clusters", "(", ")", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans.get_centers
! @brief Returns list of centers of allocated clusters. @see process() @see get_clusters()
pyclustering/cluster/kmeans.py
def get_centers(self): """! @brief Returns list of centers of allocated clusters. @see process() @see get_clusters() """ if isinstance(self.__centers, list): return self.__centers return self.__centers.tolist()
def get_centers(self): """! @brief Returns list of centers of allocated clusters. @see process() @see get_clusters() """ if isinstance(self.__centers, list): return self.__centers return self.__centers.tolist()
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L447-L459
[ "def", "get_centers", "(", "self", ")", ":", "if", "isinstance", "(", "self", ".", "__centers", ",", "list", ")", ":", "return", "self", ".", "__centers", "return", "self", ".", "__centers", ".", "tolist", "(", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
kmeans.__update_clusters
! @brief Calculate distance (in line with specified metric) to each point from the each cluster. Nearest points are captured by according clusters and as a result clusters are updated. @return (list) Updated clusters as list of clusters. Each cluster contains indexes of obje...
pyclustering/cluster/kmeans.py
def __update_clusters(self): """! @brief Calculate distance (in line with specified metric) to each point from the each cluster. Nearest points are captured by according clusters and as a result clusters are updated. @return (list) Updated clusters as list of cluste...
def __update_clusters(self): """! @brief Calculate distance (in line with specified metric) to each point from the each cluster. Nearest points are captured by according clusters and as a result clusters are updated. @return (list) Updated clusters as list of cluste...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/kmeans.py#L489-L509
[ "def", "__update_clusters", "(", "self", ")", ":", "clusters", "=", "[", "[", "]", "for", "_", "in", "range", "(", "len", "(", "self", ".", "__centers", ")", ")", "]", "dataset_differences", "=", "self", ".", "__calculate_dataset_difference", "(", "len", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0