Removed reducing threshold

Signed-off-by: James Ketrenos <james_gitlab@ketrenos.com>
This commit is contained in:
James Ketrenos 2020-01-11 17:59:02 -08:00
parent b792446cc9
commit 2fc08a41b0
2 changed files with 8 additions and 9 deletions

View File

@ -8,7 +8,7 @@ function loadMore(index) {
} }
var faces = clusterBlock.querySelectorAll("div.face").length, i var faces = clusterBlock.querySelectorAll("div.face").length, i
for (i = faces; i < clusters[index].length; i++) { for (i = faces; i < clusters[index].length; i++) {
if (i - faces > 15) { if (i - faces > 10) {
return; return;
} }
var tuple = clusters[index][i], var tuple = clusters[index][i],
@ -51,18 +51,14 @@ document.addEventListener("DOMContentLoaded", (event) => {
document.body.appendChild(clusterBlock); document.body.appendChild(clusterBlock);
var div = document.createElement("div"); var div = document.createElement("div");
var html = "Cluster " + (clusterIndex + 1) + " has " + cluster.length + " neighbors."; var html = "Cluster " + (clusterIndex + 1) + " has " + cluster.length + " neighbors.";
if (cluster.length > 15) { if (cluster.length >= 10) {
html += " <span class='more' onClick='loadMore(" + clusterIndex + ")'>more</a>"; html += " <span class='more' onClick='loadMore(" + clusterIndex + ")'>more</a>";
} }
div.innerHTML = html; div.innerHTML = html;
clusterBlock.appendChild(div); clusterBlock.appendChild(div);
if (clusterIndex > 20) {
return;
}
cluster.forEach((tuple, index) => { cluster.forEach((tuple, index) => {
if (index > 15) { if (index >= 10) {
return; return;
} }
var face = createFace(tuple[0], tuple[1]); var face = createFace(tuple[0], tuple[1]);

View File

@ -152,6 +152,7 @@ long int DBSCAN(Face **ppFaces, long int faceCount, float eps, int minPts) {
float threshold = eps; float threshold = eps;
FaceLink *pNeighbors = RangeQuery(ppFaces, faceCount, pFace, eps); FaceLink *pNeighbors = RangeQuery(ppFaces, faceCount, pFace, eps);
long neighborCount = chainLength(pNeighbors); long neighborCount = chainLength(pNeighbors);
/*
while (neighborCount > minPts * 5) { while (neighborCount > minPts * 5) {
threshold *= 0.9; threshold *= 0.9;
freeChain(pNeighbors); freeChain(pNeighbors);
@ -159,6 +160,7 @@ long int DBSCAN(Face **ppFaces, long int faceCount, float eps, int minPts) {
neighborCount = chainLength(pNeighbors); neighborCount = chainLength(pNeighbors);
fprintf(stderr, "\rWith eps of %f, %ld has %ld neighbors.", threshold, pFace->faceId, neighborCount); fprintf(stderr, "\rWith eps of %f, %ld has %ld neighbors.", threshold, pFace->faceId, neighborCount);
} }
*/
if (neighborCount < minPts) { if (neighborCount < minPts) {
pFace->clusterType = NOISE; pFace->clusterType = NOISE;
@ -193,15 +195,16 @@ long int DBSCAN(Face **ppFaces, long int faceCount, float eps, int minPts) {
FaceLink *pSubNeighbors = RangeQuery(ppFaces, faceCount, pQ, eps); FaceLink *pSubNeighbors = RangeQuery(ppFaces, faceCount, pQ, eps);
neighborCount = chainLength(pSubNeighbors); neighborCount = chainLength(pSubNeighbors);
/*
threshold = eps; threshold = eps;
while (neighborCount > minPts * 5) { while (neighborCount > minPts * 1.25) {
threshold *= 0.9; threshold *= 0.9;
freeChain(pSubNeighbors); freeChain(pSubNeighbors);
pSubNeighbors = RangeQuery(ppFaces, faceCount, pQ, threshold); pSubNeighbors = RangeQuery(ppFaces, faceCount, pQ, threshold);
neighborCount = chainLength(pSubNeighbors); neighborCount = chainLength(pSubNeighbors);
fprintf(stderr, "\rWith eps of %f, %ld has %ld neighbors.", threshold, pQ->faceId, neighborCount); fprintf(stderr, "\rWith eps of %f, %ld has %ld neighbors.", threshold, pQ->faceId, neighborCount);
} }
*/
if (neighborCount >= minPts) { if (neighborCount >= minPts) {
pQ->clusterType = CORE; pQ->clusterType = CORE;
/* Append these neighbors to the end of the chain */ /* Append these neighbors to the end of the chain */