Skip to content

Commit cafccb1

Browse files
committed
Added a case for 16 dim (for sparse score)
1 parent b43558e commit cafccb1

File tree

2 files changed

+60
-3
lines changed

2 files changed

+60
-3
lines changed

css/playground.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ html {
55

66
body {
77
font-family: "Helvetica", "Arial", sans-serif;
8-
background-color: #f7f7f7;
8+
/* background-color: #f7f7f7; */
99
margin: 0;
1010
font-size: 12px;
1111
font-weight: 400;

scagnosticsnd/index.js

Lines changed: 59 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,62 @@ function sparseScatterPlot() {
138138
}
139139

140140
datasets.push(points);
141+
142+
// let points = [];
143+
// let dim = 16;
144+
// //Extreme of each coordinates
145+
// //Cluster 1
146+
// for (let i = 0; i < 8; i++) {
147+
// let point = [];
148+
// for (let j = 0; j < dim; j++) {
149+
// if (j < dim / 3) {
150+
// point.push(10 + random());
151+
// } else {
152+
// point.push(random());
153+
// }
154+
// }
155+
// point.data = 'green';
156+
// points.push(point);
157+
// }
158+
// //Cluster 2
159+
// for (let i = 0; i < 8; i++) {
160+
// let point = [];
161+
// for (let j = 0; j < dim; j++) {
162+
// if (j >= dim / 3 && j < 2 * dim / 3) {
163+
// point.push(10 + random());
164+
// } else {
165+
// point.push(random());
166+
// }
167+
// }
168+
// point.data = 'blue';
169+
// points.push(point);
170+
// }
171+
//
172+
// //Cluster 3
173+
// for (let i = 0; i < 8; i++) {
174+
// let point = [];
175+
// for (let j = 0; j < dim; j++) {
176+
// if (j >= 2 * dim / 3 && j < dim) {
177+
// point.push(10 + random());
178+
// } else {
179+
// point.push(random());
180+
// }
181+
// }
182+
// point.data = 'black';
183+
// points.push(point);
184+
// }
185+
//
186+
// //Cluster 4
187+
// for (let i = 0; i < 6; i++) {
188+
// let point = [];
189+
// for (let j = 0; j < dim; j++) {
190+
// point.push(10 + random());
191+
// }
192+
// point.data = 'red';
193+
// points.push(point);
194+
// }
195+
//
196+
// datasets.push(points);
141197
}
142198

143199
/***********CLUMPY 3 CLUSTERS*******************/
@@ -303,7 +359,8 @@ function draw(points) {
303359
incrementB: 5,
304360
decrementA: 0.9,
305361
decrementB: 0,
306-
distanceWeights: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
362+
// distanceWeights: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
363+
307364
};
308365
// let scagOptions = {};
309366
scag = scagnosticsnd(points, scagOptions);
@@ -382,4 +439,4 @@ function displayScagScores(scag) {
382439
d3.select('#skinnyScoreMsg').html(scag.skinnyScore);
383440
d3.select('#stringyScoreMsg').html(scag.stringyScore);
384441
d3.select('#monotonicScoreMsg').html(scag.monotonicScore);
385-
}
442+
}

0 commit comments

Comments
 (0)