Skip to content

Commit

Permalink
#381: Create skeleton of CLIQUE algorithm.
Browse files Browse the repository at this point in the history
  • Loading branch information
annoviko committed Jan 23, 2019
1 parent ed6e3e8 commit 828aeca
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
16 changes: 15 additions & 1 deletion docs/citation.bib
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,20 @@ @article{article::cluster::silhouette::1
url = {http://dx.doi.org/10.1016/0377-0427(87)90125-7},
doi = {10.1016/0377-0427(87)90125-7},
publisher = {Elsevier Science Publishers B. V.},
}
}
@article{article::clique::1,
author = "Agrawal, Rakeshand Gehrke, Johannes and Gunopulos, Dimitrios and Raghavan, Prabhakar",
title = "Automatic Subspace Clustering of High Dimensional Data",
journal = "Data Mining and Knowledge Discovery",
year = "2005",
month = "Jul",
day = "01",
volume = "11",
number = "1",
pages = "5--33",
issn = "1573-756X",
doi = "10.1007/s10618-005-1396-1",
url = "https://doi.org/10.1007/s10618-005-1396-1"
}
65 changes: 65 additions & 0 deletions pyclustering/cluster/clique.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
"""!
@brief Cluster analysis algorithm: CLIQUE
@details Implementation based on paper @cite article::clique::1.
@authors Andrei Novikov ([email protected])
@date 2014-2019
@copyright GNU Public License
@cond GNU_PUBLIC_LICENSE
PyClustering is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
PyClustering is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
@endcond
"""


class spatial_block:
def __init__(self):
pass


class clique:
def __init__(self, data, amount_intervals, density_threshold):
self.__data = data
self.__amount_intervals = amount_intervals
self.__density_threshold = density_threshold

self.__clusters = []
self.__noise = []

self.__validate_arguments()


def process(self):
pass


def get_clusters(self):
return self.__clusters


def get_noise(self):
return self.__noise


def __validate_arguments(self):
if len(self.__data) == 0:
raise ValueError("Empty input data. Data should contain at least one point.")

if self.__amount_intervals <= 0:
raise ValueError("Incorrect amount of intervals '%d'. Amount of intervals value should be greater than 0." % self.__amount_intervals)

if self.__density_threshold < 0:
raise ValueError("Incorrect density threshold '%f'. Density threshold should not be negative." % self.__density_threshold)

0 comments on commit 828aeca

Please sign in to comment.