0
$\begingroup$

I'm trying to classify web traffic using clustering algorithms with my own C program, capturing packets with libpcap. In this article K-Means, DBSCAN and AutoClass algorithms were used to classify web traffic.

I tested my dataset with different implementations of K-Means and DBSCAN, yet it is unclear to me how these two algorithms deal with data:

in K-Means from a C clustering library, the dataset is a matrix of double** where the rows are the points of observation and the columns are the features; this data struct suits me fine, in my code every row is a connection and every column is a feature (delay, or average dimension, or bps, ...) of it;

in DBSCAN from a git repo the dataset is an int ** matrix;

in another DBSCAN repo there is no matrix of features like above, but a linked list of struct point with double x, y coordinates.

I'm confused about the dataset representation: in my program, for every connection (row) there are a number of features (columns), but this representation seems to not agree with a linked list of points like in the second implementation of DBSCAN: should I convert the K-Means dataset implemented as a matrix in a linked list of struct point for DBSCAN?

I know this seems a CodeReview question but I want to figure this out.

$\endgroup$

1 Answer 1

0
$\begingroup$

k-means needs to compute means.

Therefore, it only works on a vector space.

DBSCAN (see Generalized DBSCAN) needs:

  • a neighborhood query (typically radius based but can be anything)
  • a decision if a point is "core point" or not (typically based on the number of neighbors)

it is thus much more general. The implemetations you looked at probably were not very good.

$\endgroup$
2
  • $\begingroup$ So I can picture my K-Means nxm matrix as a DBSCAN set of n points with m dimensions each? $\endgroup$
    – elmazzun
    Commented Feb 1, 2016 at 14:23
  • $\begingroup$ K-Means expects a nxm matrix. DBSCAN does not: it could process e.g. polygons, or CAD objects, or images, or audio signals, or text, or a graph, or ... if you you Euclidean distance, it will of course work with a nxm matrix, too. $\endgroup$ Commented Feb 1, 2016 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.