AlgoPlus  v0.1.0
Public Member Functions | List of all members
DBSCAN Class Reference

DBSCAN clustering algorithm class. More...

#include <dbscan.h>

Public Member Functions

 DBSCAN (std::vector< std::pair< double, double >> setOfPoints, double Eps, int64_t MinPts) noexcept
 constructor for the DBSCAN class More...
 
int64_t nextId (int64_t cluster_id)
 
bool ExpandCluster (std::vector< std::pair< double, double > > setOfPoints, std::pair< double, double > point, int64_t cluster_id, double Eps, int64_t MinPts)
 ExpandCluster function. More...
 
std::vector< std::pair< double, double > > get_query (std::vector< std::pair< double, double > > setOfPoints, std::pair< double, double > point, double Eps)
 get_query function More...
 
double dist (std::pair< double, double > a, std::pair< double, double > b)
 dist function More...
 
std::map< std::pair< double, double >, int64_t > get_clusters ()
 get_clusters function More...
 
std::vector< std::pair< double, double > > get_noise ()
 get_noise function More...
 

Detailed Description

DBSCAN clustering algorithm class.

Constructor & Destructor Documentation

◆ DBSCAN()

DBSCAN::DBSCAN ( std::vector< std::pair< double, double >>  setOfPoints,
double  Eps,
int64_t  MinPts 
)
inlineexplicitnoexcept

constructor for the DBSCAN class

Parameters
setOfPointsvector<pair<double,double>>: the input dataset
Epsthe input diameter
MinPtsthe minimum points that a cluster should have to exist

Member Function Documentation

◆ dist()

double DBSCAN::dist ( std::pair< double, double >  a,
std::pair< double, double >  b 
)

dist function

Parameters
athe first input vector
bthe second input vector
Returns
double: the euclidean distance of vector a and b

◆ ExpandCluster()

bool DBSCAN::ExpandCluster ( std::vector< std::pair< double, double > >  setOfPoints,
std::pair< double, double >  point,
int64_t  cluster_id,
double  Eps,
int64_t  MinPts 
)

ExpandCluster function.

Parameters
setOfPointsthe input dataset
pointthe input point
cluster_idthe input cluster_id
Epsthe input diameter
MinPtsthe minimum points that a cluster should have to exist

◆ get_clusters()

std::map< std::pair< double, double >, int64_t > DBSCAN::get_clusters ( )

get_clusters function

Returns
map<pair<double,double>>: the points and their assignments

◆ get_noise()

std::vector< std::pair< double, double > > DBSCAN::get_noise ( )

get_noise function

Returns
vector<pair<double,double>>: the total points that exist as noise in the dataset

◆ get_query()

std::vector< std::pair< double, double > > DBSCAN::get_query ( std::vector< std::pair< double, double > >  setOfPoints,
std::pair< double, double >  point,
double  Eps 
)

get_query function

Parameters
setOfPointsthe input dataset
pointthe input point
Epsthe input diameter

◆ nextId()

int64_t DBSCAN::nextId ( int64_t  cluster_id)

@ brief nextId function @ return int64_t: the next cluster id


The documentation for this class was generated from the following file: