functionBetatSNE(points){// Run the main visualization
functionBetatSNE(points){// Run the main visualization
inside=inside+1;
if(points.length){// If points exist (at least 1 point)
if(points.length){// If points exist (at least 1 point)
selectedPoints=[];
selectedPoints=[];
varfindNearestTable=[];
varfindNearestTable=[];
varfindNearestTableCombination=[];
for(letm=0;m<points.length;m++){
for(letm=0;m<points.length;m++){
if(points[m].selected==true){
if(points[m].selected==true){
selectedPoints.push(points[m]);// Add the selected points in to a new variable
selectedPoints.push(points[m]);// Add the selected points in to a new variable
@ -2140,12 +2145,10 @@ if (points.length) { // If points exist (at least 1 point)
varvh=viewport[1]*0.042;
varvh=viewport[1]*0.042;
varmaxKNN=document.getElementById("param-perplexity-value").value;// Specify the amount of k neighborhoods that we are going to calculate. According to "perplexity."
varmaxKNN=document.getElementById("param-perplexity-value").value;// Specify the amount of k neighborhoods that we are going to calculate. According to "perplexity."
selectedPoints.sort(function(a,b){// Sort the points according to ID.
selectedPoints.sort(function(a,b){// Sort the points according to ID.
returnparseFloat(a.id)-parseFloat(b.id);
returnparseFloat(a.id)-parseFloat(b.id);
});
});
$("#kNNDetails").html("Purity of the cluster was checked for k values starting from "+(1)+" to "+maxKNN+".");// Print on the screen the number of k values of kNN which we present!
for(k=maxKNN;k>0;k--){// Start from the maximum k value and go to the minimum (k=2).
for(k=maxKNN;k>0;k--){// Start from the maximum k value and go to the minimum (k=2).
findNearest=0;
findNearest=0;
@ -2223,46 +2226,64 @@ if (points.length) { // If points exist (at least 1 point)
if(isNaN(findNearest)){
if(isNaN(findNearest)){
findNearest=0;// If kNN is fully uncorrelated then we say that the value is 0.
findNearest=0;// If kNN is fully uncorrelated then we say that the value is 0.
}
}
findNearestTable.push(findNearest*vh*2);// These values are multiplied by the height of the viewport because we need to draw the bins of the barchart representation
findNearestTable.push(findNearest.toFixed(2));// These values are multiplied by the height of the viewport because we need to draw the bins of the barchart representation
}
}
findNearestTable.reverse();
findNearestTable.reverse();
varbarPadding=5;// Leave some space between the bars