#include "daal.h"
#include "service.h"
using namespace std;
using namespace daal;
using namespace daal::algorithms;
string datasetFileName = "../data/batch/dbscan_dense.csv";
const float epsilon = 0.02f;
const size_t minObservations = 180;
int main(int argc, char *argv[])
{
checkArguments(argc, argv, 1, &datasetFileName);
FileDataSource<CSVFeatureManager> dataSource(datasetFileName, DataSource::doAllocateNumericTable,
DataSource::doDictionaryFromContext);
dataSource.loadDataBlock();
dbscan::Batch<> algorithm(epsilon, minObservations);
algorithm.input.set(dbscan::data, dataSource.getNumericTable());
algorithm.compute();
printNumericTable(algorithm.getResult()->get(dbscan::nClusters), "Number of clusters:");
printNumericTable(algorithm.getResult()->get(dbscan::assignments), "Assignments of first 20 observations:", 20);
return 0;
}