-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathpca.html
133 lines (114 loc) · 6.07 KB
/
pca.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
<link rel="icon" href="static/images/favicon.ico" type="image/x-icon">
<meta charset='utf-8'>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='https://fonts.googleapis.com/css?family=Architects+Daughter' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="static/stylesheets/pygment_trac.css" media="screen">
<link rel="stylesheet" type="text/css" href="static/stylesheets/print.css" media="print">
<link rel="stylesheet" type="text/css" href="static/stylesheets/stylesheet.css" media="screen">
<script type="text/javascript" src="static/javascripts/d3.v3.js"></script>
<script src="static/javascripts/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="static/javascripts/jquery.tipsy.js"></script>
<link href="static/stylesheets/tipsy.css" rel="stylesheet" type="text/css" />
<!-- <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> -->
<script> src="http://underscorejs.org/#without"</script>
<style type="text/css">
rect:hover {
fill: orange;
}
.axis {
font: 5px sans-serif;
}
.axis path,
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
/* .x.axis path {
display: none;
}*/
</style>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<title>InfoVis_icon</title>
</head>
<body>
<header>
<div class="inner">
<h1>VisML</h1>
<h2>InfoVis serving machine learning modelling</h2>
<a href="https://github.com/NYU-CS6313-Projects/sp2015-group11" class="button"><small>View project on</small> GitHub</a>
</div>
</header>
<div id="content-wrapper">
<div class="inner clearfix">
<section id="main-content">
<svg id="pca" width="250" height="250"
viewBox="0 0 250 250"
preserveAspectRatio="xMidYMid">
</svg>
<hr />
<script src="static/javascripts/mdsjs.js" ></script>
<script src="static/javascripts/scatter.js" ></script>
<script type="text/javascript">
d3.csv("data/Sample02_n1000.csv", function(error, data) {
var matArr = [];
var patients = new Array();
var cols = null;
var i = 0;
data.forEach(function(d) {
cols = Object.keys(d).filter(function(c) {
if (c != "id" && c !="outcome" && c != "test") {
return c}
})
var skip = !!(+d["test"]);
if(skip) return;
var id = d["id"];
var vec = cols.map(function(c) {
return +d[c];
});
var outcome = !!(+d["outcome"]);
patients.push([id, i++, outcome]);
matArr.push(vec);
});
var mat = mdsjs.convertToMatrix(matArr);
console.log(mat);
mdsjs.pcaAsync(mat, function(pcs) {
var points = mat.mul(pcs);
assignPos(pcs);
});
console.log(points);
})
</script>
<h3><a id="welcome-to-github-pages" class="anchor" href="#welcome-to-github-pages" aria-hidden="true"><span class="octicon octicon-link"></span></a>Welcome to VisML!</h3>
<p>Please interact with the app</p><pre><code>$ git clonehttps://github.com/NYU-CS6313-Projects/sp2015-group11.git <br>$ cd sp2015-group11<br>$ python -m SimpleHTTPServer 8888</code></pre>
</section>
<aside id="sidebar">
<!-- <a href="https://github.com/NYU-CS6313-Projects/sp2015-group11/zipball/master" class="button">
<small>Download</small>
.zip file
</a> -->
<a href="index.html" class="button">
Home
</a>
<a href="https://github.com/NYU-CS6313-Projects/sp2015-group11/zipball/master" class="button">
<small>Download</small>
.zip file
</a>
<!-- <a href="https://github.com/NYU-CS6313-Projects/sp2015-group11/tarball/master" class="button">
<small>Download</small>
.tar.gz file
</a> -->
<p class="repo-owner"><a href="https://github.com/NYU-CS6313-Projects/sp2015-group11"></a> App maintained by <a href="https://github.com/pja279">pja279</a>,<a href="https://github.com/zhujuncheng">zhujuncheng</a>, <a href="https://github.com/jsmedmar">jsmedmar.</a></p>
<!-- <p>This page was generated by <a href="https://pages.github.com">GitHub Pages</a> using the Architect theme by <a href="https://twitter.com/jasonlong">Jason Long</a>.</p> -->
</aside>
</div>
</div>
</body>
</html>