AlgoPlus v0.1.0
Loading...
Searching...
No Matches
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
 
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.
 
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
 
double dist (std::pair< double, double > a, std::pair< double, double > b)
 dist function
 
std::map< std::pair< double, double >, int64_t > get_clusters ()
 get_clusters function
 
std::vector< std::pair< double, double > > get_noise ()
 get_noise function
 

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 )
inline

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 ( )
inline

get_clusters function

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

◆ get_noise()

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

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 )
inline

get_query function

Parameters
setOfPointsthe input dataset
pointthe input point
Epsthe input diameter

◆ nextId()

int64_t DBSCAN::nextId ( int64_t cluster_id)
inline

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


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