Former-commit-id: 3ecb155e8c
master
parent bc540fe4e0
commit 6aba08fc1a
  1. 1
      Previously_Executed_Analsis_Files_t-viSNE/Adult_income_shorten_Full.txt.REMOVED.git-id
  2. 1
      Previously_Executed_Analsis_Files_t-viSNE/Bike_dataset_Full.txt
  3. 1
      Previously_Executed_Analsis_Files_t-viSNE/Breast_Cancer_defaultParam_Full.txt
  4. 1
      Previously_Executed_Analsis_Files_t-viSNE/bank_shorten_defaultParam_full.txt.REMOVED.git-id
  5. 27
      css/style.css
  6. 2222
      data/bank-campaign_s.csv
  7. 2
      data/mnist.csv
  8. 19
      index.html
  9. 2
      js/data_form_handler.js
  10. 147
      js/tsne_vis.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -101,12 +101,23 @@ user-select: none;
cursor: default;
}
.right-side-cor {
margin-left:12px;
margin-top: -60px;
}
.right-side-star {
margin-left:12px;
margin-top: -50px;
}
/* Styling of the main canvas */
#modtSNEcanvas {
width: 50vw !important;
height: 50vw !important;
border: 1px solid black;
position: absolute;
margin-left: -7.5px;
z-index: 2;
}
@ -122,7 +133,7 @@ cursor: default;
#knnBarChart {
width: 50vw !important;
height: 4.2vw !important;
margin-top: 7.2vw;
margin-top: 7.2vw !important;
border: 1px solid black;
position: absolute;
display: block;
@ -133,7 +144,7 @@ cursor: default;
width: 50vw ;
height: 50vw ;
opacity: 1.0;
margin-left:15px;
margin-left: 7.5px;
position:absolute;
z-index: 2;
}
@ -143,6 +154,7 @@ cursor: default;
height: 50vw;
opacity: 1.0;
position:absolute;
margin-left: -7.5px;
z-index: 2;
}
@ -275,9 +287,8 @@ rect {
/* This is for the Correlation bar chart */
#correlation{
margin-left: 10px;
margin-left: -20px;
margin-top: -20px;
border: 1px solid black;
}
.y.axis line {
@ -326,6 +337,7 @@ rect {
/* Styling of the main SVG behind canvas */
#SvgAnnotator {
position: absolute;
margin-left:-7.5px;
z-index: 1;
}
@ -338,9 +350,8 @@ rect {
}
#starPlot{
border: 1px solid black;
margin-left:10px;
margin-top:10px;
margin-left:-15px;
margin-top:0px;
}
.parent-row{
@ -352,7 +363,7 @@ rect {
/* Margins for the extra-information panel and the kNNInfo */
#extra-information {
margin-top: 32px;
margin-left: 10px;
margin-left: 5px;
}
#kNNInfo {

File diff suppressed because it is too large Load Diff

@ -1,4 +1,4 @@
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,72,193,254,213,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,183,203,243,253,252,253,252,142,0,0,82,102,20,0,0,0,0,0,0,0,0,0,0,0,0,0,82,254,253,254,253,254,253,254,253,234,30,92,253,255,50,0,0,0,0,0,0,0,0,0,0,0,0,0,203,253,252,253,212,131,50,50,212,233,112,253,252,233,30,0,0,0,0,0,0,0,0,0,0,0,0,52,253,254,192,41,0,0,0,0,203,254,253,254,253,41,0,0,0,0,0,0,0,0,0,0,0,0,0,10,212,253,192,41,0,0,0,0,203,253,252,253,130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,234,253,132,10,0,0,31,213,254,253,123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,232,253,131,0,0,193,252,253,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,193,253,132,213,254,253,203,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,252,253,252,253,212,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,173,254,253,254,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,252,253,252,253,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,253,244,162,254,253,173,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,233,212,122,0,172,252,253,91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,151,0,0,0,203,254,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,253,151,0,0,0,81,253,252,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,213,82,0,0,0,214,253,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,213,252,243,162,203,162,253,252,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,223,254,253,254,253,254,192,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,172,171,253,252,253,111,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
digit*,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,72,193,254,213,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,183,203,243,253,252,253,252,142,0,0,82,102,20,0,0,0,0,0,0,0,0,0,0,0,0,0,82,254,253,254,253,254,253,254,253,234,30,92,253,255,50,0,0,0,0,0,0,0,0,0,0,0,0,0,203,253,252,253,212,131,50,50,212,233,112,253,252,233,30,0,0,0,0,0,0,0,0,0,0,0,0,52,253,254,192,41,0,0,0,0,203,254,253,254,253,41,0,0,0,0,0,0,0,0,0,0,0,0,0,10,212,253,192,41,0,0,0,0,203,253,252,253,130,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,234,253,132,10,0,0,31,213,254,253,123,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,51,232,253,131,0,0,193,252,253,171,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,193,253,132,213,254,253,203,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,71,252,253,252,253,212,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,11,173,254,253,254,50,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,92,252,253,252,253,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,152,253,244,162,254,253,173,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,233,212,122,0,172,252,253,91,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,151,0,0,0,203,254,172,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,253,151,0,0,0,81,253,252,82,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,102,254,213,82,0,0,0,214,253,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,213,252,243,162,203,162,253,252,203,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,82,223,254,253,254,253,254,192,82,0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,0,0,92,196,224,192,176,124,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,251,254,254,254,254,254,201,18,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,28,205,205,205,205,127,213,254,89,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41,246,236,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,197,250,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,219,215,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,182,254,100,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,120,240,254,243,26,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,42,247,254,254,253,171,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,60,210,225,215,254,254,206,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16,6,120,246,254,98,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,139,254,195,10,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,194,254,24,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,170,254,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,27,222,254,112,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,30,216,254,240,25,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,84,214,254,254,96,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,148,117,200,232,254,254,245,139,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,254,254,254,254,254,238,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,137,253,254,239,123,17,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
8,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,111,143,143,191,143,12,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,50,162,220,252,252,252,252,252,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,166,241,252,253,252,252,252,252,252,21,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,229,252,252,252,226,121,128,248,252,245,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,160,252,252,252,156,39,0,171,252,252,140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,241,252,252,187,21,0,91,243,252,233,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,56,252,247,73,6,0,36,246,252,251,140,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,22,200,252,235,60,0,162,252,252,163,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,62,212,252,232,187,253,252,222,36,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,21,209,252,252,253,252,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59,253,253,255,253,58,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,223,252,252,224,252,222,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,55,252,252,161,52,252,252,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,47,238,252,246,34,16,212,252,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,113,252,252,104,0,8,193,252,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,241,252,237,43,0,34,252,252,121,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,160,252,252,229,122,122,235,252,252,116,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,19,237,252,252,252,252,252,253,252,235,9,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,165,252,252,252,252,252,253,252,72,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,94,180,156,185,142,190,81,33,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0

Can't render this file because it is too large.

@ -59,8 +59,8 @@
<div id="control-panel">
<div class="param">
<label for="param-lim" >Points radius scaling factor</label>
<input id="param-lim" type="range" min="1" max="4" value="2", step="0.25" onchange="setReInitialize();">
<output for="param-lim" id="param-lim-value" >2</output>
<input id="param-lim" type="range" min="1" max="4" value="3", step="0.5" onchange="setReInitialize();">
<output for="param-lim" id="param-lim-value" >3</output>
</div>
</div>
</div>
@ -119,9 +119,16 @@
</div>
</div>
<div class="col-md-3 col-md-offset-6">
<div class="panel panel-default right-side-cor">
<div class="panel-heading">
<h2 class="panel-title">Correlation Schema Investigation</h2>
</div>
<div class="panel-body">
<svg id="correlation"></svg>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">
@ -137,7 +144,7 @@
<option value="iris.csv" selected>Iris</option>
<option value="mnist.csv" >Mnist</option>
<option value="Frogs_MFCCs_s.csv" >Frogs</option>
<option value="empty">Add New File</option>
<option value="empty">Upload New File</option>
</select>
<button type="button" class="button" id="FactRes" onclick="FactoryReset()">Factory reset</button>
</div>
@ -181,9 +188,15 @@
</div>
</div>
<div class="col-md-3 col-md-offset-6">
<div class="panel panel-default right-side-star">
<div class="panel-heading">
<h2 class="panel-title">Starplot with PCA Calculation</h2>
</div>
<div class="panel-body">
<div id="starPlot"></div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3">
<div class="panel panel-default">

@ -5,6 +5,7 @@ function changeDataset(value) {
if (format[value.split(".").length-1] != "csv") { // This is a function that handles a new file, which users can upload.
d3.select("#data").select("input").remove();
$("#data").html(''); // Print on the screen the classification label.
d3.select("#data")
.append("input")
.attr("type", "file")
@ -14,6 +15,7 @@ function changeDataset(value) {
getfile(file);
})
} else {
$("#data").html('Data sets'); // Print on the screen the classification label.
d3.select("#data").select("input").remove(); // Remove the selection field.
}

@ -80,7 +80,6 @@ var getData = function() {
let format;
let value;
if (typeof window.FileReader !== 'function') {
alert("The file API is not supported on this browser yet.");
}
@ -91,7 +90,6 @@ var getData = function() {
} else if (!input.files) {
alert("This browser does not seem to support the `files` property of file inputs.");
} else if (!input.files[0]) {
value = document.getElementById("param-dataset").value; // Get the value of the data set
format = value.split("."); //Get the format (e.g., [iris, csv])
if (format[value.split(".").length-1] == "csv") { // Parse the predefined files
@ -106,12 +104,14 @@ var getData = function() {
// Load an analysis and parse the previous points and parameters information.
AnalysisResults = JSON.parse(lines);
var length = (AnalysisResults.length - 7);
ParametersSet = AnalysisResults.slice(length+1, AnalysisResults.length+7)
value = ParametersSet[0];
if (!isNaN(parseInt(value))){
flagAnalysis = true;
length = (AnalysisResults.length - 9);
ParametersSet = AnalysisResults.slice(length+1, length+7);
value = ParametersSet[0];
} else {
flagAnalysis = false;
@ -346,6 +346,7 @@ function lassoEnable(){ // The main Layer becomes the correlation (barchart)
function setAnnotator(){ // Set a new annotation on top of the main visualization.
console.log(dimensions);
vw2 = dimensions;
vh2 = dimensions;
var textarea = document.getElementById("comment").value;
@ -369,8 +370,8 @@ function setAnnotator(){ // Set a new annotation on top of the main visualizatio
.draggable(true);
var svgAnnotator = d3v3.select("#SvgAnnotator")
.attr("width", vw2 * 0.5)
.attr("height", vh2 * 0.888)
.attr("width", vw2)
.attr("height", vh2)
.style("z-index", 3);
var gAnnotations = svgAnnotator.append("g")
.attr("class", "annotations")
@ -565,9 +566,8 @@ function init(data, results_all, fields) {
}
}
$("#datasetDetails").html("Number of Dimensions: " + (Object.keys(dataFeatures[0]).length - valCategExists) + ", Number of Samples: " + final_dataset.length); // Print on the screen the number of dimensions and samples of the data set, which is being analyzed.
$("#datasetDetails").html("Number of Features: " + (Object.keys(dataFeatures[0]).length - valCategExists) + ", Number of Instances: " + final_dataset.length); // Print on the screen the number of features and instances of the data set, which is being analyzed.
if (Category == undefined){
console.log("mpike");
$("#CategoryName").html("Classification label: No category"); // Print on the screen the classification label.
} else {
$("#CategoryName").html("Classification label: "+Category.replace('*','')); // Print on the screen the classification label.
@ -793,6 +793,8 @@ function updateEmbedding(AnalysisResults) {
document.getElementById("param-distance").value = ParametersSet[4];
document.getElementById("param-transform").value = ParametersSet[5];
}
$("#data").html(ParametersSet[0]); // Print on the screen the classification label.
$("#param-dataset").html('-');
}
InitialStatePoints = points; // Initial Points will not be modified!
@ -1245,22 +1247,26 @@ function redraw(repoints){ // On redraw manipulate the points of the main and ov
function handleLassoEnd(lassoPolygon) { // This is for the lasso interaction
var countLassoFalse = 0;
KNNEnabled = true;
for (var i = 0 ; i < points.length ; i ++) {
x = points[i].x;
y = points[i].y;
if (d3.polygonContains(lassoPolygon, [x, y])){ // Check if the points are inside the area of the lasso
if (d3.polygonContains(lassoPolygon, [x, y])){
points[i].selected = true;
points2d[i].selected = true;
} else{
countLassoFalse = countLassoFalse + 1; // Count the points which are not inside the lasso interaction.
countLassoFalse = countLassoFalse + 1;
points[i].selected = false;
points2d[i].selected = true;
}
}
if (countLassoFalse == points.length){
for (var i = 0 ; i < points.length ; i ++) {
points[i].selected = true;
points2d[i].selected = true;
}
}
if (points.length - countLassoFalse <= 10 && points.length - countLassoFalse != 0){ // Check the points for the starplot
if (points.length - countLassoFalse <= 10 && points.length - countLassoFalse != 0){
for (var i = 0 ; i < points.length ; i ++) {
if (points[i].selected == true){
points[i].starplot = true;
@ -1271,12 +1277,20 @@ function handleLassoEnd(lassoPolygon) { // This is for the lasso interaction
points[i].starplot = false;
}
}
redraw(points); // Redraw the points according to the new specifications.
redraw(points);
}
function handleLassoStart(lassoPolygon) { // Empty we do not need to reset anything.
KNNEnabled = false;
for (var i = 0 ; i < points.length ; i ++) {
points[i].selected = true;
points[i].starplot = false;
points2d[i].selected = true;
}
redraw(points);
}
// Initialize the horizontal (correlations) barchart's variables
@ -2100,59 +2114,42 @@ if (points.length) { // If points exist (at least 1 point)
var indices2d = new Array(selectedPoints.length);
var findNearest;
var counter1;
var counter2;
var temp = [];
var temp2 = [];
var viewport = getViewport(); // Get the main viewport width height
var vw = viewport[0] * 0.5;
var vh = viewport[1] * 0.042;
var factor = Math.log10(points.length) * 4; // This is a factor which a programmer sets
if (factor == 0){
factor = 1;
}
var maxKNN = Math.ceil(points.length / factor); // Specify the amount of k neighborhoods that we are going to calculate.
if (maxKNN > 150){
maxKNN = 150;
}
var maxKNN = 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.
return parseFloat(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!
if (selectedPoints.length == 1){
alert("You have selected only one point. We cannot compute the purity of one point. Please, consider selecting at least two points.")
}
for (k=maxKNN; k>1; 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;
var indexOrderSliced = [];
var indexOrderSliced2d = [];
var count1 = new Array(selectedPoints.length).fill(0);
var count2 = new Array(selectedPoints.length).fill(0);
counter1 = 0;
counter2 = 0;
for (var i=0; i<selectedPoints.length; i++){ // For the selected points check the purity of the cluster.
temp[i] = 0;
temp2[i] = 0;
if (k == maxKNN){
var count = [];
var sumIntersectionAvg = 0;
var sumUnionAvg = 0;
var sumIntersection = [];
var sumUnion = [];
for (var i=0; i<selectedPoints.length;i++){
count[i] = 0;
var id = selectedPoints[i].id;
// Temporary array holds objects with position and sort-value
indices[i] = dists[i].map(function(el, i) {
return [ i, el ];
indices[i] = dists[id].map(function(el, j) {
return [ j, el ];
})
var index = indices[i].indexOf(selectedPoints[i].id);
if (index > -1) {
indices[i].splice(index, 1);
indices2d[i] = dists2d[id].map(function(el, j) {
return [ j, el ];
})
if (k == maxKNN){
for (var j = id+1; j<points.length; j++){ // For the selected points check the purity of the cluster.
indices[i].push([j,dists[j][id]]);
indices2d[i].push([j,dists2d[j][id]]);
}
// Sorting the mapped array containing the reduced values
indices[i].sort(function(a, b) {
@ -2166,16 +2163,6 @@ if (points.length) { // If points exist (at least 1 point)
});
indexOrder[i] = indices[i].map(function(value) { return value[0]; });
// Temporary array holds objects with position and sort-value
indices2d[i] = dists2d[i].map(function(el, i) {
return [ i, el ];
})
var index2d = indices2d[i].indexOf(selectedPoints[i].id);
if (index2d > -1) {
indices2d[i].splice(index2d, 1);
}
// Sorting the mapped array containing the reduced values
indices2d[i].sort(function(a, b) {
if (a[1] > b[1]) {
@ -2186,38 +2173,31 @@ if (points.length) { // If points exist (at least 1 point)
}
return 0;
});
indexOrder2d[i] = indices2d[i].map(function(value) { return value[0]; });
}
indexOrderSliced[i] = indexOrder[i].slice(0,k);
indexOrderSliced2d[i] = indexOrder2d[i].slice(0,k);
for (var m=0; m < indexOrderSliced2d[i].length; m++){
if (indexOrderSliced[i].includes(indexOrderSliced2d[i][m])){ // Union
count1[i] = count1[i] + 1;
temp[i] = temp[i] + 1;
}
if(indexOrderSliced[i][m] == indexOrderSliced2d[i][m]){ // Intersection
count2[i] = count2[i] + 1;
temp2[i] = temp2[i] + 1;
count[i] = count[i] + 1;
}
}
if (count1[i] != 0){
counter1 = (count1[i] / temp[i]) + counter1;
}
if (count2[i] != 0){
counter2 = (count2[i] / temp2[i]) + counter2;
sumIntersection.push(count[i]);
sumUnion.push((k*2 - sumIntersection[i]));
}
for (var i=0; i<selectedPoints.length;i++){
sumIntersectionAvg = sumIntersection[i] + sumIntersectionAvg;
sumUnionAvg = sumUnion[i] + sumUnionAvg;
}
sumUnion = counter1 / selectedPoints.length; // Union
sumIntersection = counter2 / selectedPoints.length; // Intersection
if (sumUnion == 0){
findNearest = 0; // Prevent the division by 0 value.
sumIntersectionAvg = sumIntersectionAvg / selectedPoints.length;
sumUnionAvg = sumUnionAvg / selectedPoints.length;
if (sumIntersectionAvg == 0){
findNearest = 0;
} else{
findNearest = sumIntersection / sumUnion; // Nearest neighbor!
findNearest = sumIntersectionAvg / sumUnionAvg; // Nearest neighbor!
}
if (isNaN(findNearest)){
@ -2225,6 +2205,7 @@ if (points.length) { // If points exist (at least 1 point)
}
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.reverse();
var barPadding = 5; // Leave some space between the bars
@ -2258,13 +2239,15 @@ if (points.length) { // If points exist (at least 1 point)
for (var i=0; i < selectedPoints.length; i++){
if (selectedPoints[i].starplot == true){ // Count the selected points
coun = coun + 1;
console.log(coun);
}
}
if(selectedPoints.length <= 10 && coun > 0){ // If points > 10 then do not draw! If points = 0 then do not draw!
var FeatureWise = [];
for (var j=0; j<Object.values(dataFeatures[0]).length; j++){ // Get the features of the data set.
for (var i=0;i<dataFeatures.length;i++){
if (!isNaN(Object.values(dataFeatures[i])[j])){
@ -2446,15 +2429,6 @@ if (points.length) { // If points exist (at least 1 point)
})
}
// Here we start with the Three.js (zoom and drag functions!)
window.addEventListener('resize', () => {
window.innerWidth = dimensions;
window.innerHeight = dimensions;
renderer.setSize(dimensions, dimensions);
camera.aspect = dimensions / dimensions;
camera.updateProjectionMatrix();
})
let zoom = d3.zoom()
.scaleExtent([getScaleFromZ(far), getScaleFromZ(near)])
.on('zoom', () => {
@ -2837,7 +2811,7 @@ if (points.length) { // If points exist (at least 1 point)
viewPortWidth = document.getElementsByTagName('body')[0].clientWidth,
viewPortHeight = document.getElementsByTagName('body')[0].clientHeight
}
console.log
return [viewPortWidth, viewPortHeight];
}
@ -2889,7 +2863,6 @@ function SaveAnalysis(){ // Save the analysis into a .txt file
AllData = points.concat(points2d).concat(overallCost).concat(Parameters);
}
}
download(JSON.stringify(AllData),'Analysis'+measureSaves+'.txt', 'text/plain');
}
Loading…
Cancel
Save