Fixed the kNN barchart

parent 21930948db
commit 33e029e1ad
  1. 1
      Previously_Executed_Analyses_Files/Bank_Projection.txt
  2. 2
      css/style.css
  3. 2
      data/bank-additional_s.csv
  4. 8
      js/tsne_vis.js
  5. 4
      modules/d3-star/d3-starPlot.js

File diff suppressed because one or more lines are too long

@ -425,4 +425,4 @@ ul {
position: absolute; position: absolute;
left: 5px; left: 5px;
top: 5px; top: 5px;
} }

@ -1,4 +1,4 @@
age;job;marital;education;default;housing;loan;contact;month;day_of_week;duration;campaign;pdays;previous;poutcome;emp.var.rate;cons.price.idx;cons.conf.idx;euribor3m;nr.employed;Outcome* age;job;marital;education;default;housing;loan;contact;month;day_of_week;duration;campaign;pdays;previous;poutcome;emp.var.rate;cons.price.idx;cons.conf.idx;euribor3m;nr.employed;y*
30;blue-collar;married;basic.9y;no;yes;no;cellular;may;fri;487;2;999;0;nonexistent;-1.8;92.893;-46.2;1.313;5099.1;no 30;blue-collar;married;basic.9y;no;yes;no;cellular;may;fri;487;2;999;0;nonexistent;-1.8;92.893;-46.2;1.313;5099.1;no
39;services;single;high.school;no;no;no;telephone;may;fri;346;4;999;0;nonexistent;1.1;93.994;-36.4;4.855;5191;no 39;services;single;high.school;no;no;no;telephone;may;fri;346;4;999;0;nonexistent;1.1;93.994;-36.4;4.855;5191;no
25;services;married;high.school;no;yes;no;telephone;jun;wed;227;1;999;0;nonexistent;1.4;94.465;-41.8;4.962;5228.1;no 25;services;married;high.school;no;yes;no;telephone;jun;wed;227;1;999;0;nonexistent;1.4;94.465;-41.8;4.962;5228.1;no

1 age job marital education default housing loan contact month day_of_week duration campaign pdays previous poutcome emp.var.rate cons.price.idx cons.conf.idx euribor3m nr.employed Outcome* y*
2 30 blue-collar married basic.9y no yes no cellular may fri 487 2 999 0 nonexistent -1.8 92.893 -46.2 1.313 5099.1 no
3 39 services single high.school no no no telephone may fri 346 4 999 0 nonexistent 1.1 93.994 -36.4 4.855 5191 no
4 25 services married high.school no yes no telephone jun wed 227 1 999 0 nonexistent 1.4 94.465 -41.8 4.962 5228.1 no

@ -1587,11 +1587,11 @@ function CalculateCorrel(){ // Calculate the correlation is a function which has
for (var j = 0; j < correlationResults.length; j++) { for (var j = 0; j < correlationResults.length; j++) {
for (var i = 0; i < SignStore.length; i++) { for (var i = 0; i < SignStore.length; i++) {
if (SignStore[i][1]*(-1) == correlationResults[j][1]) { if (SignStore[i][1]*(-1) == correlationResults[j][1]) {
correlationResults[j][1] = (correlationResults[j][1]).toFixed(2) * (-1); // Give the negative sign if needed and multiply by 100 correlationResults[j][1] = (correlationResults[j][1]).toFixed(4) * (-1); // Give the negative sign if needed and multiply by 100
correlationResults[j].push(j); correlationResults[j].push(j);
} }
if (SignStore[i][1] == correlationResults[j][1]) { if (SignStore[i][1] == correlationResults[j][1]) {
correlationResults[j][1] = (correlationResults[j][1]).toFixed(2); // Give a positive sign and multiply by 100 correlationResults[j][1] = (correlationResults[j][1]).toFixed(4); // Give a positive sign and multiply by 100
correlationResults[j].push(j); correlationResults[j].push(j);
} }
} }
@ -2265,7 +2265,7 @@ if (points.length) { // If points exist (at least 1 point)
margin: { margin: {
l: 30, l: 30,
r: 30, r: 30,
b: 20, b: 25,
t: 20, t: 20,
pad: 4 pad: 4
}, },
@ -2346,7 +2346,7 @@ if (points.length) { // If points exist (at least 1 point)
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
//////////////////// Draw the Chart ////////////////////////// //////////////////// Draw the Chart //////////////////////////
////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////
var colors = ['#8dd3c7','#ffffb3','#bebada','#fb8072','#80b1d3','#fdb462','#b3de69','#fccde5','#d9d9d9','#bc80bd']; // Colorscale for the starplot var colors = ['#a6cee3','#1f78b4','#b2df8a','#33a02c','#fb9a99','#e31a1c','#fdbf6f','#ff7f00','#cab2d6']; // Colorscale for the starplot
var colorScl = d3v3.scale.ordinal() var colorScl = d3v3.scale.ordinal()
.domain(IDS) .domain(IDS)
.range(colors); .range(colors);

@ -13,7 +13,7 @@ function RadarChart(id, data, color, IDS, options) {
levels: 3, //How many levels or inner circles should there be drawn levels: 3, //How many levels or inner circles should there be drawn
maxValue: 1, //What is the value that the biggest circle will represent maxValue: 1, //What is the value that the biggest circle will represent
labelFactor: 1.3, //How much farther than the radius of the outer circle should the labels be placed labelFactor: 1.3, //How much farther than the radius of the outer circle should the labels be placed
wrapWidth: 60, //The number of pixels after which a label needs to be given a new line wrapWidth: 100, //The number of pixels after which a label needs to be given a new line
opacityArea: 0.35, //The opacity of the area of the blob opacityArea: 0.35, //The opacity of the area of the blob
dotRadius: 4, //The size of the colored circles of each blog dotRadius: 4, //The size of the colored circles of each blog
opacityCircles: 0.1, //The opacity of the circles of each blob opacityCircles: 0.1, //The opacity of the circles of each blob
@ -127,7 +127,7 @@ function RadarChart(id, data, color, IDS, options) {
.attr("class", "legend") .attr("class", "legend")
.style("font-size", "11px") .style("font-size", "11px")
.attr("text-anchor", "middle") .attr("text-anchor", "middle")
.attr("dy", "0.35em") .attr("dy", "0em")
.attr("x", function(d, i){ return rScale(maxValue * cfg.labelFactor) * Math.cos(angleSlice*i - Math.PI/2); }) .attr("x", function(d, i){ return rScale(maxValue * cfg.labelFactor) * Math.cos(angleSlice*i - Math.PI/2); })
.attr("y", function(d, i){ return rScale(maxValue * cfg.labelFactor) * Math.sin(angleSlice*i - Math.PI/2); }) .attr("y", function(d, i){ return rScale(maxValue * cfg.labelFactor) * Math.sin(angleSlice*i - Math.PI/2); })
.text(function(d){return d}) .text(function(d){return d})

Loading…
Cancel
Save