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
read_graph
! @brief Read graph from file in GRPR format. @param[in] filename (string): Path to file with graph in GRPR format. @return (graph) Graph that is read from file.
pyclustering/utils/graph.py
def read_graph(filename): """! @brief Read graph from file in GRPR format. @param[in] filename (string): Path to file with graph in GRPR format. @return (graph) Graph that is read from file. """ file = open(filename, 'r'); comments = ""; space_descr ...
def read_graph(filename): """! @brief Read graph from file in GRPR format. @param[in] filename (string): Path to file with graph in GRPR format. @return (graph) Graph that is read from file. """ file = open(filename, 'r'); comments = ""; space_descr ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/graph.py#L138-L228
[ "def", "read_graph", "(", "filename", ")", ":", "file", "=", "open", "(", "filename", ",", "'r'", ")", "comments", "=", "\"\"", "space_descr", "=", "[", "]", "data", "=", "[", "]", "data_type", "=", "None", "map_data_repr", "=", "dict", "(", ")", "# ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
draw_graph
! @brief Draw graph. @param[in] graph_instance (graph): Graph that should be drawn. @param[in] map_coloring (list): List of color indexes for each vertex. Size of this list should be equal to size of graph (number of vertices). If it's not specified (None) than grap...
pyclustering/utils/graph.py
def draw_graph(graph_instance, map_coloring = None): """! @brief Draw graph. @param[in] graph_instance (graph): Graph that should be drawn. @param[in] map_coloring (list): List of color indexes for each vertex. Size of this list should be equal to size of graph (number of vertices). ...
def draw_graph(graph_instance, map_coloring = None): """! @brief Draw graph. @param[in] graph_instance (graph): Graph that should be drawn. @param[in] map_coloring (list): List of color indexes for each vertex. Size of this list should be equal to size of graph (number of vertices). ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/utils/graph.py#L232-L297
[ "def", "draw_graph", "(", "graph_instance", ",", "map_coloring", "=", "None", ")", ":", "if", "(", "graph_instance", ".", "space_description", "is", "None", ")", ":", "raise", "NameError", "(", "\"The graph haven't got representation in space\"", ")", "if", "(", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
fcm.process
! @brief Performs cluster analysis in line with Fuzzy C-Means algorithm. @see get_clusters() @see get_centers() @see get_membership()
pyclustering/cluster/fcm.py
def process(self): """! @brief Performs cluster analysis in line with Fuzzy C-Means algorithm. @see get_clusters() @see get_centers() @see get_membership() """ if self.__ccore is True: self.__process_by_ccore() else: s...
def process(self): """! @brief Performs cluster analysis in line with Fuzzy C-Means algorithm. @see get_clusters() @see get_centers() @see get_membership() """ if self.__ccore is True: self.__process_by_ccore() else: s...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/fcm.py#L141-L155
[ "def", "process", "(", "self", ")", ":", "if", "self", ".", "__ccore", "is", "True", ":", "self", ".", "__process_by_ccore", "(", ")", "else", ":", "self", ".", "__process_by_python", "(", ")", "return", "self" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
fcm.__process_by_ccore
! @brief Performs cluster analysis using C/C++ implementation.
pyclustering/cluster/fcm.py
def __process_by_ccore(self): """! @brief Performs cluster analysis using C/C++ implementation. """ result = wrapper.fcm_algorithm(self.__data, self.__centers, self.__m, self.__tolerance, self.__itermax) self.__clusters = result[wrapper.fcm_package_indexer.INDEX_CLUSTERS...
def __process_by_ccore(self): """! @brief Performs cluster analysis using C/C++ implementation. """ result = wrapper.fcm_algorithm(self.__data, self.__centers, self.__m, self.__tolerance, self.__itermax) self.__clusters = result[wrapper.fcm_package_indexer.INDEX_CLUSTERS...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/fcm.py#L204-L213
[ "def", "__process_by_ccore", "(", "self", ")", ":", "result", "=", "wrapper", ".", "fcm_algorithm", "(", "self", ".", "__data", ",", "self", ".", "__centers", ",", "self", ".", "__m", ",", "self", ".", "__tolerance", ",", "self", ".", "__itermax", ")", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
fcm.__process_by_python
! @brief Performs cluster analysis using Python implementation.
pyclustering/cluster/fcm.py
def __process_by_python(self): """! @brief Performs cluster analysis using Python implementation. """ self.__data = numpy.array(self.__data) self.__centers = numpy.array(self.__centers) self.__membership = numpy.zeros((len(self.__data), len(self.__centers))) ...
def __process_by_python(self): """! @brief Performs cluster analysis using Python implementation. """ self.__data = numpy.array(self.__data) self.__centers = numpy.array(self.__centers) self.__membership = numpy.zeros((len(self.__data), len(self.__centers))) ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/fcm.py#L216-L237
[ "def", "__process_by_python", "(", "self", ")", ":", "self", ".", "__data", "=", "numpy", ".", "array", "(", "self", ".", "__data", ")", "self", ".", "__centers", "=", "numpy", ".", "array", "(", "self", ".", "__centers", ")", "self", ".", "__membershi...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
fcm.__calculate_centers
! @brief Calculate center using membership of each cluster. @return (list) Updated clusters as list of clusters. Each cluster contains indexes of objects from data. @return (numpy.array) Updated centers.
pyclustering/cluster/fcm.py
def __calculate_centers(self): """! @brief Calculate center using membership of each cluster. @return (list) Updated clusters as list of clusters. Each cluster contains indexes of objects from data. @return (numpy.array) Updated centers. """ dimension = self._...
def __calculate_centers(self): """! @brief Calculate center using membership of each cluster. @return (list) Updated clusters as list of clusters. Each cluster contains indexes of objects from data. @return (numpy.array) Updated centers. """ dimension = self._...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/fcm.py#L240-L256
[ "def", "__calculate_centers", "(", "self", ")", ":", "dimension", "=", "self", ".", "__data", ".", "shape", "[", "1", "]", "centers", "=", "numpy", ".", "zeros", "(", "(", "len", "(", "self", ".", "__centers", ")", ",", "dimension", ")", ")", "for", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
fcm.__update_membership
! @brief Update membership for each point in line with current cluster centers.
pyclustering/cluster/fcm.py
def __update_membership(self): """! @brief Update membership for each point in line with current cluster centers. """ data_difference = numpy.zeros((len(self.__centers), len(self.__data))) for i in range(len(self.__centers)): data_difference[i] = numpy.sum(n...
def __update_membership(self): """! @brief Update membership for each point in line with current cluster centers. """ data_difference = numpy.zeros((len(self.__centers), len(self.__data))) for i in range(len(self.__centers)): data_difference[i] = numpy.sum(n...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/fcm.py#L259-L276
[ "def", "__update_membership", "(", "self", ")", ":", "data_difference", "=", "numpy", ".", "zeros", "(", "(", "len", "(", "self", ".", "__centers", ")", ",", "len", "(", "self", ".", "__data", ")", ")", ")", "for", "i", "in", "range", "(", "len", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
fcm.__calculate_changes
! @brief Calculate changes between centers. @return (float) Maximum change between centers.
pyclustering/cluster/fcm.py
def __calculate_changes(self, updated_centers): """! @brief Calculate changes between centers. @return (float) Maximum change between centers. """ changes = numpy.sum(numpy.square(self.__centers - updated_centers), axis=1).T return numpy.max(changes)
def __calculate_changes(self, updated_centers): """! @brief Calculate changes between centers. @return (float) Maximum change between centers. """ changes = numpy.sum(numpy.square(self.__centers - updated_centers), axis=1).T return numpy.max(changes)
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/fcm.py#L279-L287
[ "def", "__calculate_changes", "(", "self", ",", "updated_centers", ")", ":", "changes", "=", "numpy", ".", "sum", "(", "numpy", ".", "square", "(", "self", ".", "__centers", "-", "updated_centers", ")", ",", "axis", "=", "1", ")", ".", "T", "return", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
ga_observer.collect_global_best
! @brief Stores the best chromosome and its fitness function's value. @param[in] best_chromosome (list): The best chromosome that were observed. @param[in] best_fitness_function (float): Fitness function value of the best chromosome.
pyclustering/cluster/ga.py
def collect_global_best(self, best_chromosome, best_fitness_function): """! @brief Stores the best chromosome and its fitness function's value. @param[in] best_chromosome (list): The best chromosome that were observed. @param[in] best_fitness_function (float): Fitness function v...
def collect_global_best(self, best_chromosome, best_fitness_function): """! @brief Stores the best chromosome and its fitness function's value. @param[in] best_chromosome (list): The best chromosome that were observed. @param[in] best_fitness_function (float): Fitness function v...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L87-L100
[ "def", "collect_global_best", "(", "self", ",", "best_chromosome", ",", "best_fitness_function", ")", ":", "if", "not", "self", ".", "_need_global_best", ":", "return", "self", ".", "_global_best_result", "[", "'chromosome'", "]", ".", "append", "(", "best_chromos...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
ga_observer.collect_population_best
! @brief Stores the best chromosome for current specific iteration and its fitness function's value. @param[in] best_chromosome (list): The best chromosome on specific iteration. @param[in] best_fitness_function (float): Fitness function value of the chromosome.
pyclustering/cluster/ga.py
def collect_population_best(self, best_chromosome, best_fitness_function): """! @brief Stores the best chromosome for current specific iteration and its fitness function's value. @param[in] best_chromosome (list): The best chromosome on specific iteration. @param[in] best_fitnes...
def collect_population_best(self, best_chromosome, best_fitness_function): """! @brief Stores the best chromosome for current specific iteration and its fitness function's value. @param[in] best_chromosome (list): The best chromosome on specific iteration. @param[in] best_fitnes...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L103-L116
[ "def", "collect_population_best", "(", "self", ",", "best_chromosome", ",", "best_fitness_function", ")", ":", "if", "not", "self", ".", "_need_population_best", ":", "return", "self", ".", "_best_population_result", "[", "'chromosome'", "]", ".", "append", "(", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
ga_observer.collect_mean
! @brief Stores average value of fitness function among chromosomes on specific iteration. @param[in] fitness_functions (float): Average value of fitness functions among chromosomes.
pyclustering/cluster/ga.py
def collect_mean(self, fitness_functions): """! @brief Stores average value of fitness function among chromosomes on specific iteration. @param[in] fitness_functions (float): Average value of fitness functions among chromosomes. """ if not self._need_mean_ff: ...
def collect_mean(self, fitness_functions): """! @brief Stores average value of fitness function among chromosomes on specific iteration. @param[in] fitness_functions (float): Average value of fitness functions among chromosomes. """ if not self._need_mean_ff: ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L119-L130
[ "def", "collect_mean", "(", "self", ",", "fitness_functions", ")", ":", "if", "not", "self", ".", "_need_mean_ff", ":", "return", "self", ".", "_mean_ff_result", ".", "append", "(", "np", ".", "mean", "(", "fitness_functions", ")", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
ga_visualizer.show_evolution
! @brief Displays evolution of fitness function for the best chromosome, for the current best chromosome and average value among all chromosomes. @param[in] observer (ga_observer): Genetic algorithm observer that was used for collecting evolution in the algorithm and ...
pyclustering/cluster/ga.py
def show_evolution(observer, start_iteration = 0, stop_iteration=None, ax=None, display=True): """! @brief Displays evolution of fitness function for the best chromosome, for the current best chromosome and average value among all chromosomes. @param[in] observer (ga_obs...
def show_evolution(observer, start_iteration = 0, stop_iteration=None, ax=None, display=True): """! @brief Displays evolution of fitness function for the best chromosome, for the current best chromosome and average value among all chromosomes. @param[in] observer (ga_obs...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L205-L244
[ "def", "show_evolution", "(", "observer", ",", "start_iteration", "=", "0", ",", "stop_iteration", "=", "None", ",", "ax", "=", "None", ",", "display", "=", "True", ")", ":", "if", "(", "ax", "is", "None", ")", ":", "_", ",", "ax", "=", "plt", ".",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
ga_visualizer.show_clusters
! @brief Shows allocated clusters by the genetic algorithm. @param[in] data (list): Input data that was used for clustering process by the algorithm. @param[in] observer (ga_observer): Observer that was used for collection information about clustering process. @param[in] marker ...
pyclustering/cluster/ga.py
def show_clusters(data, observer, marker='.', markersize=None): """! @brief Shows allocated clusters by the genetic algorithm. @param[in] data (list): Input data that was used for clustering process by the algorithm. @param[in] observer (ga_observer): Observer that was used for ...
def show_clusters(data, observer, marker='.', markersize=None): """! @brief Shows allocated clusters by the genetic algorithm. @param[in] data (list): Input data that was used for clustering process by the algorithm. @param[in] observer (ga_observer): Observer that was used for ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L248-L272
[ "def", "show_clusters", "(", "data", ",", "observer", ",", "marker", "=", "'.'", ",", "markersize", "=", "None", ")", ":", "figure", "=", "plt", ".", "figure", "(", ")", "ax1", "=", "figure", ".", "add_subplot", "(", "121", ")", "clusters", "=", "ga_...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
ga_visualizer.animate_cluster_allocation
! @brief Animate clustering process of genetic clustering algorithm. @details This method can be also used for rendering movie of clustering process and 'ffmpeg' is required for that purpuse. @param[in] data (list): Input data that was used for clustering process by the algorithm. ...
pyclustering/cluster/ga.py
def animate_cluster_allocation(data, observer, animation_velocity=75, movie_fps=5, save_movie=None): """! @brief Animate clustering process of genetic clustering algorithm. @details This method can be also used for rendering movie of clustering process and 'ffmpeg' is required for that purpuse. ...
def animate_cluster_allocation(data, observer, animation_velocity=75, movie_fps=5, save_movie=None): """! @brief Animate clustering process of genetic clustering algorithm. @details This method can be also used for rendering movie of clustering process and 'ffmpeg' is required for that purpuse. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L276-L322
[ "def", "animate_cluster_allocation", "(", "data", ",", "observer", ",", "animation_velocity", "=", "75", ",", "movie_fps", "=", "5", ",", "save_movie", "=", "None", ")", ":", "figure", "=", "plt", ".", "figure", "(", ")", "def", "init_frame", "(", ")", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm.process
! @brief Perform clustering procedure in line with rule of genetic clustering algorithm. @see get_clusters()
pyclustering/cluster/ga.py
def process(self): """! @brief Perform clustering procedure in line with rule of genetic clustering algorithm. @see get_clusters() """ # Initialize population chromosomes = self._init_population(self._count_clusters, len(self._data), self._chromosome_co...
def process(self): """! @brief Perform clustering procedure in line with rule of genetic clustering algorithm. @see get_clusters() """ # Initialize population chromosomes = self._init_population(self._count_clusters, len(self._data), self._chromosome_co...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L430-L482
[ "def", "process", "(", "self", ")", ":", "# Initialize population", "chromosomes", "=", "self", ".", "_init_population", "(", "self", ".", "_count_clusters", ",", "len", "(", "self", ".", "_data", ")", ",", "self", ".", "_chromosome_count", ")", "# Initialize ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._select
! @brief Performs selection procedure where new chromosomes are calculated. @param[in] chromosomes (numpy.array): Chromosomes
pyclustering/cluster/ga.py
def _select(chromosomes, data, count_clusters, select_coeff): """! @brief Performs selection procedure where new chromosomes are calculated. @param[in] chromosomes (numpy.array): Chromosomes """ # Calc centers centres = ga_math.get_centres(chromosomes,...
def _select(chromosomes, data, count_clusters, select_coeff): """! @brief Performs selection procedure where new chromosomes are calculated. @param[in] chromosomes (numpy.array): Chromosomes """ # Calc centers centres = ga_math.get_centres(chromosomes,...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L507-L534
[ "def", "_select", "(", "chromosomes", ",", "data", ",", "count_clusters", ",", "select_coeff", ")", ":", "# Calc centers", "centres", "=", "ga_math", ".", "get_centres", "(", "chromosomes", ",", "data", ",", "count_clusters", ")", "# Calc fitness functions", "fitn...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._crossover
! @brief Crossover procedure.
pyclustering/cluster/ga.py
def _crossover(chromosomes): """! @brief Crossover procedure. """ # Get pairs to Crossover pairs_to_crossover = np.array(range(len(chromosomes))) # Set random pairs np.random.shuffle(pairs_to_crossover) # Index offset ( pairs_to_crossover split...
def _crossover(chromosomes): """! @brief Crossover procedure. """ # Get pairs to Crossover pairs_to_crossover = np.array(range(len(chromosomes))) # Set random pairs np.random.shuffle(pairs_to_crossover) # Index offset ( pairs_to_crossover split...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L538-L562
[ "def", "_crossover", "(", "chromosomes", ")", ":", "# Get pairs to Crossover", "pairs_to_crossover", "=", "np", ".", "array", "(", "range", "(", "len", "(", "chromosomes", ")", ")", ")", "# Set random pairs", "np", ".", "random", ".", "shuffle", "(", "pairs_to...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._mutation
! @brief Mutation procedure.
pyclustering/cluster/ga.py
def _mutation(chromosomes, count_clusters, count_gen_for_mutation, coeff_mutation_count): """! @brief Mutation procedure. """ # Count gens in Chromosome count_gens = len(chromosomes[0]) # Get random chromosomes for mutation random_idx_chromosomes = np.a...
def _mutation(chromosomes, count_clusters, count_gen_for_mutation, coeff_mutation_count): """! @brief Mutation procedure. """ # Count gens in Chromosome count_gens = len(chromosomes[0]) # Get random chromosomes for mutation random_idx_chromosomes = np.a...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L566-L589
[ "def", "_mutation", "(", "chromosomes", ",", "count_clusters", ",", "count_gen_for_mutation", ",", "coeff_mutation_count", ")", ":", "# Count gens in Chromosome", "count_gens", "=", "len", "(", "chromosomes", "[", "0", "]", ")", "# Get random chromosomes for mutation", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._crossover_a_pair
! @brief Crossovers a pair of chromosomes. @param[in] chromosome_1 (numpy.array): The first chromosome for crossover. @param[in] chromosome_2 (numpy.array): The second chromosome for crossover. @param[in] mask (numpy.array): Crossover mask that defines which genes should be swap...
pyclustering/cluster/ga.py
def _crossover_a_pair(chromosome_1, chromosome_2, mask): """! @brief Crossovers a pair of chromosomes. @param[in] chromosome_1 (numpy.array): The first chromosome for crossover. @param[in] chromosome_2 (numpy.array): The second chromosome for crossover. @param[in] mask (...
def _crossover_a_pair(chromosome_1, chromosome_2, mask): """! @brief Crossovers a pair of chromosomes. @param[in] chromosome_1 (numpy.array): The first chromosome for crossover. @param[in] chromosome_2 (numpy.array): The second chromosome for crossover. @param[in] mask (...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L593-L607
[ "def", "_crossover_a_pair", "(", "chromosome_1", ",", "chromosome_2", ",", "mask", ")", ":", "for", "_idx", "in", "range", "(", "len", "(", "chromosome_1", ")", ")", ":", "if", "mask", "[", "_idx", "]", "==", "1", ":", "# Swap values", "chromosome_1", "[...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._get_crossover_mask
! @brief Crossover mask to crossover a pair of chromosomes. @param[in] mask_length (uint): Length of the mask.
pyclustering/cluster/ga.py
def _get_crossover_mask(mask_length): """! @brief Crossover mask to crossover a pair of chromosomes. @param[in] mask_length (uint): Length of the mask. """ # Initialize mask mask = np.zeros(mask_length) # Set a half of array to 1 mask[:...
def _get_crossover_mask(mask_length): """! @brief Crossover mask to crossover a pair of chromosomes. @param[in] mask_length (uint): Length of the mask. """ # Initialize mask mask = np.zeros(mask_length) # Set a half of array to 1 mask[:...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L611-L628
[ "def", "_get_crossover_mask", "(", "mask_length", ")", ":", "# Initialize mask", "mask", "=", "np", ".", "zeros", "(", "mask_length", ")", "# Set a half of array to 1", "mask", "[", ":", "int", "(", "int", "(", "mask_length", ")", "/", "2", ")", "]", "=", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._init_population
! @brief Returns first population as a uniform random choice. @param[in] count_clusters (uint): Amount of clusters that should be allocated. @param[in] count_data (uint): Data size that is used for clustering process. @param[in] chromosome_count (uint):Amount of chromosome that ...
pyclustering/cluster/ga.py
def _init_population(count_clusters, count_data, chromosome_count): """! @brief Returns first population as a uniform random choice. @param[in] count_clusters (uint): Amount of clusters that should be allocated. @param[in] count_data (uint): Data size that is used for clustering...
def _init_population(count_clusters, count_data, chromosome_count): """! @brief Returns first population as a uniform random choice. @param[in] count_clusters (uint): Amount of clusters that should be allocated. @param[in] count_data (uint): Data size that is used for clustering...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L632-L644
[ "def", "_init_population", "(", "count_clusters", ",", "count_data", ",", "chromosome_count", ")", ":", "population", "=", "np", ".", "random", ".", "randint", "(", "count_clusters", ",", "size", "=", "(", "chromosome_count", ",", "count_data", ")", ")", "retu...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._get_best_chromosome
! @brief Returns the current best chromosome. @param[in] chromosomes (list): Chromosomes that are used for searching. @param[in] data (list): Input data that is used for clustering process. @param[in] count_clusters (uint): Amount of clusters that should be allocated. ...
pyclustering/cluster/ga.py
def _get_best_chromosome(chromosomes, data, count_clusters): """! @brief Returns the current best chromosome. @param[in] chromosomes (list): Chromosomes that are used for searching. @param[in] data (list): Input data that is used for clustering process. @param[in] count_...
def _get_best_chromosome(chromosomes, data, count_clusters): """! @brief Returns the current best chromosome. @param[in] chromosomes (list): Chromosomes that are used for searching. @param[in] data (list): Input data that is used for clustering process. @param[in] count_...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L648-L671
[ "def", "_get_best_chromosome", "(", "chromosomes", ",", "data", ",", "count_clusters", ")", ":", "# Calc centers", "centres", "=", "ga_math", ".", "get_centres", "(", "chromosomes", ",", "data", ",", "count_clusters", ")", "# Calc Fitness functions", "fitness_function...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
genetic_algorithm._calc_fitness_function
! @brief Calculate fitness function values for chromosomes. @param[in] centres (list): Cluster centers. @param[in] data (list): Input data that is used for clustering process. @param[in] chromosomes (list): Chromosomes whose fitness function's values are calculated. ...
pyclustering/cluster/ga.py
def _calc_fitness_function(centres, data, chromosomes): """! @brief Calculate fitness function values for chromosomes. @param[in] centres (list): Cluster centers. @param[in] data (list): Input data that is used for clustering process. @param[in] chromosomes (list): Chrom...
def _calc_fitness_function(centres, data, chromosomes): """! @brief Calculate fitness function values for chromosomes. @param[in] centres (list): Cluster centers. @param[in] data (list): Input data that is used for clustering process. @param[in] chromosomes (list): Chrom...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/ga.py#L675-L706
[ "def", "_calc_fitness_function", "(", "centres", ",", "data", ",", "chromosomes", ")", ":", "# Get count of chromosomes and clusters", "count_chromosome", "=", "len", "(", "chromosomes", ")", "# Initialize fitness function values", "fitness_function", "=", "np", ".", "zer...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfentry.get_distance
! @brief Calculates distance between two clusters in line with measurement type. @details In case of usage CENTROID_EUCLIDIAN_DISTANCE square euclidian distance will be returned. Square root should be taken from the result for obtaining real euclidian distance between ...
pyclustering/container/cftree.py
def get_distance(self, entry, type_measurement): """! @brief Calculates distance between two clusters in line with measurement type. @details In case of usage CENTROID_EUCLIDIAN_DISTANCE square euclidian distance will be returned. Square root should be taken from t...
def get_distance(self, entry, type_measurement): """! @brief Calculates distance between two clusters in line with measurement type. @details In case of usage CENTROID_EUCLIDIAN_DISTANCE square euclidian distance will be returned. Square root should be taken from t...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L226-L257
[ "def", "get_distance", "(", "self", ",", "entry", ",", "type_measurement", ")", ":", "if", "(", "type_measurement", "is", "measurement_type", ".", "CENTROID_EUCLIDEAN_DISTANCE", ")", ":", "return", "euclidean_distance_square", "(", "entry", ".", "get_centroid", "(",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfentry.get_centroid
! @brief Calculates centroid of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (list) Centroid of cluster that is represented by the entry.
pyclustering/container/cftree.py
def get_centroid(self): """! @brief Calculates centroid of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (list) Centroid of cluster that is represented by the entry. """ ...
def get_centroid(self): """! @brief Calculates centroid of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (list) Centroid of cluster that is represented by the entry. """ ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L260-L276
[ "def", "get_centroid", "(", "self", ")", ":", "if", "(", "self", ".", "__centroid", "is", "not", "None", ")", ":", "return", "self", ".", "__centroid", "self", ".", "__centroid", "=", "[", "0", "]", "*", "len", "(", "self", ".", "linear_sum", ")", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfentry.get_radius
! @brief Calculates radius of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (double) Radius of cluster that is represented by the entry.
pyclustering/container/cftree.py
def get_radius(self): """! @brief Calculates radius of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (double) Radius of cluster that is represented by the entry. """ ...
def get_radius(self): """! @brief Calculates radius of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (double) Radius of cluster that is represented by the entry. """ ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L279-L306
[ "def", "get_radius", "(", "self", ")", ":", "if", "(", "self", ".", "__radius", "is", "not", "None", ")", ":", "return", "self", ".", "__radius", "centroid", "=", "self", ".", "get_centroid", "(", ")", "radius_part_1", "=", "self", ".", "square_sum", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfentry.get_diameter
! @brief Calculates diameter of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (double) Diameter of cluster that is represented by the entry.
pyclustering/container/cftree.py
def get_diameter(self): """! @brief Calculates diameter of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (double) Diameter of cluster that is represented by the entry. """ ...
def get_diameter(self): """! @brief Calculates diameter of cluster that is represented by the entry. @details It's calculated once when it's requested after the last changes. @return (double) Diameter of cluster that is represented by the entry. """ ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L309-L328
[ "def", "get_diameter", "(", "self", ")", ":", "if", "(", "self", ".", "__diameter", "is", "not", "None", ")", ":", "return", "self", ".", "__diameter", "diameter_part", "=", "0.0", "if", "(", "type", "(", "self", ".", "linear_sum", ")", "==", "list", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfentry.__get_average_inter_cluster_distance
! @brief Calculates average inter cluster distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Average inter cluster distance.
pyclustering/container/cftree.py
def __get_average_inter_cluster_distance(self, entry): """! @brief Calculates average inter cluster distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Average inter...
def __get_average_inter_cluster_distance(self, entry): """! @brief Calculates average inter cluster distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Average inter...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L331-L343
[ "def", "__get_average_inter_cluster_distance", "(", "self", ",", "entry", ")", ":", "linear_part_distance", "=", "sum", "(", "list_math_multiplication", "(", "self", ".", "linear_sum", ",", "entry", ".", "linear_sum", ")", ")", "return", "(", "(", "entry", ".", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfentry.__get_average_intra_cluster_distance
! @brief Calculates average intra cluster distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Average intra cluster distance.
pyclustering/container/cftree.py
def __get_average_intra_cluster_distance(self, entry): """! @brief Calculates average intra cluster distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Average intra...
def __get_average_intra_cluster_distance(self, entry): """! @brief Calculates average intra cluster distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Average intra...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L346-L363
[ "def", "__get_average_intra_cluster_distance", "(", "self", ",", "entry", ")", ":", "linear_part_first", "=", "list_math_addition", "(", "self", ".", "linear_sum", ",", "entry", ".", "linear_sum", ")", "linear_part_second", "=", "linear_part_first", "linear_part_distanc...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfentry.__get_variance_increase_distance
! @brief Calculates variance increase distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Variance increase distance.
pyclustering/container/cftree.py
def __get_variance_increase_distance(self, entry): """! @brief Calculates variance increase distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Variance increase dis...
def __get_variance_increase_distance(self, entry): """! @brief Calculates variance increase distance between current and specified clusters. @param[in] entry (cfentry): Clustering feature to which distance should be obtained. @return (double) Variance increase dis...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L366-L388
[ "def", "__get_variance_increase_distance", "(", "self", ",", "entry", ")", ":", "linear_part_12", "=", "list_math_addition", "(", "self", ".", "linear_sum", ",", "entry", ".", "linear_sum", ")", "variance_part_first", "=", "(", "self", ".", "square_sum", "+", "e...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cfnode.get_distance
! @brief Calculates distance between nodes in line with specified type measurement. @param[in] node (cfnode): CF-node that is used for calculation distance to the current node. @param[in] type_measurement (measurement_type): Measurement type that is used for calculation distance. ...
pyclustering/container/cftree.py
def get_distance(self, node, type_measurement): """! @brief Calculates distance between nodes in line with specified type measurement. @param[in] node (cfnode): CF-node that is used for calculation distance to the current node. @param[in] type_measurement (measurement_type)...
def get_distance(self, node, type_measurement): """! @brief Calculates distance between nodes in line with specified type measurement. @param[in] node (cfnode): CF-node that is used for calculation distance to the current node. @param[in] type_measurement (measurement_type)...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L437-L448
[ "def", "get_distance", "(", "self", ",", "node", ",", "type_measurement", ")", ":", "return", "self", ".", "feature", ".", "get_distance", "(", "node", ".", "feature", ",", "type_measurement", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
non_leaf_node.insert_successor
! @brief Insert successor to the node. @param[in] successor (cfnode): Successor for adding.
pyclustering/container/cftree.py
def insert_successor(self, successor): """! @brief Insert successor to the node. @param[in] successor (cfnode): Successor for adding. """ self.feature += successor.feature; self.successors.append(successor); successor...
def insert_successor(self, successor): """! @brief Insert successor to the node. @param[in] successor (cfnode): Successor for adding. """ self.feature += successor.feature; self.successors.append(successor); successor...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L501-L512
[ "def", "insert_successor", "(", "self", ",", "successor", ")", ":", "self", ".", "feature", "+=", "successor", ".", "feature", "self", ".", "successors", ".", "append", "(", "successor", ")", "successor", ".", "parent", "=", "self" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
non_leaf_node.remove_successor
! @brief Remove successor from the node. @param[in] successor (cfnode): Successor for removing.
pyclustering/container/cftree.py
def remove_successor(self, successor): """! @brief Remove successor from the node. @param[in] successor (cfnode): Successor for removing. """ self.feature -= successor.feature; self.successors.append(successor); succe...
def remove_successor(self, successor): """! @brief Remove successor from the node. @param[in] successor (cfnode): Successor for removing. """ self.feature -= successor.feature; self.successors.append(successor); succe...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L515-L526
[ "def", "remove_successor", "(", "self", ",", "successor", ")", ":", "self", ".", "feature", "-=", "successor", ".", "feature", "self", ".", "successors", ".", "append", "(", "successor", ")", "successor", ".", "parent", "=", "self" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
non_leaf_node.merge
! @brief Merge non-leaf node to the current. @param[in] node (non_leaf_node): Non-leaf node that should be merged with current.
pyclustering/container/cftree.py
def merge(self, node): """! @brief Merge non-leaf node to the current. @param[in] node (non_leaf_node): Non-leaf node that should be merged with current. """ self.feature += node.feature; for child in node.successors: ...
def merge(self, node): """! @brief Merge non-leaf node to the current. @param[in] node (non_leaf_node): Non-leaf node that should be merged with current. """ self.feature += node.feature; for child in node.successors: ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L529-L541
[ "def", "merge", "(", "self", ",", "node", ")", ":", "self", ".", "feature", "+=", "node", ".", "feature", "for", "child", "in", "node", ".", "successors", ":", "child", ".", "parent", "=", "self", "self", ".", "successors", ".", "append", "(", "child...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
non_leaf_node.get_farthest_successors
! @brief Find pair of farthest successors of the node in line with measurement type. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining farthest successors. @return (list) Pair of farthest successors represented by list [cfnode1, cf...
pyclustering/container/cftree.py
def get_farthest_successors(self, type_measurement): """! @brief Find pair of farthest successors of the node in line with measurement type. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining farthest successors. @return (l...
def get_farthest_successors(self, type_measurement): """! @brief Find pair of farthest successors of the node in line with measurement type. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining farthest successors. @return (l...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L544-L570
[ "def", "get_farthest_successors", "(", "self", ",", "type_measurement", ")", ":", "farthest_node1", "=", "None", "farthest_node2", "=", "None", "farthest_distance", "=", "0", "for", "i", "in", "range", "(", "0", ",", "len", "(", "self", ".", "successors", ")...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
non_leaf_node.get_nearest_successors
! @brief Find pair of nearest successors of the node in line with measurement type. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining nearest successors. @return (list) Pair of nearest successors represented by list.
pyclustering/container/cftree.py
def get_nearest_successors(self, type_measurement): """! @brief Find pair of nearest successors of the node in line with measurement type. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining nearest successors. @return (list...
def get_nearest_successors(self, type_measurement): """! @brief Find pair of nearest successors of the node in line with measurement type. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining nearest successors. @return (list...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L573-L599
[ "def", "get_nearest_successors", "(", "self", ",", "type_measurement", ")", ":", "nearest_node1", "=", "None", "nearest_node2", "=", "None", "nearest_distance", "=", "float", "(", "\"Inf\"", ")", "for", "i", "in", "range", "(", "0", ",", "len", "(", "self", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
leaf_node.insert_entry
! @brief Insert new clustering feature to the leaf node. @param[in] entry (cfentry): Clustering feature.
pyclustering/container/cftree.py
def insert_entry(self, entry): """! @brief Insert new clustering feature to the leaf node. @param[in] entry (cfentry): Clustering feature. """ self.feature += entry; self.entries.append(entry);
def insert_entry(self, entry): """! @brief Insert new clustering feature to the leaf node. @param[in] entry (cfentry): Clustering feature. """ self.feature += entry; self.entries.append(entry);
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L656-L665
[ "def", "insert_entry", "(", "self", ",", "entry", ")", ":", "self", ".", "feature", "+=", "entry", "self", ".", "entries", ".", "append", "(", "entry", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
leaf_node.remove_entry
! @brief Remove clustering feature from the leaf node. @param[in] entry (cfentry): Clustering feature.
pyclustering/container/cftree.py
def remove_entry(self, entry): """! @brief Remove clustering feature from the leaf node. @param[in] entry (cfentry): Clustering feature. """ self.feature -= entry; self.entries.remove(entry);
def remove_entry(self, entry): """! @brief Remove clustering feature from the leaf node. @param[in] entry (cfentry): Clustering feature. """ self.feature -= entry; self.entries.remove(entry);
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L668-L677
[ "def", "remove_entry", "(", "self", ",", "entry", ")", ":", "self", ".", "feature", "-=", "entry", "self", ".", "entries", ".", "remove", "(", "entry", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
leaf_node.merge
! @brief Merge leaf node to the current. @param[in] node (leaf_node): Leaf node that should be merged with current.
pyclustering/container/cftree.py
def merge(self, node): """! @brief Merge leaf node to the current. @param[in] node (leaf_node): Leaf node that should be merged with current. """ self.feature += node.feature; # Move entries from merged node for entry...
def merge(self, node): """! @brief Merge leaf node to the current. @param[in] node (leaf_node): Leaf node that should be merged with current. """ self.feature += node.feature; # Move entries from merged node for entry...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L680-L692
[ "def", "merge", "(", "self", ",", "node", ")", ":", "self", ".", "feature", "+=", "node", ".", "feature", "# Move entries from merged node\r", "for", "entry", "in", "node", ".", "entries", ":", "self", ".", "entries", ".", "append", "(", "entry", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
leaf_node.get_farthest_entries
! @brief Find pair of farthest entries of the node. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining farthest entries. @return (list) Pair of farthest entries of the node that are represented by list.
pyclustering/container/cftree.py
def get_farthest_entries(self, type_measurement): """! @brief Find pair of farthest entries of the node. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining farthest entries. @return (list) Pair of farthest entries of the no...
def get_farthest_entries(self, type_measurement): """! @brief Find pair of farthest entries of the node. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining farthest entries. @return (list) Pair of farthest entries of the no...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L695-L721
[ "def", "get_farthest_entries", "(", "self", ",", "type_measurement", ")", ":", "farthest_entity1", "=", "None", "farthest_entity2", "=", "None", "farthest_distance", "=", "0", "for", "i", "in", "range", "(", "0", ",", "len", "(", "self", ".", "entries", ")",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
leaf_node.get_nearest_index_entry
! @brief Find nearest index of nearest entry of node for the specified entry. @param[in] entry (cfentry): Entry that is used for calculation distance. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining nearest entry to the specified. ...
pyclustering/container/cftree.py
def get_nearest_index_entry(self, entry, type_measurement): """! @brief Find nearest index of nearest entry of node for the specified entry. @param[in] entry (cfentry): Entry that is used for calculation distance. @param[in] type_measurement (measurement_type): Measurement ...
def get_nearest_index_entry(self, entry, type_measurement): """! @brief Find nearest index of nearest entry of node for the specified entry. @param[in] entry (cfentry): Entry that is used for calculation distance. @param[in] type_measurement (measurement_type): Measurement ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L724-L743
[ "def", "get_nearest_index_entry", "(", "self", ",", "entry", ",", "type_measurement", ")", ":", "minimum_distance", "=", "float", "(", "'Inf'", ")", "nearest_index", "=", "0", "for", "candidate_index", "in", "range", "(", "0", ",", "len", "(", "self", ".", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
leaf_node.get_nearest_entry
! @brief Find nearest entry of node for the specified entry. @param[in] entry (cfentry): Entry that is used for calculation distance. @param[in] type_measurement (measurement_type): Measurement type that is used for obtaining nearest entry to the specified. @retur...
pyclustering/container/cftree.py
def get_nearest_entry(self, entry, type_measurement): """! @brief Find nearest entry of node for the specified entry. @param[in] entry (cfentry): Entry that is used for calculation distance. @param[in] type_measurement (measurement_type): Measurement type that is used for o...
def get_nearest_entry(self, entry, type_measurement): """! @brief Find nearest entry of node for the specified entry. @param[in] entry (cfentry): Entry that is used for calculation distance. @param[in] type_measurement (measurement_type): Measurement type that is used for o...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L746-L758
[ "def", "get_nearest_entry", "(", "self", ",", "entry", ",", "type_measurement", ")", ":", "min_key", "=", "lambda", "cur_entity", ":", "cur_entity", ".", "get_distance", "(", "entry", ",", "type_measurement", ")", "return", "min", "(", "self", ".", "__entries"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.get_level_nodes
! @brief Traverses CF-tree to obtain nodes at the specified level. @param[in] level (uint): CF-tree level from that nodes should be returned. @return (list) List of CF-nodes that are located on the specified level of the CF-tree.
pyclustering/container/cftree.py
def get_level_nodes(self, level): """! @brief Traverses CF-tree to obtain nodes at the specified level. @param[in] level (uint): CF-tree level from that nodes should be returned. @return (list) List of CF-nodes that are located on the specified level of the CF-tre...
def get_level_nodes(self, level): """! @brief Traverses CF-tree to obtain nodes at the specified level. @param[in] level (uint): CF-tree level from that nodes should be returned. @return (list) List of CF-nodes that are located on the specified level of the CF-tre...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L881-L895
[ "def", "get_level_nodes", "(", "self", ",", "level", ")", ":", "level_nodes", "=", "[", "]", "if", "(", "level", "<", "self", ".", "__height", ")", ":", "level_nodes", "=", "self", ".", "__recursive_get_level_nodes", "(", "level", ",", "self", ".", "__ro...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__recursive_get_level_nodes
! @brief Traverses CF-tree to obtain nodes at the specified level recursively. @param[in] level (uint): Current CF-tree level. @param[in] node (cfnode): CF-node from that traversing is performed. @return (list) List of CF-nodes that are located on the specified le...
pyclustering/container/cftree.py
def __recursive_get_level_nodes(self, level, node): """! @brief Traverses CF-tree to obtain nodes at the specified level recursively. @param[in] level (uint): Current CF-tree level. @param[in] node (cfnode): CF-node from that traversing is performed. @ret...
def __recursive_get_level_nodes(self, level, node): """! @brief Traverses CF-tree to obtain nodes at the specified level recursively. @param[in] level (uint): Current CF-tree level. @param[in] node (cfnode): CF-node from that traversing is performed. @ret...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L898-L917
[ "def", "__recursive_get_level_nodes", "(", "self", ",", "level", ",", "node", ")", ":", "level_nodes", "=", "[", "]", "if", "(", "level", "is", "0", ")", ":", "level_nodes", ".", "append", "(", "node", ")", "else", ":", "for", "sucessor", "in", "node",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.insert_cluster
! @brief Insert cluster that is represented as list of points where each point is represented by list of coordinates. @details Clustering feature is created for that cluster and inserted to the tree. @param[in] cluster (list): Cluster that is represented by list of points that shoul...
pyclustering/container/cftree.py
def insert_cluster(self, cluster): """! @brief Insert cluster that is represented as list of points where each point is represented by list of coordinates. @details Clustering feature is created for that cluster and inserted to the tree. @param[in] cluster (list): Cluster t...
def insert_cluster(self, cluster): """! @brief Insert cluster that is represented as list of points where each point is represented by list of coordinates. @details Clustering feature is created for that cluster and inserted to the tree. @param[in] cluster (list): Cluster t...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L920-L930
[ "def", "insert_cluster", "(", "self", ",", "cluster", ")", ":", "entry", "=", "cfentry", "(", "len", "(", "cluster", ")", ",", "linear_sum", "(", "cluster", ")", ",", "square_sum", "(", "cluster", ")", ")", "self", ".", "insert", "(", "entry", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.insert
! @brief Insert clustering feature to the tree. @param[in] entry (cfentry): Clustering feature that should be inserted.
pyclustering/container/cftree.py
def insert(self, entry): """! @brief Insert clustering feature to the tree. @param[in] entry (cfentry): Clustering feature that should be inserted. """ if (self.__root is None): node = leaf_node(entry, None, [ entry ], None)...
def insert(self, entry): """! @brief Insert clustering feature to the tree. @param[in] entry (cfentry): Clustering feature that should be inserted. """ if (self.__root is None): node = leaf_node(entry, None, [ entry ], None)...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L933-L956
[ "def", "insert", "(", "self", ",", "entry", ")", ":", "if", "(", "self", ".", "__root", "is", "None", ")", ":", "node", "=", "leaf_node", "(", "entry", ",", "None", ",", "[", "entry", "]", ",", "None", ")", "self", ".", "__root", "=", "node", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.find_nearest_leaf
! @brief Search nearest leaf to the specified clustering feature. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): Node from that searching should be started, if None then search process will be started for the root. @return (leaf_n...
pyclustering/container/cftree.py
def find_nearest_leaf(self, entry, search_node = None): """! @brief Search nearest leaf to the specified clustering feature. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): Node from that searching should be started, if None then search proc...
def find_nearest_leaf(self, entry, search_node = None): """! @brief Search nearest leaf to the specified clustering feature. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): Node from that searching should be started, if None then search proc...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L959-L981
[ "def", "find_nearest_leaf", "(", "self", ",", "entry", ",", "search_node", "=", "None", ")", ":", "if", "(", "search_node", "is", "None", ")", ":", "search_node", "=", "self", ".", "__root", "nearest_node", "=", "search_node", "if", "(", "search_node", "."...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__recursive_insert
! @brief Recursive insert of the entry to the tree. @details It performs all required procedures during insertion such as splitting, merging. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): Node from that insertion should be started. ...
pyclustering/container/cftree.py
def __recursive_insert(self, entry, search_node): """! @brief Recursive insert of the entry to the tree. @details It performs all required procedures during insertion such as splitting, merging. @param[in] entry (cfentry): Clustering feature. @param[in] search_node...
def __recursive_insert(self, entry, search_node): """! @brief Recursive insert of the entry to the tree. @details It performs all required procedures during insertion such as splitting, merging. @param[in] entry (cfentry): Clustering feature. @param[in] search_node...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L984-L1002
[ "def", "__recursive_insert", "(", "self", ",", "entry", ",", "search_node", ")", ":", "# None-leaf node\r", "if", "(", "search_node", ".", "type", "==", "cfnode_type", ".", "CFNODE_NONLEAF", ")", ":", "return", "self", ".", "__insert_for_noneleaf_node", "(", "en...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__insert_for_leaf_node
! @brief Recursive insert entry from leaf node to the tree. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): None-leaf node from that insertion should be started. @return (bool) True if number of nodes at the below level is changed,...
pyclustering/container/cftree.py
def __insert_for_leaf_node(self, entry, search_node): """! @brief Recursive insert entry from leaf node to the tree. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): None-leaf node from that insertion should be started. @re...
def __insert_for_leaf_node(self, entry, search_node): """! @brief Recursive insert entry from leaf node to the tree. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): None-leaf node from that insertion should be started. @re...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L1005-L1039
[ "def", "__insert_for_leaf_node", "(", "self", ",", "entry", ",", "search_node", ")", ":", "node_amount_updation", "=", "False", "# Try to absorb by the entity\r", "index_nearest_entry", "=", "search_node", ".", "get_nearest_index_entry", "(", "entry", ",", "self", ".", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__insert_for_noneleaf_node
! @brief Recursive insert entry from none-leaf node to the tree. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): None-leaf node from that insertion should be started. @return (bool) True if number of nodes at the below level is cha...
pyclustering/container/cftree.py
def __insert_for_noneleaf_node(self, entry, search_node): """! @brief Recursive insert entry from none-leaf node to the tree. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): None-leaf node from that insertion should be started. ...
def __insert_for_noneleaf_node(self, entry, search_node): """! @brief Recursive insert entry from none-leaf node to the tree. @param[in] entry (cfentry): Clustering feature. @param[in] search_node (cfnode): None-leaf node from that insertion should be started. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L1042-L1092
[ "def", "__insert_for_noneleaf_node", "(", "self", ",", "entry", ",", "search_node", ")", ":", "node_amount_updation", "=", "False", "min_key", "=", "lambda", "child_node", ":", "child_node", ".", "get_distance", "(", "search_node", ",", "self", ".", "__type_measur...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__merge_nearest_successors
! @brief Find nearest sucessors and merge them. @param[in] node (non_leaf_node): Node whose two nearest successors should be merged. @return (bool): True if merging has been successfully performed, otherwise False.
pyclustering/container/cftree.py
def __merge_nearest_successors(self, node): """! @brief Find nearest sucessors and merge them. @param[in] node (non_leaf_node): Node whose two nearest successors should be merged. @return (bool): True if merging has been successfully performed, otherwise False. ...
def __merge_nearest_successors(self, node): """! @brief Find nearest sucessors and merge them. @param[in] node (non_leaf_node): Node whose two nearest successors should be merged. @return (bool): True if merging has been successfully performed, otherwise False. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L1095-L1119
[ "def", "__merge_nearest_successors", "(", "self", ",", "node", ")", ":", "merging_result", "=", "False", "if", "(", "node", ".", "successors", "[", "0", "]", ".", "type", "==", "cfnode_type", ".", "CFNODE_NONLEAF", ")", ":", "[", "nearest_child_node1", ",", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__split_procedure
! @brief Starts node splitting procedure in the CF-tree from the specify node. @param[in] split_node (cfnode): CF-tree node that should be splitted.
pyclustering/container/cftree.py
def __split_procedure(self, split_node): """! @brief Starts node splitting procedure in the CF-tree from the specify node. @param[in] split_node (cfnode): CF-tree node that should be splitted. """ if (split_node is self.__root): self.__root =...
def __split_procedure(self, split_node): """! @brief Starts node splitting procedure in the CF-tree from the specify node. @param[in] split_node (cfnode): CF-tree node that should be splitted. """ if (split_node is self.__root): self.__root =...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L1122-L1150
[ "def", "__split_procedure", "(", "self", ",", "split_node", ")", ":", "if", "(", "split_node", "is", "self", ".", "__root", ")", ":", "self", ".", "__root", "=", "non_leaf_node", "(", "split_node", ".", "feature", ",", "None", ",", "[", "split_node", "]"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__split_nonleaf_node
! @brief Performs splitting of the specified non-leaf node. @param[in] node (non_leaf_node): Non-leaf node that should be splitted. @return (list) New pair of non-leaf nodes [non_leaf_node1, non_leaf_node2].
pyclustering/container/cftree.py
def __split_nonleaf_node(self, node): """! @brief Performs splitting of the specified non-leaf node. @param[in] node (non_leaf_node): Non-leaf node that should be splitted. @return (list) New pair of non-leaf nodes [non_leaf_node1, non_leaf_node2]. ...
def __split_nonleaf_node(self, node): """! @brief Performs splitting of the specified non-leaf node. @param[in] node (non_leaf_node): Non-leaf node that should be splitted. @return (list) New pair of non-leaf nodes [non_leaf_node1, non_leaf_node2]. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L1153-L1183
[ "def", "__split_nonleaf_node", "(", "self", ",", "node", ")", ":", "[", "farthest_node1", ",", "farthest_node2", "]", "=", "node", ".", "get_farthest_successors", "(", "self", ".", "__type_measurement", ")", "# create new non-leaf nodes\r", "new_node1", "=", "non_le...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.__split_leaf_node
! @brief Performs splitting of the specified leaf node. @param[in] node (leaf_node): Leaf node that should be splitted. @return (list) New pair of leaf nodes [leaf_node1, leaf_node2]. @warning Splitted node is transformed to non_leaf.
pyclustering/container/cftree.py
def __split_leaf_node(self, node): """! @brief Performs splitting of the specified leaf node. @param[in] node (leaf_node): Leaf node that should be splitted. @return (list) New pair of leaf nodes [leaf_node1, leaf_node2]. @warning Splitted node ...
def __split_leaf_node(self, node): """! @brief Performs splitting of the specified leaf node. @param[in] node (leaf_node): Leaf node that should be splitted. @return (list) New pair of leaf nodes [leaf_node1, leaf_node2]. @warning Splitted node ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L1186-L1216
[ "def", "__split_leaf_node", "(", "self", ",", "node", ")", ":", "# search farthest pair of entries\r", "[", "farthest_entity1", ",", "farthest_entity2", "]", "=", "node", ".", "get_farthest_entries", "(", "self", ".", "__type_measurement", ")", "# create new nodes\r", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
cftree.show_feature_destibution
! @brief Shows feature distribution. @details Only features in 1D, 2D, 3D space can be visualized. @param[in] data (list): List of points that will be used for visualization, if it not specified than feature will be displayed only.
pyclustering/container/cftree.py
def show_feature_destibution(self, data = None): """! @brief Shows feature distribution. @details Only features in 1D, 2D, 3D space can be visualized. @param[in] data (list): List of points that will be used for visualization, if it not specified than feature will be displa...
def show_feature_destibution(self, data = None): """! @brief Shows feature distribution. @details Only features in 1D, 2D, 3D space can be visualized. @param[in] data (list): List of points that will be used for visualization, if it not specified than feature will be displa...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/container/cftree.py#L1219-L1240
[ "def", "show_feature_destibution", "(", "self", ",", "data", "=", "None", ")", ":", "visualizer", "=", "cluster_visualizer", "(", ")", "print", "(", "\"amount of nodes: \"", ",", "self", ".", "__amount_nodes", ")", "if", "(", "data", "is", "not", "None", ")"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.process
! @brief Performs cluster analysis in line with rules of agglomerative algorithm and similarity. @see get_clusters()
pyclustering/cluster/agglomerative.py
def process(self): """! @brief Performs cluster analysis in line with rules of agglomerative algorithm and similarity. @see get_clusters() """ if (self.__ccore is True): self.__clusters = wrapper.agglomerative_algorithm(self.__pointer_data, ...
def process(self): """! @brief Performs cluster analysis in line with rules of agglomerative algorithm and similarity. @see get_clusters() """ if (self.__ccore is True): self.__clusters = wrapper.agglomerative_algorithm(self.__pointer_data, ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L145-L163
[ "def", "process", "(", "self", ")", ":", "if", "(", "self", ".", "__ccore", "is", "True", ")", ":", "self", ".", "__clusters", "=", "wrapper", ".", "agglomerative_algorithm", "(", "self", ".", "__pointer_data", ",", "self", ".", "__number_clusters", ",", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__merge_similar_clusters
! @brief Merges the most similar clusters in line with link type.
pyclustering/cluster/agglomerative.py
def __merge_similar_clusters(self): """! @brief Merges the most similar clusters in line with link type. """ if (self.__similarity == type_link.AVERAGE_LINK): self.__merge_by_average_link(); elif (self.__similarity == type_link.CENTROID_LINK...
def __merge_similar_clusters(self): """! @brief Merges the most similar clusters in line with link type. """ if (self.__similarity == type_link.AVERAGE_LINK): self.__merge_by_average_link(); elif (self.__similarity == type_link.CENTROID_LINK...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L194-L213
[ "def", "__merge_similar_clusters", "(", "self", ")", ":", "if", "(", "self", ".", "__similarity", "==", "type_link", ".", "AVERAGE_LINK", ")", ":", "self", ".", "__merge_by_average_link", "(", ")", "elif", "(", "self", ".", "__similarity", "==", "type_link", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__merge_by_average_link
! @brief Merges the most similar clusters in line with average link type.
pyclustering/cluster/agglomerative.py
def __merge_by_average_link(self): """! @brief Merges the most similar clusters in line with average link type. """ minimum_average_distance = float('Inf'); for index_cluster1 in range(0, len(self.__clusters)): for index_cluster2 in range(in...
def __merge_by_average_link(self): """! @brief Merges the most similar clusters in line with average link type. """ minimum_average_distance = float('Inf'); for index_cluster1 in range(0, len(self.__clusters)): for index_cluster2 in range(in...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L216-L240
[ "def", "__merge_by_average_link", "(", "self", ")", ":", "minimum_average_distance", "=", "float", "(", "'Inf'", ")", "for", "index_cluster1", "in", "range", "(", "0", ",", "len", "(", "self", ".", "__clusters", ")", ")", ":", "for", "index_cluster2", "in", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__merge_by_centroid_link
! @brief Merges the most similar clusters in line with centroid link type.
pyclustering/cluster/agglomerative.py
def __merge_by_centroid_link(self): """! @brief Merges the most similar clusters in line with centroid link type. """ minimum_centroid_distance = float('Inf'); indexes = None; for index1 in range(0, len(self.__centers)): for index2 i...
def __merge_by_centroid_link(self): """! @brief Merges the most similar clusters in line with centroid link type. """ minimum_centroid_distance = float('Inf'); indexes = None; for index1 in range(0, len(self.__centers)): for index2 i...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L243-L263
[ "def", "__merge_by_centroid_link", "(", "self", ")", ":", "minimum_centroid_distance", "=", "float", "(", "'Inf'", ")", "indexes", "=", "None", "for", "index1", "in", "range", "(", "0", ",", "len", "(", "self", ".", "__centers", ")", ")", ":", "for", "in...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__merge_by_complete_link
! @brief Merges the most similar clusters in line with complete link type.
pyclustering/cluster/agglomerative.py
def __merge_by_complete_link(self): """! @brief Merges the most similar clusters in line with complete link type. """ minimum_complete_distance = float('Inf'); indexes = None; for index_cluster1 in range(0, len(self.__clusters)): for...
def __merge_by_complete_link(self): """! @brief Merges the most similar clusters in line with complete link type. """ minimum_complete_distance = float('Inf'); indexes = None; for index_cluster1 in range(0, len(self.__clusters)): for...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L266-L284
[ "def", "__merge_by_complete_link", "(", "self", ")", ":", "minimum_complete_distance", "=", "float", "(", "'Inf'", ")", "indexes", "=", "None", "for", "index_cluster1", "in", "range", "(", "0", ",", "len", "(", "self", ".", "__clusters", ")", ")", ":", "fo...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__calculate_farthest_distance
! @brief Finds two farthest objects in two specified clusters in terms and returns distance between them. @param[in] (uint) Index of the first cluster. @param[in] (uint) Index of the second cluster. @return The farthest euclidean distance between two clusters.
pyclustering/cluster/agglomerative.py
def __calculate_farthest_distance(self, index_cluster1, index_cluster2): """! @brief Finds two farthest objects in two specified clusters in terms and returns distance between them. @param[in] (uint) Index of the first cluster. @param[in] (uint) Index of the second cluster. ...
def __calculate_farthest_distance(self, index_cluster1, index_cluster2): """! @brief Finds two farthest objects in two specified clusters in terms and returns distance between them. @param[in] (uint) Index of the first cluster. @param[in] (uint) Index of the second cluster. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L287-L305
[ "def", "__calculate_farthest_distance", "(", "self", ",", "index_cluster1", ",", "index_cluster2", ")", ":", "candidate_maximum_distance", "=", "0.0", "for", "index_object1", "in", "self", ".", "__clusters", "[", "index_cluster1", "]", ":", "for", "index_object2", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__merge_by_signle_link
! @brief Merges the most similar clusters in line with single link type.
pyclustering/cluster/agglomerative.py
def __merge_by_signle_link(self): """! @brief Merges the most similar clusters in line with single link type. """ minimum_single_distance = float('Inf'); indexes = None; for index_cluster1 in range(0, len(self.__clusters)): for index...
def __merge_by_signle_link(self): """! @brief Merges the most similar clusters in line with single link type. """ minimum_single_distance = float('Inf'); indexes = None; for index_cluster1 in range(0, len(self.__clusters)): for index...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L308-L326
[ "def", "__merge_by_signle_link", "(", "self", ")", ":", "minimum_single_distance", "=", "float", "(", "'Inf'", ")", "indexes", "=", "None", "for", "index_cluster1", "in", "range", "(", "0", ",", "len", "(", "self", ".", "__clusters", ")", ")", ":", "for", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__calculate_nearest_distance
! @brief Finds two nearest objects in two specified clusters and returns distance between them. @param[in] (uint) Index of the first cluster. @param[in] (uint) Index of the second cluster. @return The nearest euclidean distance between two clusters.
pyclustering/cluster/agglomerative.py
def __calculate_nearest_distance(self, index_cluster1, index_cluster2): """! @brief Finds two nearest objects in two specified clusters and returns distance between them. @param[in] (uint) Index of the first cluster. @param[in] (uint) Index of the second cluster. ...
def __calculate_nearest_distance(self, index_cluster1, index_cluster2): """! @brief Finds two nearest objects in two specified clusters and returns distance between them. @param[in] (uint) Index of the first cluster. @param[in] (uint) Index of the second cluster. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L329-L347
[ "def", "__calculate_nearest_distance", "(", "self", ",", "index_cluster1", ",", "index_cluster2", ")", ":", "candidate_minimum_distance", "=", "float", "(", "'Inf'", ")", "for", "index_object1", "in", "self", ".", "__clusters", "[", "index_cluster1", "]", ":", "fo...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
agglomerative.__calculate_center
! @brief Calculates new center. @return (list) New value of the center of the specified cluster.
pyclustering/cluster/agglomerative.py
def __calculate_center(self, cluster): """! @brief Calculates new center. @return (list) New value of the center of the specified cluster. """ dimension = len(self.__pointer_data[cluster[0]]); center = [0] * dimension; for index_point i...
def __calculate_center(self, cluster): """! @brief Calculates new center. @return (list) New value of the center of the specified cluster. """ dimension = len(self.__pointer_data[cluster[0]]); center = [0] * dimension; for index_point i...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/agglomerative.py#L350-L367
[ "def", "__calculate_center", "(", "self", ",", "cluster", ")", ":", "dimension", "=", "len", "(", "self", ".", "__pointer_data", "[", "cluster", "[", "0", "]", "]", ")", "center", "=", "[", "0", "]", "*", "dimension", "for", "index_point", "in", "clust...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
som_create
! @brief Create of self-organized map using CCORE pyclustering library. @param[in] rows (uint): Number of neurons in the column (number of rows). @param[in] cols (uint): Number of neurons in the row (number of columns). @param[in] conn_type (type_conn): Type of connection between oscillators i...
pyclustering/core/som_wrapper.py
def som_create(rows, cols, conn_type, parameters): """! @brief Create of self-organized map using CCORE pyclustering library. @param[in] rows (uint): Number of neurons in the column (number of rows). @param[in] cols (uint): Number of neurons in the row (number of columns). @param[in] conn...
def som_create(rows, cols, conn_type, parameters): """! @brief Create of self-organized map using CCORE pyclustering library. @param[in] rows (uint): Number of neurons in the column (number of rows). @param[in] cols (uint): Number of neurons in the row (number of columns). @param[in] conn...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/core/som_wrapper.py#L45-L70
[ "def", "som_create", "(", "rows", ",", "cols", ",", "conn_type", ",", "parameters", ")", ":", "ccore", "=", "ccore_library", ".", "get", "(", ")", "c_params", "=", "c_som_parameters", "(", ")", "c_params", ".", "init_type", "=", "parameters", ".", "init_ty...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
som_load
! @brief Load dump of the network to SOM. @details Initialize SOM using existed weights, amount of captured objects by each neuron, captured objects by each neuron. Initialization is not performed if weights are empty. @param[in] som_pointer (POINTER): pointer to object of self-organized...
pyclustering/core/som_wrapper.py
def som_load(som_pointer, weights, award, capture_objects): """! @brief Load dump of the network to SOM. @details Initialize SOM using existed weights, amount of captured objects by each neuron, captured objects by each neuron. Initialization is not performed if weights are empty. @...
def som_load(som_pointer, weights, award, capture_objects): """! @brief Load dump of the network to SOM. @details Initialize SOM using existed weights, amount of captured objects by each neuron, captured objects by each neuron. Initialization is not performed if weights are empty. @...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/core/som_wrapper.py#L73-L95
[ "def", "som_load", "(", "som_pointer", ",", "weights", ",", "award", ",", "capture_objects", ")", ":", "if", "len", "(", "weights", ")", "==", "0", ":", "return", "ccore", "=", "ccore_library", ".", "get", "(", ")", "package_weights", "=", "package_builder...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
som_train
! @brief Trains self-organized feature map (SOM) using CCORE pyclustering library. @param[in] data (list): Input data - list of points where each point is represented by list of features, for example coordinates. @param[in] epochs (uint): Number of epochs for training. @param[in] autostop ...
pyclustering/core/som_wrapper.py
def som_train(som_pointer, data, epochs, autostop): """! @brief Trains self-organized feature map (SOM) using CCORE pyclustering library. @param[in] data (list): Input data - list of points where each point is represented by list of features, for example coordinates. @param[in] epochs (uint): Numb...
def som_train(som_pointer, data, epochs, autostop): """! @brief Trains self-organized feature map (SOM) using CCORE pyclustering library. @param[in] data (list): Input data - list of points where each point is represented by list of features, for example coordinates. @param[in] epochs (uint): Numb...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/core/som_wrapper.py#L110-L126
[ "def", "som_train", "(", "som_pointer", ",", "data", ",", "epochs", ",", "autostop", ")", ":", "pointer_data", "=", "package_builder", "(", "data", ",", "c_double", ")", ".", "create", "(", ")", "ccore", "=", "ccore_library", ".", "get", "(", ")", "ccore...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
som_simulate
! @brief Processes input pattern (no learining) and returns index of neuron-winner. @details Using index of neuron winner catched object can be obtained using property capture_objects. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. @param[in] pattern (list): input...
pyclustering/core/som_wrapper.py
def som_simulate(som_pointer, pattern): """! @brief Processes input pattern (no learining) and returns index of neuron-winner. @details Using index of neuron winner catched object can be obtained using property capture_objects. @param[in] som_pointer (c_pointer): pointer to object of self-orga...
def som_simulate(som_pointer, pattern): """! @brief Processes input pattern (no learining) and returns index of neuron-winner. @details Using index of neuron winner catched object can be obtained using property capture_objects. @param[in] som_pointer (c_pointer): pointer to object of self-orga...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/core/som_wrapper.py#L129-L145
[ "def", "som_simulate", "(", "som_pointer", ",", "pattern", ")", ":", "pointer_data", "=", "package_builder", "(", "pattern", ",", "c_double", ")", ".", "create", "(", ")", "ccore", "=", "ccore_library", ".", "get", "(", ")", "ccore", ".", "som_simulate", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
som_get_winner_number
! @brief Returns of number of winner at the last step of learning process. @param[in] som_pointer (c_pointer): pointer to object of self-organized map.
pyclustering/core/som_wrapper.py
def som_get_winner_number(som_pointer): """! @brief Returns of number of winner at the last step of learning process. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_winner_number.restype = c_size_...
def som_get_winner_number(som_pointer): """! @brief Returns of number of winner at the last step of learning process. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_winner_number.restype = c_size_...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/core/som_wrapper.py#L148-L158
[ "def", "som_get_winner_number", "(", "som_pointer", ")", ":", "ccore", "=", "ccore_library", ".", "get", "(", ")", "ccore", ".", "som_get_winner_number", ".", "restype", "=", "c_size_t", "return", "ccore", ".", "som_get_winner_number", "(", "som_pointer", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
som_get_size
! @brief Returns size of self-organized map (number of neurons). @param[in] som_pointer (c_pointer): pointer to object of self-organized map.
pyclustering/core/som_wrapper.py
def som_get_size(som_pointer): """! @brief Returns size of self-organized map (number of neurons). @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_size.restype = c_size_t return ccore.som_get_...
def som_get_size(som_pointer): """! @brief Returns size of self-organized map (number of neurons). @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_size.restype = c_size_t return ccore.som_get_...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/core/som_wrapper.py#L161-L171
[ "def", "som_get_size", "(", "som_pointer", ")", ":", "ccore", "=", "ccore_library", ".", "get", "(", ")", "ccore", ".", "som_get_size", ".", "restype", "=", "c_size_t", "return", "ccore", ".", "som_get_size", "(", "som_pointer", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
som_get_capture_objects
! @brief Returns list of indexes of captured objects by each neuron. @param[in] som_pointer (c_pointer): pointer to object of self-organized map.
pyclustering/core/som_wrapper.py
def som_get_capture_objects(som_pointer): """! @brief Returns list of indexes of captured objects by each neuron. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_capture_objects.restype = POI...
def som_get_capture_objects(som_pointer): """! @brief Returns list of indexes of captured objects by each neuron. @param[in] som_pointer (c_pointer): pointer to object of self-organized map. """ ccore = ccore_library.get() ccore.som_get_capture_objects.restype = POI...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/core/som_wrapper.py#L174-L188
[ "def", "som_get_capture_objects", "(", "som_pointer", ")", ":", "ccore", "=", "ccore_library", ".", "get", "(", ")", "ccore", ".", "som_get_capture_objects", ".", "restype", "=", "POINTER", "(", "pyclustering_package", ")", "package", "=", "ccore", ".", "som_get...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hysteresis_dynamic.allocate_sync_ensembles
! @brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster. @param[in] tolerance (double): Maximum error for allocation of synchronous ensemble oscillators. @param[in] threshold_...
pyclustering/nnet/hysteresis.py
def allocate_sync_ensembles(self, tolerance = 0.1, threshold_steps = 1): """! @brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster. @param[in] tolerance (double): Maximum err...
def allocate_sync_ensembles(self, tolerance = 0.1, threshold_steps = 1): """! @brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster. @param[in] tolerance (double): Maximum err...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hysteresis.py#L87-L131
[ "def", "allocate_sync_ensembles", "(", "self", ",", "tolerance", "=", "0.1", ",", "threshold_steps", "=", "1", ")", ":", "clusters", "=", "[", "[", "0", "]", "]", "number_oscillators", "=", "len", "(", "self", ".", "_dynamic", "[", "0", "]", ")", "for"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hysteresis_network.outputs
! @brief Sets outputs of neurons.
pyclustering/nnet/hysteresis.py
def outputs(self, values): """! @brief Sets outputs of neurons. """ self._outputs = [val for val in values]; self._outputs_buffer = [val for val in values];
def outputs(self, values): """! @brief Sets outputs of neurons. """ self._outputs = [val for val in values]; self._outputs_buffer = [val for val in values];
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hysteresis.py#L192-L199
[ "def", "outputs", "(", "self", ",", "values", ")", ":", "self", ".", "_outputs", "=", "[", "val", "for", "val", "in", "values", "]", "self", ".", "_outputs_buffer", "=", "[", "val", "for", "val", "in", "values", "]" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hysteresis_network._neuron_states
! @brief Returns new value of the neuron (oscillator). @param[in] inputs (list): Initial values (current) of the neuron - excitatory. @param[in] t (double): Current time of simulation. @param[in] argv (tuple): Extra arguments that are not used for integration - index of the...
pyclustering/nnet/hysteresis.py
def _neuron_states(self, inputs, t, argv): """! @brief Returns new value of the neuron (oscillator). @param[in] inputs (list): Initial values (current) of the neuron - excitatory. @param[in] t (double): Current time of simulation. @param[in] argv (tuple): Extra arg...
def _neuron_states(self, inputs, t, argv): """! @brief Returns new value of the neuron (oscillator). @param[in] inputs (list): Initial values (current) of the neuron - excitatory. @param[in] t (double): Current time of simulation. @param[in] argv (tuple): Extra arg...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hysteresis.py#L252-L279
[ "def", "_neuron_states", "(", "self", ",", "inputs", ",", "t", ",", "argv", ")", ":", "xi", "=", "inputs", "[", "0", "]", "index", "=", "argv", "# own impact\r", "impact", "=", "self", ".", "_weight", "[", "index", "]", "[", "index", "]", "*", "sel...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hysteresis_network.simulate_static
! @brief Performs static simulation of hysteresis oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of simulation. @param[in] solution (solve_type): Type of solution (solving). @param[in] col...
pyclustering/nnet/hysteresis.py
def simulate_static(self, steps, time, solution = solve_type.RK4, collect_dynamic = False): """! @brief Performs static simulation of hysteresis oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of si...
def simulate_static(self, steps, time, solution = solve_type.RK4, collect_dynamic = False): """! @brief Performs static simulation of hysteresis oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of si...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hysteresis.py#L298-L344
[ "def", "simulate_static", "(", "self", ",", "steps", ",", "time", ",", "solution", "=", "solve_type", ".", "RK4", ",", "collect_dynamic", "=", "False", ")", ":", "# Check solver before simulation\r", "if", "(", "solution", "==", "solve_type", ".", "FAST", ")",...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hysteresis_network._calculate_states
! @brief Calculates new states for neurons using differential calculus. Returns new states for neurons. @param[in] solution (solve_type): Type solver of the differential equation. @param[in] t (double): Current time of simulation. @param[in] step (double): Step of solution ...
pyclustering/nnet/hysteresis.py
def _calculate_states(self, solution, t, step, int_step): """! @brief Calculates new states for neurons using differential calculus. Returns new states for neurons. @param[in] solution (solve_type): Type solver of the differential equation. @param[in] t (double): Current ti...
def _calculate_states(self, solution, t, step, int_step): """! @brief Calculates new states for neurons using differential calculus. Returns new states for neurons. @param[in] solution (solve_type): Type solver of the differential equation. @param[in] t (double): Current ti...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hysteresis.py#L347-L367
[ "def", "_calculate_states", "(", "self", ",", "solution", ",", "t", ",", "step", ",", "int_step", ")", ":", "next_states", "=", "[", "0", "]", "*", "self", ".", "_num_osc", "for", "index", "in", "range", "(", "0", ",", "self", ".", "_num_osc", ",", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_dynamic.output
! @brief Returns output dynamic of the network.
pyclustering/nnet/legion.py
def output(self): """! @brief Returns output dynamic of the network. """ if (self.__ccore_legion_dynamic_pointer is not None): return wrapper.legion_dynamic_get_output(self.__ccore_legion_dynamic_pointer); return self.__output;
def output(self): """! @brief Returns output dynamic of the network. """ if (self.__ccore_legion_dynamic_pointer is not None): return wrapper.legion_dynamic_get_output(self.__ccore_legion_dynamic_pointer); return self.__output;
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L119-L127
[ "def", "output", "(", "self", ")", ":", "if", "(", "self", ".", "__ccore_legion_dynamic_pointer", "is", "not", "None", ")", ":", "return", "wrapper", ".", "legion_dynamic_get_output", "(", "self", ".", "__ccore_legion_dynamic_pointer", ")", "return", "self", "."...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_dynamic.inhibitor
! @brief Returns output dynamic of the global inhibitor of the network.
pyclustering/nnet/legion.py
def inhibitor(self): """! @brief Returns output dynamic of the global inhibitor of the network. """ if (self.__ccore_legion_dynamic_pointer is not None): return wrapper.legion_dynamic_get_inhibitory_output(self.__ccore_legion_dynamic_pointer); ...
def inhibitor(self): """! @brief Returns output dynamic of the global inhibitor of the network. """ if (self.__ccore_legion_dynamic_pointer is not None): return wrapper.legion_dynamic_get_inhibitory_output(self.__ccore_legion_dynamic_pointer); ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L131-L140
[ "def", "inhibitor", "(", "self", ")", ":", "if", "(", "self", ".", "__ccore_legion_dynamic_pointer", "is", "not", "None", ")", ":", "return", "wrapper", ".", "legion_dynamic_get_inhibitory_output", "(", "self", ".", "__ccore_legion_dynamic_pointer", ")", "return", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_dynamic.time
! @brief Returns simulation time.
pyclustering/nnet/legion.py
def time(self): """! @brief Returns simulation time. """ if (self.__ccore_legion_dynamic_pointer is not None): return wrapper.legion_dynamic_get_time(self.__ccore_legion_dynamic_pointer); return list(range(len(self)));
def time(self): """! @brief Returns simulation time. """ if (self.__ccore_legion_dynamic_pointer is not None): return wrapper.legion_dynamic_get_time(self.__ccore_legion_dynamic_pointer); return list(range(len(self)));
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L144-L152
[ "def", "time", "(", "self", ")", ":", "if", "(", "self", ".", "__ccore_legion_dynamic_pointer", "is", "not", "None", ")", ":", "return", "wrapper", ".", "legion_dynamic_get_time", "(", "self", ".", "__ccore_legion_dynamic_pointer", ")", "return", "list", "(", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_dynamic.allocate_sync_ensembles
! @brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster. @param[in] tolerance (double): Maximum error for allocation of synchronous ensemble oscillators. @return (list) Grours of indexes o...
pyclustering/nnet/legion.py
def allocate_sync_ensembles(self, tolerance = 0.1): """! @brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster. @param[in] tolerance (double): Maximum error for allocation of synchronous ensemble os...
def allocate_sync_ensembles(self, tolerance = 0.1): """! @brief Allocate clusters in line with ensembles of synchronous oscillators where each synchronous ensemble corresponds to only one cluster. @param[in] tolerance (double): Maximum error for allocation of synchronous ensemble os...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L193-L206
[ "def", "allocate_sync_ensembles", "(", "self", ",", "tolerance", "=", "0.1", ")", ":", "if", "(", "self", ".", "__ccore_legion_dynamic_pointer", "is", "not", "None", ")", ":", "self", ".", "__output", "=", "wrapper", ".", "legion_dynamic_get_output", "(", "sel...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_network.__create_stimulus
! @brief Create stimulus for oscillators in line with stimulus map and parameters. @param[in] stimulus (list): Stimulus for oscillators that is represented by list, number of stimulus should be equal number of oscillators.
pyclustering/nnet/legion.py
def __create_stimulus(self, stimulus): """! @brief Create stimulus for oscillators in line with stimulus map and parameters. @param[in] stimulus (list): Stimulus for oscillators that is represented by list, number of stimulus should be equal number of oscillators. ...
def __create_stimulus(self, stimulus): """! @brief Create stimulus for oscillators in line with stimulus map and parameters. @param[in] stimulus (list): Stimulus for oscillators that is represented by list, number of stimulus should be equal number of oscillators. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L305-L320
[ "def", "__create_stimulus", "(", "self", ",", "stimulus", ")", ":", "if", "(", "len", "(", "stimulus", ")", "!=", "self", ".", "_num_osc", ")", ":", "raise", "NameError", "(", "\"Number of stimulus should be equal number of oscillators in the network.\"", ")", "else...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_network.__create_dynamic_connections
! @brief Create dynamic connection in line with input stimulus.
pyclustering/nnet/legion.py
def __create_dynamic_connections(self): """! @brief Create dynamic connection in line with input stimulus. """ if (self._stimulus is None): raise NameError("Stimulus should initialed before creation of the dynamic connections in the network."); ...
def __create_dynamic_connections(self): """! @brief Create dynamic connection in line with input stimulus. """ if (self._stimulus is None): raise NameError("Stimulus should initialed before creation of the dynamic connections in the network."); ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L323-L347
[ "def", "__create_dynamic_connections", "(", "self", ")", ":", "if", "(", "self", ".", "_stimulus", "is", "None", ")", ":", "raise", "NameError", "(", "\"Stimulus should initialed before creation of the dynamic connections in the network.\"", ")", "self", ".", "_dynamic_co...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_network.simulate
! @brief Performs static simulation of LEGION oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of simulation. @param[in] stimulus (list): Stimulus for oscillators, number of stimulus should be equal ...
pyclustering/nnet/legion.py
def simulate(self, steps, time, stimulus, solution = solve_type.RK4, collect_dynamic = True): """! @brief Performs static simulation of LEGION oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of simu...
def simulate(self, steps, time, stimulus, solution = solve_type.RK4, collect_dynamic = True): """! @brief Performs static simulation of LEGION oscillatory network. @param[in] steps (uint): Number steps of simulations during simulation. @param[in] time (double): Time of simu...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L350-L410
[ "def", "simulate", "(", "self", ",", "steps", ",", "time", ",", "stimulus", ",", "solution", "=", "solve_type", ".", "RK4", ",", "collect_dynamic", "=", "True", ")", ":", "if", "(", "self", ".", "__ccore_legion_pointer", "is", "not", "None", ")", ":", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_network._calculate_states
! @brief Calculates new state of each oscillator in the network. @param[in] solution (solve_type): Type solver of the differential equation. @param[in] t (double): Current time of simulation. @param[in] step (double): Step of solution at the end of which states of oscillato...
pyclustering/nnet/legion.py
def _calculate_states(self, solution, t, step, int_step): """! @brief Calculates new state of each oscillator in the network. @param[in] solution (solve_type): Type solver of the differential equation. @param[in] t (double): Current time of simulation. @param[in] s...
def _calculate_states(self, solution, t, step, int_step): """! @brief Calculates new state of each oscillator in the network. @param[in] solution (solve_type): Type solver of the differential equation. @param[in] t (double): Current time of simulation. @param[in] s...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L413-L460
[ "def", "_calculate_states", "(", "self", ",", "solution", ",", "t", ",", "step", ",", "int_step", ")", ":", "next_excitatory", "=", "[", "0.0", "]", "*", "self", ".", "_num_osc", "next_inhibitory", "=", "[", "0.0", "]", "*", "self", ".", "_num_osc", "n...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_network._global_inhibitor_state
! @brief Returns new value of global inhibitory @param[in] z (dobule): Current value of inhibitory. @param[in] t (double): Current time of simulation. @param[in] argv (tuple): It's not used, can be ignored. @return (double) New value if global inhibitory ...
pyclustering/nnet/legion.py
def _global_inhibitor_state(self, z, t, argv): """! @brief Returns new value of global inhibitory @param[in] z (dobule): Current value of inhibitory. @param[in] t (double): Current time of simulation. @param[in] argv (tuple): It's not used, can be ignored. ...
def _global_inhibitor_state(self, z, t, argv): """! @brief Returns new value of global inhibitory @param[in] z (dobule): Current value of inhibitory. @param[in] t (double): Current time of simulation. @param[in] argv (tuple): It's not used, can be ignored. ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L464-L483
[ "def", "_global_inhibitor_state", "(", "self", ",", "z", ",", "t", ",", "argv", ")", ":", "sigma", "=", "0.0", "for", "x", "in", "self", ".", "_excitatory", ":", "if", "(", "x", ">", "self", ".", "_params", ".", "teta_zx", ")", ":", "sigma", "=", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_network._legion_state_simplify
! @brief Returns new values of excitatory and inhibitory parts of oscillator of oscillator. @details Simplify model doesn't consider oscillator potential. @param[in] inputs (list): Initial values (current) of oscillator [excitatory, inhibitory]. @param[in] t (double): Curre...
pyclustering/nnet/legion.py
def _legion_state_simplify(self, inputs, t, argv): """! @brief Returns new values of excitatory and inhibitory parts of oscillator of oscillator. @details Simplify model doesn't consider oscillator potential. @param[in] inputs (list): Initial values (current) of oscillator ...
def _legion_state_simplify(self, inputs, t, argv): """! @brief Returns new values of excitatory and inhibitory parts of oscillator of oscillator. @details Simplify model doesn't consider oscillator potential. @param[in] inputs (list): Initial values (current) of oscillator ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L486-L513
[ "def", "_legion_state_simplify", "(", "self", ",", "inputs", ",", "t", ",", "argv", ")", ":", "index", "=", "argv", "x", "=", "inputs", "[", "0", "]", "# excitatory\r", "y", "=", "inputs", "[", "1", "]", "# inhibitory\r", "dx", "=", "3.0", "*", "x", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
legion_network._legion_state
! @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator. @param[in] inputs (list): Initial values (current) of oscillator [excitatory, inhibitory, potential]. @param[in] t (double): Current time of simulation. @param[in] argv...
pyclustering/nnet/legion.py
def _legion_state(self, inputs, t, argv): """! @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator. @param[in] inputs (list): Initial values (current) of oscillator [excitatory, inhibitory, potential]. @param[in] t (double)...
def _legion_state(self, inputs, t, argv): """! @brief Returns new values of excitatory and inhibitory parts of oscillator and potential of oscillator. @param[in] inputs (list): Initial values (current) of oscillator [excitatory, inhibitory, potential]. @param[in] t (double)...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/legion.py#L516-L547
[ "def", "_legion_state", "(", "self", ",", "inputs", ",", "t", ",", "argv", ")", ":", "index", "=", "argv", "x", "=", "inputs", "[", "0", "]", "# excitatory\r", "y", "=", "inputs", "[", "1", "]", "# inhibitory\r", "p", "=", "inputs", "[", "2", "]", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncgcolor_analyser.allocate_map_coloring
! @brief Allocates coloring map for graph that has been processed. @param[in] tolerance (double): Defines maximum deviation between phases. @return (list) Colors for each node (index of node in graph), for example [color1, color2, color2, ...].
pyclustering/gcolor/sync.py
def allocate_map_coloring(self, tolerance = 0.1): """! @brief Allocates coloring map for graph that has been processed. @param[in] tolerance (double): Defines maximum deviation between phases. @return (list) Colors for each node (index of node in graph), for example [co...
def allocate_map_coloring(self, tolerance = 0.1): """! @brief Allocates coloring map for graph that has been processed. @param[in] tolerance (double): Defines maximum deviation between phases. @return (list) Colors for each node (index of node in graph), for example [co...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/sync.py#L64-L83
[ "def", "allocate_map_coloring", "(", "self", ",", "tolerance", "=", "0.1", ")", ":", "clusters", "=", "self", ".", "allocate_color_clusters", "(", "tolerance", ")", "number_oscillators", "=", "len", "(", "self", ".", "_dynamic", "[", "0", "]", ")", "coloring...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncgcolor._create_connections
! @brief Creates connection in the network in line with graph. @param[in] graph_matrix (list): Matrix representation of the graph.
pyclustering/gcolor/sync.py
def _create_connections(self, graph_matrix): """! @brief Creates connection in the network in line with graph. @param[in] graph_matrix (list): Matrix representation of the graph. """ for row in range(0, len(graph_matrix)): for column in rang...
def _create_connections(self, graph_matrix): """! @brief Creates connection in the network in line with graph. @param[in] graph_matrix (list): Matrix representation of the graph. """ for row in range(0, len(graph_matrix)): for column in rang...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/sync.py#L116-L127
[ "def", "_create_connections", "(", "self", ",", "graph_matrix", ")", ":", "for", "row", "in", "range", "(", "0", ",", "len", "(", "graph_matrix", ")", ")", ":", "for", "column", "in", "range", "(", "0", ",", "len", "(", "graph_matrix", "[", "row", "]...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncgcolor._phase_kuramoto
! @brief Returns result of phase calculation for oscillator in the network. @param[in] teta (double): Value of phase of the oscillator with index argv in the network. @param[in] t (double): Unused, can be ignored. @param[in] argv (uint): Index of the oscillator in the network. ...
pyclustering/gcolor/sync.py
def _phase_kuramoto(self, teta, t, argv): """! @brief Returns result of phase calculation for oscillator in the network. @param[in] teta (double): Value of phase of the oscillator with index argv in the network. @param[in] t (double): Unused, can be ignored. @param[in] a...
def _phase_kuramoto(self, teta, t, argv): """! @brief Returns result of phase calculation for oscillator in the network. @param[in] teta (double): Value of phase of the oscillator with index argv in the network. @param[in] t (double): Unused, can be ignored. @param[in] a...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/sync.py#L130-L151
[ "def", "_phase_kuramoto", "(", "self", ",", "teta", ",", "t", ",", "argv", ")", ":", "index", "=", "argv", "phase", "=", "0", "for", "k", "in", "range", "(", "0", ",", "self", ".", "_num_osc", ")", ":", "if", "(", "self", ".", "has_connection", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncgcolor.process
! @brief Performs simulation of the network (performs solving of graph coloring problem). @param[in] order (double): Defines when process of synchronization in the network is over, range from 0 to 1. @param[in] solution (solve_type): defines type (method) of solving diff. equation. ...
pyclustering/gcolor/sync.py
def process(self, order = 0.998, solution = solve_type.FAST, collect_dynamic = False): """! @brief Performs simulation of the network (performs solving of graph coloring problem). @param[in] order (double): Defines when process of synchronization in the network is over, range from 0 to ...
def process(self, order = 0.998, solution = solve_type.FAST, collect_dynamic = False): """! @brief Performs simulation of the network (performs solving of graph coloring problem). @param[in] order (double): Defines when process of synchronization in the network is over, range from 0 to ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/gcolor/sync.py#L154-L167
[ "def", "process", "(", "self", ",", "order", "=", "0.998", ",", "solution", "=", "solve_type", ".", "FAST", ",", "collect_dynamic", "=", "False", ")", ":", "analyser", "=", "self", ".", "simulate_dynamic", "(", "order", ",", "solution", ",", "collect_dynam...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncnet_analyser.allocate_clusters
! @brief Returns list of clusters in line with state of ocillators (phases). @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one cluster. @param[in] indexes (list): List of real object indexes and it should be equal to amount ...
pyclustering/cluster/syncnet.py
def allocate_clusters(self, eps = 0.01, indexes = None, iteration = None): """! @brief Returns list of clusters in line with state of ocillators (phases). @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one cluster. @...
def allocate_clusters(self, eps = 0.01, indexes = None, iteration = None): """! @brief Returns list of clusters in line with state of ocillators (phases). @param[in] eps (double): Tolerance level that define maximal difference between phases of oscillators in one cluster. @...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/syncnet.py#L79-L91
[ "def", "allocate_clusters", "(", "self", ",", "eps", "=", "0.01", ",", "indexes", "=", "None", ",", "iteration", "=", "None", ")", ":", "return", "self", ".", "allocate_sync_ensembles", "(", "eps", ",", "indexes", ",", "iteration", ")" ]
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncnet_visualizer.animate_cluster_allocation
! @brief Shows animation of output dynamic (output of each oscillator) during simulation on a circle from [0; 2pi]. @param[in] dataset (list): Input data that was used for processing by the network. @param[in] analyser (syncnet_analyser): Output dynamic analyser of the Sync network....
pyclustering/cluster/syncnet.py
def animate_cluster_allocation(dataset, analyser, animation_velocity = 75, tolerance = 0.1, save_movie = None, title = None): """! @brief Shows animation of output dynamic (output of each oscillator) during simulation on a circle from [0; 2pi]. @param[in] dataset (list): Input data ...
def animate_cluster_allocation(dataset, analyser, animation_velocity = 75, tolerance = 0.1, save_movie = None, title = None): """! @brief Shows animation of output dynamic (output of each oscillator) during simulation on a circle from [0; 2pi]. @param[in] dataset (list): Input data ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/syncnet.py#L115-L161
[ "def", "animate_cluster_allocation", "(", "dataset", ",", "analyser", ",", "animation_velocity", "=", "75", ",", "tolerance", "=", "0.1", ",", "save_movie", "=", "None", ",", "title", "=", "None", ")", ":", "figure", "=", "plt", ".", "figure", "(", ")", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncnet._create_connections
! @brief Create connections between oscillators in line with input radius of connectivity. @param[in] radius (double): Connectivity radius between oscillators.
pyclustering/cluster/syncnet.py
def _create_connections(self, radius): """! @brief Create connections between oscillators in line with input radius of connectivity. @param[in] radius (double): Connectivity radius between oscillators. """ if (self._ena_conn_weight is True): ...
def _create_connections(self, radius): """! @brief Create connections between oscillators in line with input radius of connectivity. @param[in] radius (double): Connectivity radius between oscillators. """ if (self._ena_conn_weight is True): ...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/syncnet.py#L247-L289
[ "def", "_create_connections", "(", "self", ",", "radius", ")", ":", "if", "(", "self", ".", "_ena_conn_weight", "is", "True", ")", ":", "self", ".", "_conn_weight", "=", "[", "[", "0", "]", "*", "self", ".", "_num_osc", "for", "_", "in", "range", "("...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncnet.process
! @brief Peforms cluster analysis using simulation of the oscillatory network. @param[in] order (double): Order of synchronization that is used as indication for stopping processing. @param[in] solution (solve_type): Specified type of solving diff. equation. @param[in] coll...
pyclustering/cluster/syncnet.py
def process(self, order = 0.998, solution = solve_type.FAST, collect_dynamic = True): """! @brief Peforms cluster analysis using simulation of the oscillatory network. @param[in] order (double): Order of synchronization that is used as indication for stopping processing. @p...
def process(self, order = 0.998, solution = solve_type.FAST, collect_dynamic = True): """! @brief Peforms cluster analysis using simulation of the oscillatory network. @param[in] order (double): Order of synchronization that is used as indication for stopping processing. @p...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/syncnet.py#L292-L309
[ "def", "process", "(", "self", ",", "order", "=", "0.998", ",", "solution", "=", "solve_type", ".", "FAST", ",", "collect_dynamic", "=", "True", ")", ":", "if", "(", "self", ".", "_ccore_network_pointer", "is", "not", "None", ")", ":", "pointer_output_dyna...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncnet._phase_kuramoto
! @brief Overrided method for calculation of oscillator phase. @param[in] teta (double): Current value of phase. @param[in] t (double): Time (can be ignored). @param[in] argv (uint): Index of oscillator whose phase represented by argument teta. @return (d...
pyclustering/cluster/syncnet.py
def _phase_kuramoto(self, teta, t, argv): """! @brief Overrided method for calculation of oscillator phase. @param[in] teta (double): Current value of phase. @param[in] t (double): Time (can be ignored). @param[in] argv (uint): Index of oscillator whose phase repre...
def _phase_kuramoto(self, teta, t, argv): """! @brief Overrided method for calculation of oscillator phase. @param[in] teta (double): Current value of phase. @param[in] t (double): Time (can be ignored). @param[in] argv (uint): Index of oscillator whose phase repre...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/syncnet.py#L312-L339
[ "def", "_phase_kuramoto", "(", "self", ",", "teta", ",", "t", ",", "argv", ")", ":", "index", "=", "argv", "# index of oscillator\r", "phase", "=", "0.0", "# phase of a specified oscillator that will calculated in line with current env. states.\r", "neighbors", "=", "self...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
syncnet.show_network
! @brief Shows connections in the network. It supports only 2-d and 3-d representation.
pyclustering/cluster/syncnet.py
def show_network(self): """! @brief Shows connections in the network. It supports only 2-d and 3-d representation. """ if ( (self._ccore_network_pointer is not None) and (self._osc_conn is None) ): self._osc_conn = sync_connectivity_matrix(self._ccore...
def show_network(self): """! @brief Shows connections in the network. It supports only 2-d and 3-d representation. """ if ( (self._ccore_network_pointer is not None) and (self._osc_conn is None) ): self._osc_conn = sync_connectivity_matrix(self._ccore...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/cluster/syncnet.py#L342-L399
[ "def", "show_network", "(", "self", ")", ":", "if", "(", "(", "self", ".", "_ccore_network_pointer", "is", "not", "None", ")", "and", "(", "self", ".", "_osc_conn", "is", "None", ")", ")", ":", "self", ".", "_osc_conn", "=", "sync_connectivity_matrix", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hhn_network.simulate_static
! @brief Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model. @details Output dynamic is sensible to amount of steps of simulation and solver of differential equation. Python implementation uses 'odeint' from 'scipy', CCORE uses classical RK4 and R...
pyclustering/nnet/hhn.py
def simulate_static(self, steps, time, solution = solve_type.RK4): """! @brief Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model. @details Output dynamic is sensible to amount of steps of simulation and solver of differential equation. P...
def simulate_static(self, steps, time, solution = solve_type.RK4): """! @brief Performs static simulation of oscillatory network based on Hodgkin-Huxley neuron model. @details Output dynamic is sensible to amount of steps of simulation and solver of differential equation. P...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hhn.py#L286-L343
[ "def", "simulate_static", "(", "self", ",", "steps", ",", "time", ",", "solution", "=", "solve_type", ".", "RK4", ")", ":", "# Check solver before simulation\r", "if", "(", "solution", "==", "solve_type", ".", "FAST", ")", ":", "raise", "NameError", "(", "\"...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hhn_network._calculate_states
! @brief Caclculates new state of each oscillator in the network. Returns only excitatory state of oscillators. @param[in] solution (solve_type): Type solver of the differential equations. @param[in] t (double): Current time of simulation. @param[in] step (uint): Step of so...
pyclustering/nnet/hhn.py
def _calculate_states(self, solution, t, step, int_step): """! @brief Caclculates new state of each oscillator in the network. Returns only excitatory state of oscillators. @param[in] solution (solve_type): Type solver of the differential equations. @param[in] t (double): C...
def _calculate_states(self, solution, t, step, int_step): """! @brief Caclculates new state of each oscillator in the network. Returns only excitatory state of oscillators. @param[in] solution (solve_type): Type solver of the differential equations. @param[in] t (double): C...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hhn.py#L346-L397
[ "def", "_calculate_states", "(", "self", ",", "solution", ",", "t", ",", "step", ",", "int_step", ")", ":", "next_membrane", "=", "[", "0.0", "]", "*", "self", ".", "_num_osc", "next_active_sodium", "=", "[", "0.0", "]", "*", "self", ".", "_num_osc", "...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0
valid
hhn_network.__update_peripheral_neurons
! @brief Update peripheral neurons in line with new values of current in channels. @param[in] t (doubles): Current time of simulation. @param[in] step (uint): Step (time duration) during simulation when states of oscillators should be calculated. @param[in] next_membrane (l...
pyclustering/nnet/hhn.py
def __update_peripheral_neurons(self, t, step, next_membrane, next_active_sodium, next_inactive_sodium, next_active_potassium): """! @brief Update peripheral neurons in line with new values of current in channels. @param[in] t (doubles): Current time of simulation. @param[i...
def __update_peripheral_neurons(self, t, step, next_membrane, next_active_sodium, next_inactive_sodium, next_active_potassium): """! @brief Update peripheral neurons in line with new values of current in channels. @param[in] t (doubles): Current time of simulation. @param[i...
[ "!" ]
annoviko/pyclustering
python
https://github.com/annoviko/pyclustering/blob/98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0/pyclustering/nnet/hhn.py#L400-L436
[ "def", "__update_peripheral_neurons", "(", "self", ",", "t", ",", "step", ",", "next_membrane", ",", "next_active_sodium", ",", "next_inactive_sodium", ",", "next_active_potassium", ")", ":", "self", ".", "_membrane_potential", "=", "next_membrane", "[", ":", "]", ...
98aa0dd89fd36f701668fb1eb29c8fb5662bf7d0