Search is not available for this dataset
text stringlengths 75 104k |
|---|
def __process_by_ccore(self):
"""!
@brief Performs processing using C++ implementation.
"""
if isinstance(self.__initializer, kmeans_plusplus_initializer):
initializer = wrapper.elbow_center_initializer.KMEANS_PLUS_PLUS
else:
initializer = wrapper... |
def __process_by_python(self):
"""!
@brief Performs processing using python implementation.
"""
for amount in range(self.__kmin, self.__kmax):
centers = self.__initializer(self.__data, amount).initialize()
instance = kmeans(self.__data, centers, ccore=True... |
def __calculate_elbows(self):
"""!
@brief Calculates potential elbows.
@details Elbow is calculated as a distance from each point (x, y) to segment from kmin-point (x0, y0) to kmax-point (x1, y1).
"""
x0, y0 = 0.0, self.__wce[0]
x1, y1 = float(len(self.__wce)), ... |
def __find_optimal_kvalue(self):
"""!
@brief Finds elbow and returns corresponding K-value.
"""
optimal_elbow_value = max(self.__elbows)
self.__kvalue = self.__elbows.index(optimal_elbow_value) + 1 + self.__kmin |
def show_ordering_diagram(analyser, amount_clusters = None):
"""!
@brief Display cluster-ordering (reachability-plot) diagram.
@param[in] analyser (ordering_analyser): cluster-ordering analyser whose ordering diagram should be displayed.
@param[in] amount_clusters (uint): i... |
def calculate_connvectivity_radius(self, amount_clusters, maximum_iterations = 100):
"""!
@brief Calculates connectivity radius of allocation specified amount of clusters using ordering diagram and marks borders of clusters using indexes of values of ordering diagram.
@details Parameter 'maxi... |
def extract_cluster_amount(self, radius):
"""!
@brief Obtains amount of clustering that can be allocated by using specified radius for ordering diagram and borders between them.
@details When growth of reachability-distances is detected than it is considered as a start point of cluster,
... |
def __process_by_ccore(self):
"""!
@brief Performs cluster analysis using CCORE (C/C++ part of pyclustering library).
"""
(self.__clusters, self.__noise, self.__ordering, self.__eps,
objects_indexes, objects_core_distances, objects_reachability_distances) = \
... |
def __process_by_python(self):
"""!
@brief Performs cluster analysis using python code.
"""
if self.__data_type == 'points':
self.__kdtree = kdtree(self.__sample_pointer, range(len(self.__sample_pointer)))
self.__allocate_clusters()
if (self.__a... |
def __initialize(self, sample):
"""!
@brief Initializes internal states and resets clustering results in line with input sample.
"""
self.__processed = [False] * len(sample)
self.__optics_objects = [optics_descriptor(i) for i in range(len(sample))] #... |
def __allocate_clusters(self):
"""!
@brief Performs cluster allocation and builds ordering diagram that is based on reachability-distances.
"""
self.__initialize(self.__sample_pointer)
for optic_object in self.__optics_objects:
if o... |
def get_ordering(self):
"""!
@brief Returns clustering ordering information about the input data set.
@details Clustering ordering of data-set contains the information about the internal clustering structure in line with connectivity radius.
@return (ordering_analyser) Anal... |
def __create_neighbor_searcher(self, data_type):
"""!
@brief Returns neighbor searcher in line with data type.
@param[in] data_type (string): Data type (points or distance matrix).
"""
if data_type == 'points':
return self.__neighbor_indexes_points
... |
def __expand_cluster_order(self, optics_object):
"""!
@brief Expand cluster order from not processed optic-object that corresponds to object from input data.
Traverse procedure is performed until objects are reachable from core-objects in line with connectivity radius.
... |
def __extract_clusters(self):
"""!
@brief Extract clusters and noise from order database.
"""
self.__clusters = []
self.__noise = []
current_cluster = self.__noise
for optics_object in self.__ordered_database:
if (optics_obje... |
def __update_order_seed(self, optic_descriptor, neighbors_descriptors, order_seed):
"""!
@brief Update sorted list of reachable objects (from core-object) that should be processed using neighbors of core-object.
@param[in] optic_descriptor (optics_descriptor): Core-object whose neig... |
def __neighbor_indexes_points(self, optic_object):
"""!
@brief Return neighbors of the specified object in case of sequence of points.
@param[in] optic_object (optics_descriptor): Object for which neighbors should be returned in line with connectivity radius.
@return (list) List ... |
def __neighbor_indexes_distance_matrix(self, optic_object):
"""!
@brief Return neighbors of the specified object in case of distance matrix.
@param[in] optic_object (optics_descriptor): Object for which neighbors should be returned in line with connectivity radius.
@return (list)... |
def process(self):
"""!
@brief Performs cluster analysis in line with rules of BIRCH algorithm.
@remark Results of clustering can be obtained using corresponding gets methods.
@see get_clusters()
"""
self.__insert_data();
... |
def __extract_features(self):
"""!
@brief Extracts features from CF-tree cluster.
"""
self.__features = [];
if (len(self.__tree.leafes) == 1):
# parameters are too general, copy all entries
for entry in self.__tree.leaf... |
def __decode_data(self):
"""!
@brief Decodes data from CF-tree features.
"""
self.__clusters = [ [] for _ in range(self.__number_clusters) ];
self.__noise = [];
for index_point in range(0, len(self.__pointer_data)):
(_, clu... |
def __insert_data(self):
"""!
@brief Inserts input data to the tree.
@remark If number of maximum number of entries is exceeded than diameter is increased and tree is rebuilt.
"""
for index_point in range(0, len(self.__pointer_data)):
... |
def __rebuild_tree(self, index_point):
"""!
@brief Rebuilt tree in case of maxumum number of entries is exceeded.
@param[in] index_point (uint): Index of point that is used as end point of re-building.
@return (cftree) Rebuilt tree with encoded points till specifi... |
def __find_nearest_cluster_features(self):
"""!
@brief Find pair of nearest CF entries.
@return (list) List of two nearest enties that are represented by list [index_point1, index_point2].
"""
minimum_distance = float("Inf");
index1 = 0... |
def __get_nearest_feature(self, point, feature_collection):
"""!
@brief Find nearest entry for specified point.
@param[in] point (list): Pointer to point from input dataset.
@param[in] feature_collection (list): Feature collection that is used for obtaining nearest feature ... |
def __read_answer_from_line(self, index_point, line):
"""!
@brief Read information about point from the specific line and place it to cluster or noise in line with that
information.
@param[in] index_point (uint): Index point that should be placed to cluster or noise.
... |
def __read_answer(self):
"""!
@brief Read information about proper clusters and noises from the file.
"""
if self.__clusters is not None:
return
file = open(self.__answer_path, 'r')
self.__clusters, self.__noise = [], []
index_point =... |
def append_cluster(self, cluster, data = None, marker = '.', markersize = None, color = None):
"""!
@brief Appends cluster for visualization.
@param[in] cluster (list): cluster that may consist of indexes of objects from the data or object itself.
@param[in] data (list): If defines... |
def append_clusters(self, clusters, data=None, marker='.', markersize=None):
"""!
@brief Appends list of cluster for visualization.
@param[in] clusters (list): List of clusters where each cluster may consist of indexes of objects from the data or object itself.
@param[in] data (lis... |
def show(self, pair_filter=None, **kwargs):
"""!
@brief Shows clusters (visualize) in multi-dimensional space.
@param[in] pair_filter (list): List of coordinate pairs that should be displayed. This argument is used as a filter.
@param[in] **kwargs: Arbitrary keyword arguments (avai... |
def __create_grid_spec(self, amount_axis, max_row_size):
"""!
@brief Create grid specification for figure to place canvases.
@param[in] amount_axis (uint): Amount of canvases that should be organized by the created grid specification.
@param[in] max_row_size (max_row_size): Maximum... |
def __create_pairs(self, dimension, acceptable_pairs):
"""!
@brief Create coordinate pairs that should be displayed.
@param[in] dimension (uint): Data-space dimension.
@param[in] acceptable_pairs (list): List of coordinate pairs that should be displayed.
@return (list) L... |
def __create_canvas(self, dimension, pairs, position, **kwargs):
"""!
@brief Create new canvas with user defined parameters to display cluster or chunk of cluster on it.
@param[in] dimension (uint): Data-space dimension.
@param[in] pairs (list): Pair of coordinates that will be dis... |
def __draw_canvas_cluster(self, axis_storage, cluster_descr, pairs):
"""!
@brief Draw clusters.
@param[in] axis_storage (list): List of matplotlib axis where cluster dimensional chunks are displayed.
@param[in] cluster_descr (canvas_cluster_descr): Canvas cluster descriptor that sh... |
def __draw_cluster_item_multi_dimension(self, ax, pair, item, cluster_descr):
"""!
@brief Draw cluster chunk defined by pair coordinates in data space with dimension greater than 1.
@param[in] ax (axis): Matplotlib axis that is used to display chunk of cluster point.
@param[in] pai... |
def __draw_cluster_item_one_dimension(self, ax, item, cluster_descr):
"""!
@brief Draw cluster point in one dimensional data space..
@param[in] ax (axis): Matplotlib axis that is used to display chunk of cluster point.
@param[in] item (list): Data point or index of data point.
... |
def append_cluster(self, cluster, data=None, canvas=0, marker='.', markersize=None, color=None):
"""!
@brief Appends cluster to canvas for drawing.
@param[in] cluster (list): cluster that may consist of indexes of objects from the data or object itself.
@param[in] data (lis... |
def append_cluster_attribute(self, index_canvas, index_cluster, data, marker = None, markersize = None):
"""!
@brief Append cluster attribure for cluster on specific canvas.
@details Attribute it is data that is visualized for specific cluster using its color, marker and markersize if last tw... |
def set_canvas_title(self, text, canvas = 0):
"""!
@brief Set title for specified canvas.
@param[in] text (string): Title for canvas.
@param[in] canvas (uint): Index of canvas where title should be displayed.
"""
if canvas > self.__numb... |
def show(self, figure=None, invisible_axis=True, visible_grid=True, display=True, shift=None):
"""!
@brief Shows clusters (visualize).
@param[in] figure (fig): Defines requirement to use specified figure, if None - new figure is created for drawing clusters.
@param[in] invi... |
def __draw_canvas_cluster(self, ax, dimension, cluster_descr):
"""!
@brief Draw canvas cluster descriptor.
@param[in] ax (Axis): Axis of the canvas where canvas cluster descriptor should be displayed.
@param[in] dimension (uint): Canvas dimension.
@param[in] cluster_descr ... |
def gaussian(data, mean, covariance):
"""!
@brief Calculates gaussian for dataset using specified mean (mathematical expectation) and variance or covariance in case
multi-dimensional data.
@param[in] data (list): Data that is used for gaussian calculation.
@param[in] mean (float|n... |
def initialize(self, init_type = ema_init_type.KMEANS_INITIALIZATION):
"""!
@brief Calculates initial parameters for EM algorithm: means and covariances using
specified strategy.
@param[in] init_type (ema_init_type): Strategy for initialization.
@... |
def __calculate_initial_clusters(self, centers):
"""!
@brief Calculate Euclidean distance to each point from the each cluster.
@brief Nearest points are captured by according clusters and as a result clusters are updated.
@return (list) updated clusters as list of clusters... |
def notify(self, means, covariances, clusters):
"""!
@brief This method is used by the algorithm to notify observer about changes where the algorithm
should provide new values: means, covariances and allocated clusters.
@param[in] means (list): Mean of each cluster ... |
def show_clusters(clusters, sample, covariances, means, figure = None, display = True):
"""!
@brief Draws clusters and in case of two-dimensional dataset draws their ellipses.
@param[in] clusters (list): Clusters that were allocated by the algorithm.
@param[in] sample (list... |
def animate_cluster_allocation(data, observer, animation_velocity = 75, movie_fps = 1, save_movie = None):
"""!
@brief Animates clustering process that is performed by EM algorithm.
@param[in] data (list): Dataset that is used for clustering.
@param[in] observer (ema_observ... |
def process(self):
"""!
@brief Run clustering process of the algorithm.
@details This method should be called before call 'get_clusters()'.
"""
previous_likelihood = -200000
current_likelihood = -100000
current_iteration = 0
... |
def euclidean_distance_numpy(object1, object2):
"""!
@brief Calculate Euclidean distance between two objects using numpy.
@param[in] object1 (array_like): The first array_like object.
@param[in] object2 (array_like): The second array_like object.
@return (double) Euclidean distance between ... |
def euclidean_distance_square(point1, point2):
"""!
@brief Calculate square Euclidean distance between two vectors.
\f[
dist(a, b) = \sum_{i=0}^{N}(a_{i} - b_{i})^{2};
\f]
@param[in] point1 (array_like): The first vector.
@param[in] point2 (array_like): The second vector.
@... |
def euclidean_distance_square_numpy(object1, object2):
"""!
@brief Calculate square Euclidean distance between two objects using numpy.
@param[in] object1 (array_like): The first array_like object.
@param[in] object2 (array_like): The second array_like object.
@return (double) Square Euclid... |
def manhattan_distance(point1, point2):
"""!
@brief Calculate Manhattan distance between between two vectors.
\f[
dist(a, b) = \sum_{i=0}^{N}\left | a_{i} - b_{i} \right |;
\f]
@param[in] point1 (array_like): The first vector.
@param[in] point2 (array_like): The second vector.
... |
def manhattan_distance_numpy(object1, object2):
"""!
@brief Calculate Manhattan distance between two objects using numpy.
@param[in] object1 (array_like): The first array_like object.
@param[in] object2 (array_like): The second array_like object.
@return (double) Manhattan distance between ... |
def chebyshev_distance(point1, point2):
"""!
@brief Calculate Chebyshev distance between between two vectors.
\f[
dist(a, b) = \max_{}i\left (\left | a_{i} - b_{i} \right |\right );
\f]
@param[in] point1 (array_like): The first vector.
@param[in] point2 (array_like): The second ve... |
def chebyshev_distance_numpy(object1, object2):
"""!
@brief Calculate Chebyshev distance between two objects using numpy.
@param[in] object1 (array_like): The first array_like object.
@param[in] object2 (array_like): The second array_like object.
@return (double) Chebyshev distance between ... |
def minkowski_distance(point1, point2, degree=2):
"""!
@brief Calculate Minkowski distance between two vectors.
\f[
dist(a, b) = \sqrt[p]{ \sum_{i=0}^{N}\left(a_{i} - b_{i}\right)^{p} };
\f]
@param[in] point1 (array_like): The first vector.
@param[in] point2 (array_like): The seco... |
def minkowski_distance_numpy(object1, object2, degree=2):
"""!
@brief Calculate Minkowski distance between objects using numpy.
@param[in] object1 (array_like): The first array_like object.
@param[in] object2 (array_like): The second array_like object.
@param[in] degree (numeric): Degree of t... |
def canberra_distance_numpy(object1, object2):
"""!
@brief Calculate Canberra distance between two objects using numpy.
@param[in] object1 (array_like): The first vector.
@param[in] object2 (array_like): The second vector.
@return (float) Canberra distance between two objects.
"""
... |
def chi_square_distance(point1, point2):
"""!
@brief Calculate Chi square distance between two vectors.
\f[
dist(a, b) = \sum_{i=0}^{N}\frac{\left ( a_{i} - b_{i} \right )^{2}}{\left | a_{i} \right | + \left | b_{i} \right |};
\f]
@param[in] point1 (array_like): The first vector.
... |
def enable_numpy_usage(self):
"""!
@brief Start numpy for distance calculation.
@details Useful in case matrices to increase performance. No effect in case of type_metric.USER_DEFINED type.
"""
self.__numpy = True
if self.__type != type_metric.USER_DEFINED:
... |
def __create_distance_calculator_basic(self):
"""!
@brief Creates distance metric calculator that does not use numpy.
@return (callable) Callable object of distance metric calculator.
"""
if self.__type == type_metric.EUCLIDEAN:
return euclidean_distance
... |
def __create_distance_calculator_numpy(self):
"""!
@brief Creates distance metric calculator that uses numpy.
@return (callable) Callable object of distance metric calculator.
"""
if self.__type == type_metric.EUCLIDEAN:
return euclidean_distance_numpy
... |
def extract_number_oscillations(self, index, amplitude_threshold):
"""!
@brief Extracts number of oscillations of specified oscillator.
@param[in] index (uint): Index of oscillator whose dynamic is considered.
@param[in] amplitude_threshold (double): Amplitude threshold whe... |
def show_output_dynamic(fsync_output_dynamic):
"""!
@brief Shows output dynamic (output of each oscillator) during simulation.
@param[in] fsync_output_dynamic (fsync_dynamic): Output dynamic of the fSync network.
@see show_output_dynamics
"""
... |
def simulate(self, steps, time, collect_dynamic = False):
"""!
@brief Performs static simulation of oscillatory network.
@param[in] steps (uint): Number simulation steps.
@param[in] time (double): Time of simulation.
@param[in] collect_dynamic (bool): If True - ret... |
def __calculate(self, t, step, int_step):
"""!
@brief Calculates new amplitudes for oscillators in the network in line with current step.
@param[in] t (double): Time of simulation.
@param[in] step (double): Step of solution at the end of which states of oscillators should b... |
def __oscillator_property(self, index):
"""!
@brief Calculate Landau-Stuart oscillator constant property that is based on frequency and radius.
@param[in] index (uint): Oscillator index whose property is calculated.
@return (double) Oscillator property.
... |
def __landau_stuart(self, amplitude, index):
"""!
@brief Calculate Landau-Stuart state.
@param[in] amplitude (double): Current amplitude of oscillator.
@param[in] index (uint): Oscillator index whose state is calculated.
@return (double) Landau-Stuart st... |
def __synchronization_mechanism(self, amplitude, index):
"""!
@brief Calculate synchronization part using Kuramoto synchronization mechanism.
@param[in] amplitude (double): Current amplitude of oscillator.
@param[in] index (uint): Oscillator index whose synchronization infl... |
def __calculate_amplitude(self, amplitude, t, argv):
"""!
@brief Returns new amplitude value for particular oscillator that is defined by index that is in 'argv' argument.
@details The method is used for differential calculation.
@param[in] amplitude (double): Current ampli... |
def small_mind_image_recognition():
"""!
@brief Trains network using letters 'M', 'I', 'N', 'D' and recognize each of them with and without noise.
"""
images = [];
images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_M;
images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_I;
images +=... |
def small_abc_image_recognition():
"""!
@brief Trains network using letters 'A', 'B', 'C', and recognize each of them with and without noise.
"""
images = [];
images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_A;
images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_B;
images += IMAG... |
def small_ftk_image_recognition():
"""!
@brief Trains network using letters 'F', 'T', 'K' and recognize each of them with and without noise.
"""
images = [];
images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_F;
images += IMAGE_SYMBOL_SAMPLES.LIST_IMAGES_SYMBOL_T;
images += IMAGE... |
def get_clusters_representation(chromosome, count_clusters=None):
""" Convert chromosome to cluster representation:
chromosome : [0, 1, 1, 0, 2, 3, 3]
clusters: [[0, 3], [1, 2], [4], [5, 6]]
"""
if count_clusters is None:
count_clusters = ga_math.calc... |
def get_centres(chromosomes, data, count_clusters):
"""!
"""
centres = ga_math.calc_centers(chromosomes, data, count_clusters)
return centres |
def calc_centers(chromosomes, data, count_clusters=None):
"""!
"""
if count_clusters is None:
count_clusters = ga_math.calc_count_centers(chromosomes[0])
# Initialize center
centers = np.zeros(shape=(len(chromosomes), count_clusters, len(data[0])))
for _idx... |
def calc_probability_vector(fitness):
"""!
"""
if len(fitness) == 0:
raise AttributeError("Has no any fitness functions.")
# Get 1/fitness function
inv_fitness = np.zeros(len(fitness))
#
for _idx in range(len(inv_fitness)):
if fitness[_... |
def set_last_value_to_one(probabilities):
"""!
@brief Update the last same probabilities to one.
@details All values of probability list equals to the last element are set to 1.
"""
# Start from the last elem
back_idx = - 1
# All values equal to the las... |
def get_uniform(probabilities):
"""!
@brief Returns index in probabilities.
@param[in] probabilities (list): List with segments in increasing sequence with val in [0, 1],
for example, [0 0.1 0.2 0.3 1.0].
"""
# Initialize return value
res_idx = None
... |
def cluster_sample1():
"Start with wrong number of clusters."
start_centers = [[3.7, 5.5]]
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE1, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE1, criterion = splitt... |
def cluster_sample2():
"Start with wrong number of clusters."
start_centers = [[3.5, 4.8], [2.6, 2.5]]
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE2, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE2, criter... |
def cluster_sample3():
"Start with wrong number of clusters."
start_centers = [[0.2, 0.1], [4.0, 1.0]]
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE3, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE3, criter... |
def cluster_sample5():
"Start with wrong number of clusters."
start_centers = [[0.0, 1.0], [0.0, 0.0]]
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE5, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_SIMPLE5, criter... |
def cluster_elongate():
"Not so applicable for this sample"
start_centers = [[1.0, 4.5], [3.1, 2.7]]
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_ELONGATE, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_centers, SIMPLE_SAMPLES.SAMPLE_ELONGATE, criter... |
def cluster_lsun():
"Not so applicable for this sample"
start_centers = [[1.0, 3.5], [2.0, 0.5], [3.0, 3.0]]
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_LSUN, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_LSUN, criterion ... |
def cluster_target():
"Not so applicable for this sample"
start_centers = [[0.2, 0.2], [0.0, -2.0], [3.0, -3.0], [3.0, 3.0], [-3.0, 3.0], [-3.0, -3.0]]
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_TARGET, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_... |
def cluster_two_diamonds():
"Start with wrong number of clusters."
start_centers = [[0.8, 0.2]]
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_TWO_DIAMONDS, criteri... |
def cluster_hepta():
"Start with wrong number of clusters."
start_centers = [[0.0, 0.0, 0.0], [3.0, 0.0, 0.0], [-2.0, 0.0, 0.0], [0.0, 3.0, 0.0], [0.0, -3.0, 0.0], [0.0, 0.0, 2.5]]
template_clustering(start_centers, FCPS_SAMPLES.SAMPLE_HEPTA, criterion = splitting_type.BAYESIAN_INFORMATION_CRITERION)
... |
def process(self):
"""!
@brief Performs cluster analysis by competition between neurons of SOM.
@remark Results of clustering can be obtained using corresponding get methods.
@see get_clusters()
"""
self.__network = som(1, sel... |
def process(self, order = 0.998, solution = solve_type.FAST, collect_dynamic = False):
"""!
@brief Performs clustering of input data set in line with input parameters.
@param[in] order (double): Level of local synchronization between oscillator that defines end of synchronization pr... |
def __calculate_radius(self, number_neighbors, radius):
"""!
@brief Calculate new connectivity radius.
@param[in] number_neighbors (uint): Average amount of neighbors that should be connected by new radius.
@param[in] radius (double): Current connectivity radius.
... |
def __store_dynamic(self, dyn_phase, dyn_time, analyser, begin_state):
"""!
@brief Store specified state of Sync network to hSync.
@param[in] dyn_phase (list): Output dynamic of hSync where state should be stored.
@param[in] dyn_time (list): Time points that correspond to o... |
def set_encoding(self, encoding):
"""!
@brief Change clusters encoding to specified type (index list, object list, labeling).
@param[in] encoding (type_encoding): New type of clusters representation.
"""
if(encoding == self.__type_representation):
... |
def process(self):
"""!
@brief Performs cluster analysis in line with rules of DBSCAN algorithm.
@see get_clusters()
@see get_noise()
"""
if self.__ccore is True:
(self.__clusters, self.__noise) = wrapper.dbscan(self.__poin... |
def __expand_cluster(self, index_point):
"""!
@brief Expands cluster from specified point in the input data space.
@param[in] index_point (list): Index of a point from the data.
@return (list) Return tuple of list of indexes that belong to the same cluster and list of poi... |
def __neighbor_indexes_points(self, index_point):
"""!
@brief Return neighbors of the specified object in case of sequence of points.
@param[in] index_point (uint): Index point whose neighbors are should be found.
@return (list) List of indexes of neighbors in line the connectivi... |
def __neighbor_indexes_distance_matrix(self, index_point):
"""!
@brief Return neighbors of the specified object in case of distance matrix.
@param[in] index_point (uint): Index point whose neighbors are should be found.
@return (list) List of indexes of neighbors in line the conn... |
def generate(self):
"""!
@brief Generates data in line with generator parameters.
"""
data_points = []
for index_cluster in range(self.__amount_clusters):
for _ in range(self.__cluster_sizes[index_cluster]):
point = self.__generate_point(ind... |
def __generate_point(self, index_cluster):
"""!
@brief Generates point in line with parameters of specified cluster.
@param[in] index_cluster (uint): Index of cluster whose parameters are used for point generation.
@return (list) New generated point in line with normal distributi... |
def __generate_cluster_centers(self, width):
"""!
@brief Generates centers (means in statistical term) for clusters.
@param[in] width (list): Width of generated clusters.
@return (list) Generated centers in line with normal distribution.
"""
centers = []
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.