├── .gitignore
├── LICENSE
├── MANIFEST.in
├── PyPiNotes.md
├── README.md
├── articles
├── barBrains.html
├── barBrains.md
├── bar_brains.R
├── css
│ ├── GlasseyeCharts.css
│ ├── colorbrewer.css
│ └── tufte.css
├── js
│ ├── GlasseyeCharts.js
│ ├── GlasseyeCharts.min.js
│ ├── colorbrewer.js
│ ├── d3.min.js
│ ├── d3.tip.v0.6.3.js
│ ├── glasseyePictograms.js
│ ├── icheck.min.js
│ ├── jquery-1.11.3.min.js
│ └── venn.js
├── logreg
├── pandocHTML.html
├── stack.csv
└── templates
│ └── template.html
├── gantt.md
├── glasseye
├── .idea
│ ├── .name
│ ├── encodings.xml
│ ├── glasseye.iml
│ ├── misc.xml
│ ├── modules.xml
│ ├── scopes
│ │ └── scope_settings.xml
│ └── workspace.xml
├── MultiChart.html
├── __init__.py
├── __main__.py
├── css
│ ├── GlasseyeCharts.css
│ ├── colorbrewer.css
│ └── tufte.css
├── demo
│ ├── Tufte.gif
│ ├── css
│ │ ├── GlasseyeCharts.css
│ │ ├── colorbrewer.css
│ │ └── tufte.css
│ ├── data
│ │ ├── activeDecidedSim.csv
│ │ ├── lineplotExample.csv
│ │ └── share.csv
│ ├── js
│ │ ├── GlasseyeCharts.min.js
│ │ ├── colorbrewer.js
│ │ ├── d3.min.js
│ │ ├── d3.tip.v0.6.3.js
│ │ ├── glasseyeCharts.js
│ │ ├── glasseyePictograms.js
│ │ ├── jquery-1.11.3.min.js
│ │ └── venn.js
│ ├── markdownExample.html
│ ├── markdownExample.md
│ ├── pandocHTML.html
│ ├── templates
│ │ └── template.html
│ └── viewMarkdown.txt
├── js
│ ├── GlasseyeCharts.min.js
│ ├── colorbrewer.js
│ ├── d3.min.js
│ ├── d3.tip.v0.6.3.js
│ ├── glasseyeCharts.js
│ ├── glasseyePictograms.js
│ ├── jquery-1.11.3.min.js
│ ├── modular
│ │ ├── AnimatedBarChart.js
│ │ ├── AnimatedDensity.js
│ │ ├── AnimatedDonut.js
│ │ ├── AnimatedVenn.js
│ │ ├── BarChart.js
│ │ ├── Build.sh
│ │ ├── Concat.sh
│ │ ├── Dial.js
│ │ ├── Donut.js
│ │ ├── DrillableVenn.js
│ │ ├── Force.js
│ │ ├── Gant.js
│ │ ├── GlasseyeChart.js
│ │ ├── GlobalFunctionsAndVariable.js
│ │ ├── GridChart.js
│ │ ├── GroupedBarChart.js
│ │ ├── Heatmap.js
│ │ ├── LeafletMap.js
│ │ ├── LinePlot.js
│ │ ├── LogReg.js
│ │ ├── NonStandard.js
│ │ ├── Parsers.js
│ │ ├── PolygonMap.js
│ │ ├── RandomNumber.js
│ │ ├── ScatterPlot.js
│ │ ├── Thermometers.js
│ │ ├── TimeSeries.js
│ │ ├── Tree.js
│ │ ├── Venn.js
│ │ ├── conf.json
│ │ └── prepExport.sh
│ └── venn.js
├── templates
│ ├── pandocHTML.html
│ └── tufteTemplate.html
└── testingTemplate.html
├── glasseyeLayouts.md
└── setup.py
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 |
5 | # C extensions
6 | *.so
7 |
8 | # Distribution / packaging
9 | .Python
10 | env/
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | *.egg-info/
23 | .installed.cfg
24 | *.egg
25 |
26 | # PyInstaller
27 | # Usually these files are written by a python script from a template
28 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
29 | *.manifest
30 | *.spec
31 |
32 | # Installer logs
33 | pip-log.txt
34 | pip-delete-this-directory.txt
35 |
36 | # Unit test / coverage reports
37 | htmlcov/
38 | .tox/
39 | .coverage
40 | .coverage.*
41 | .cache
42 | nosetests.xml
43 | coverage.xml
44 | *,cover
45 |
46 | # Translations
47 | *.mo
48 | *.pot
49 |
50 | # Django stuff:
51 | *.log
52 |
53 | # Sphinx documentation
54 | docs/_build/
55 |
56 | # PyBuilder
57 | target/
58 |
59 | # Misc
60 | glasseye/data
61 | *.DS_Store
62 | /css
63 | /js
64 | *.idea*
65 | .idea/
66 | glasseye/.idea/
67 | *workspace.xml
68 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2015 coppelia machine learning and analytics
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
23 |
--------------------------------------------------------------------------------
/MANIFEST.in:
--------------------------------------------------------------------------------
1 | include glasseye/css/*.css
2 | include glasseye/js/*.js
3 | include glasseye/templates/*.html
4 | include README.md
5 | include glasseye/demo/*.gif
6 | include glasseye/demo/*.md
7 | include glasseye/demo/data/*.csv
--------------------------------------------------------------------------------
/PyPiNotes.md:
--------------------------------------------------------------------------------
1 | From root run
2 |
3 | ```
4 | python setup.py sdist upload
5 | ```
6 |
7 | After changing release no in setup.py
8 |
9 | May need to uninstall before reinstalling as update doesn't seem to work
10 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ##What is glasseye?
2 |
3 | Glasseye is something I'm developing to present the results of statistical analysis in an attractive and hopefully interesting way. It brings together three great things that I use a lot:
4 |
5 | 1. The markdown markup language.
6 | 2. The Tufte wide margin layout
7 | 3. Visualisation using d3.js
8 |
9 |
10 | See a full demo with a more in-depth explanation [here](http://coppeliamla.github.io/glasseye/demo/markdownExample.html)
11 |
12 | The idea is to be able to write up work in markdown and have the results transformed into something like a Tufte layout. For the Tufte layout I took the excellent tufte.css style sheet developed by [Dave Liepmann and co](https://github.com/daveliepmann/tufte-css) and adapted it for my purposes. Finally I've added some d3 charts (just a small selection at the moment but this is growing) that can easily invoked from within the markdown.
13 |
14 | ##What it can do
15 | ###Side notes and margin notes
16 | First there's the `` tag. Anything enclosed in these tags will generate a numbered side note in the wide margin as close as possible to the note number in the main text. These can be used for commentary, links, bits of maths, anything that's peripheral to the main discussion.
17 |
18 | You can easily add images to the side notes and margin notes just by including the usual markdown syntax for inserting an image within the tags.
19 |
20 | Then there is a `` tag which is the nearly the same as the side note, only there's no number linking it to a particular part in the main text. You'll see to the right an example of a margin note containing a d3 donut chart.
21 |
22 |
23 | ###d3 charts
24 |
25 | I've tried to create charts that are simple and uncluttered with the tooltip taking over some of the work. This is so that they can fit in the margin nicely. I've been thinking about making them as intellegent as possible so that choices are made for you about formatting (for example label positioning). That may prove annoying though so we'll see how it goes. It's easy to include any of the d3 charts into either the main body of the text or into the margin.
26 |
27 | Inserting a plot is again just a matter of using some custom tags. For example to generate a line plot just surround a string containing the path and filname of a csv file with a `` tag.
28 |
29 | Alternatively you can write the data in json into the markdown. For example we can create an interactive treemap by inserting the following into the markdown. See the section below for the full json
30 |
31 | ```
32 |
33 |
34 | {
35 | "name": "All",
36 | "children": [
37 | {"name": "Bakery",
38 | "size": 34},
39 | {"name": "Tinned Goods",
40 | "children": [
41 | {"name": "Beans",
42 | "size": 34},
43 | {"name": "Soups",
44 | "size": 56},
45 | {"name": "Puddings",
46 | "children": [
47 | {"name": "Fruit",
48 | "children": [
49 | {"name": "Tangerines",
50 | "size": 15},
51 | {"name": "Pears",
52 | "size": 17}
53 | ]
54 | },
55 | {"name": "Apricots",
56 | "size": 89}
57 | ...
58 |
59 | ```
60 |
61 | ##How it works
62 |
63 | Glasseye is built using pandoc and the python beautifulsoup library. Pandoc is used to generate the html from the markdown and beautifulsoup is used to manipulate the extra tags and make the appropriate substitutions, including adding in the d3 charts.
64 |
65 | ##Installing glasseye
66 |
67 | I've now added glasseye to pip so installation is fairly straightforward
68 |
69 | 1. Install pandoc from [here](http://pandoc.org)
70 | 2. If you don't have it already install python 2.7
71 | 3. Then from the command line run `pip install glasseye` Assumes you already have the pip package. If you don't just run `easy_install pip`
72 |
73 | ##Using glasseye
74 |
75 | Just create your markdown file using a text editor and then from the commandline run
76 |
77 | ```
78 | glasseye myMarkdownFile.md
79 | ```
80 | The html will then be created in the current directory along with the supporting css and javascript.
81 |
82 | You can test it out using the demo that comes with the package. You'll find the demo files in `path_to_your_packages/glasseye/demo`. Copy them to a new directory and run
83 |
84 | ```
85 | glasseye markdownExample.md
86 | ```
87 |
88 | See the [demo](http://coppeliamla.github.io/glasseye/glasseye_markdownExample/demo.html) for more information.
89 |
--------------------------------------------------------------------------------
/articles/bar_brains.R:
--------------------------------------------------------------------------------
1 | count<-c(4, 12, 44, 16)
2 | N<-sum(count)
3 | prop<-count/N
4 |
5 | #Classical
6 | sd_func<-function(p){
7 | return( sqrt((p*(1-p)/N)))
8 | }
9 | c_sd<-sapply(prop, sd_func)
10 | c_u<-prop+1.96*c_sd
11 | c_l<-prop-1.96*c_sd
12 | plot(prop, ylim=c(-1,1))
13 | points(c_u, col="Pink")
14 | points(c_l, col="Pink")
15 |
16 | #Note for reference only - doesn't really work as proportions are not independent in this case
17 | #Bonferroni (mean test only)
18 | bc_u<-prop+qnorm(1-(0.025/6))*c_sd
19 | bc_l<-prop-qnorm(1-(0.025/6))*c_sd
20 |
21 | points(bc_u, col="Green")
22 | points(bc_l, col="Green")
23 |
24 | #Bonferroni (all comparisons)
25 |
26 | comb <- function(n, x) {
27 | return(factorial(n) / (factorial(x) * factorial(n-x)))
28 | }
29 |
30 | comb(6,2)
31 |
32 | bc_u<-prop+qnorm(1-(0.025/15))*c_sd
33 | bc_l<-prop-qnorm(1-(0.025/15))*c_sd
34 |
35 | points(bc_u, col="Blue")
36 | points(bc_l, col="Blue")
37 |
38 | #Bayesian
39 |
40 | dir<-count+1 #with non informative dir prior
41 | bayesian<-dir/sum(dir)
42 | #plot(prop, ylim=c(-0.2,0.5))
43 |
44 | points(bayesian, col="red", pch=6)
45 |
46 | a_0<-sum(dir)
47 |
48 | bayes_sd<-function(a){
49 | var_a<-(a*(a_0-a))/(a_0^2*(a_0+1))
50 | return(sqrt(var_a))
51 | }
52 |
53 |
54 | b_sd<-sapply(bayesian, bayes_sd)
55 | b_u<-bayesian+1.96*b_sd
56 | b_l<-bayesian-1.96*b_sd
57 | points(b_u, col="Red", pch=6)
58 | points(b_l, col="Red", pch=6)
59 |
60 | #Work out joint distributions
61 |
62 | library(gtools)
63 |
64 | sample<-rdirichlet(1000, dir)
65 | diff_1_2<-sample[,1]-sample[,2]
66 | hist(diff_1_2)
67 | sum(diff_1_2>0)
68 |
69 | diff_2_3<-sample[,2]-sample[,3]
70 | hist(diff_2_3)
71 | sum(diff_2_3>0)
72 |
73 | diff_3_4<-sample[,3]-sample[,4]
74 | hist(diff_3_4)
75 | sum(diff_3_4>0)
76 |
77 | diff_2_4<-sample[,2]-sample[,4]
78 | hist(diff_2_4)
79 | sum(diff_2_4>0)
80 |
81 |
82 | #Using glm
83 |
84 | counts<-c(40,23,19,8)
85 | party<-c("Red", "Blue", "Green", "Yellow")
86 | party<-data.frame(counts, party)
87 | glm_party<-glm(counts~party, data = party, family ="poisson")
88 | #To test the hypotheses of no difference
89 | library(multcomp)
90 | summary(glht(glm_party, mcp(party="Tukey")))
91 |
92 | counts<-c(100,230, 265)
93 | party<-c("Apples", "Pears", "Oranges")
94 | party<-data.frame(counts, party)
95 | glm_party<-glm(counts~party, data = party, family ="poisson")
96 | #To test the hypotheses of no difference
97 | library(multcomp)
98 | summary(glht(glm_party, mcp(party="Tukey")))
99 |
100 |
101 | count<-c(100, 230, 265)
102 | N<-sum(count)
103 | prop<-count/N
104 |
105 | dir<-count+1 #with non informative dir prior
106 | bayesian<-dir/sum(dir)
107 |
108 | sample<-rdirichlet(1000, dir)
109 | diff_1_2<-sample[,1]-sample[,2]
110 | hist(diff_1_2)
111 | sum(diff_1_2>0)
112 |
113 | diff_2_3<-sample[,2]-sample[,3]
114 | hist(diff_2_3)
115 | sum(diff_2_3>0)
116 |
117 | diff_3_4<-sample[,3]-sample[,4]
118 | hist(diff_3_4)
119 | sum(diff_3_4>0)
120 |
121 |
--------------------------------------------------------------------------------
/articles/css/GlasseyeCharts.css:
--------------------------------------------------------------------------------
1 | /* General chart formatting */
2 |
3 | svg {
4 | clear: both;
5 | margin-top: 20px;
6 | margin-bottom: 20px;
7 | }
8 |
9 | text {
10 | stroke: none;
11 | font-family: 'Raleway';
12 | font-size: 10px;
13 | }
14 |
15 | .line {
16 | fill: none;
17 | stroke: steelblue;
18 | stroke-width: 1.5px;
19 | }
20 |
21 | .chart_grid .tick {
22 | stroke: lightgrey;
23 | opacity: 0.7;
24 | }
25 |
26 | .chart_grid path {
27 | stroke-width: 0;
28 | shape-rendering: crispEdges;
29 | }
30 |
31 | .chart_grid .temp_y_label text {
32 | font-size: 10px;
33 | fill: grey;
34 | shape-rendering: crispEdges;
35 | }
36 |
37 | .legend_item text {
38 | font-size: 10px;
39 | fill: grey;
40 | shape-rendering: crispEdges;
41 | }
42 |
43 | .axis_label text {
44 | font-size: 8px;
45 | fill: grey;
46 | shape-rendering: crispEdges;
47 | text-transform: uppercase;
48 | stroke: none;
49 | }
50 |
51 | /*line plot*/
52 |
53 | .line_points {
54 | opacity: 0;
55 | }
56 |
57 | /*timeseries*/
58 |
59 | .timeseries_line {
60 | stroke-width: 3px;
61 | fill: transparent;
62 | }
63 |
64 | /*bar chart*/
65 |
66 | .bar {
67 | fill: steelblue;
68 | stroke: none;
69 | }
70 |
71 | /*thermometers*/
72 |
73 | .glass {
74 | stroke: none;
75 | fill: grey;
76 | }
77 |
78 | .glass-gap {
79 | stroke: none;
80 | fill: white;
81 | }
82 |
83 | .mercury {
84 | stroke: none;
85 | fill: red;
86 | }
87 |
88 | /*tree*/
89 |
90 | .treenode circle {
91 | fill: #fff;
92 | stroke: steelblue;
93 | stroke-width: 1.5px;
94 | }
95 |
96 | .treenode {
97 | font: 10px sans-serif;
98 | fill: grey;
99 | }
100 |
101 | .treelink {
102 | fill: none;
103 | stroke: #ccc;
104 | stroke-width: 1.5px;
105 | }
106 |
107 | /*AnimatedDensity*/
108 |
109 | .block {
110 |
111 | fill: #1abc9c;
112 | }
113 |
114 | /*force*/
115 |
116 | .forcenode {
117 | stroke: #fff;
118 | stroke-width: 1.5px;
119 | fill: steelblue;
120 | }
121 |
122 | .forcelink {
123 | stroke: #999;
124 | stroke-opacity: .6;
125 | }
126 |
127 | /* Tip formatting */
128 |
129 | .d3-tip {
130 | line-height: 1;
131 | font-weight: bold;
132 | padding: 8px;
133 | background: rgba(128, 128, 128, 0.9);
134 | color: #fff;
135 | border-radius: 2px;
136 | }
137 |
138 | /* Creates a small triangle extender for the tooltip */
139 | .d3-tip:after {
140 | box-sizing: border-box;
141 | display: inline;
142 | font-size: 10px;
143 | width: 100%;
144 | line-height: 1;
145 | color: rgba(128, 128, 128, 0.9);
146 | content: "\25BC";
147 | position: absolute;
148 | text-align: center;
149 | }
150 |
151 | /* Style northward tooltips differently */
152 | .d3-tip.n:after {
153 | margin: -1px 0 0 0;
154 | top: 100%;
155 | left: 0;
156 | }
157 |
158 | /*Gantt elements */
159 |
160 | .task {
161 | fill: steelblue;
162 | stroke: none;
163 | }
164 |
--------------------------------------------------------------------------------
/articles/css/tufte.css:
--------------------------------------------------------------------------------
1 | html { font-size: 10px; }
2 |
3 |
4 | body { width: 87.5%;
5 | margin-left: auto;
6 | margin-right: auto;
7 | padding-left: 12.5%;
8 | font-family: 'Raleway';
9 | padding-bottom: 20rem;
10 | color: #777;
11 | max-width: 1200px; }
12 |
13 | h1 { font-family: 'Lato';
14 | font-weight: 400;
15 | margin-top: 4rem;
16 | margin-bottom: 2rem;
17 | font-size: 2.5rem;
18 | line-height: 1;
19 | width: 55%; }
20 |
21 | h2 { font-family: 'Lato';
22 | font-weight: 400;
23 | margin-top: 2.1rem;
24 | margin-bottom: 0;
25 | font-size: 2rem;
26 | line-height: 1; }
27 |
28 | h3 { font-family: 'Lato';
29 | font-style: italic;
30 | font-weight: 400;
31 | font-size: 1.7rem;
32 | margin-top: 2rem;
33 | margin-bottom: 0;
34 | line-height: 1; }
35 |
36 | h4, h5, h6 { font-family: 'Lato';
37 | font-weight: 400;
38 | font-size: 1.5rem;
39 | margin-top: 2rem;
40 | margin-bottom: 0;
41 | line-height: 1; }
42 |
43 | subtitle {
44 | font-family: 'Lato';
45 | font-style: italic;
46 | margin-top: 1rem;
47 | margin-bottom: 1rem;
48 | font-size: 1.8rem;
49 | display: block;
50 | line-height: 1; }
51 |
52 | table { width: 53%;
53 | text-align: right;
54 | font-size: 1.4rem;
55 | line-height: 1.4;
56 | margin-top: 1.4rem;
57 | margin-bottom: 1.4rem;
58 | margin-left: 1%;
59 | margin-right: 1%;
60 | border-top: 2px solid #333333;
61 | border-bottom: 2px solid #333333;
62 | border-collapse: separate;
63 | border-spacing: 0 5px;
64 | -webkit-font-feature-settings: 'tnum'; /* This is technically redundant */
65 | -moz-font-feature-settings: 'tnum';
66 | -ms-font-feature-settings: 'tnum'; }
67 |
68 | thead th { border-bottom: 1px solid #333333;
69 | font-weight: 400;
70 | border-collapse: separate;
71 | border-spacing: 5px 5px;}
72 |
73 | article { position: relative;
74 | padding-top: 5rem; }
75 |
76 | p, .list-container { font-size: 1.4rem;
77 | line-height: 2rem;
78 | margin-top: 1.4rem;
79 | margin-bottom: 1.4rem;
80 | width: 55%;
81 | padding-right: 0;
82 | vertical-align: baseline; }
83 |
84 |
85 | @media screen and (max-width: 600px) { p { width: 65%; }}
86 | @media screen and (max-width: 400px) { p { width: 90%; }}
87 |
88 | a { font-size: 1.4rem;
89 | color: #777; }
90 |
91 |
92 | img { max-width: 100%;
93 | clear: both;
94 | margin-bottom: 20px;
95 | margin-top: 20px;}
96 |
97 | sup, sub { vertical-align: baseline;
98 | position: relative;
99 | top: -0.4rem; }
100 |
101 | sub { top: 0.4rem; }
102 |
103 | sup.sidenote-number {
104 | font-size: 0.9rem;
105 | }
106 |
107 | .sans { font-family: "Gill Sans", "Gill Sans MT", Calibri, sans-serif; }
108 |
109 | code { font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
110 | font-size: 1rem;
111 | line-height: 1.8;
112 | width: 55%; }
113 |
114 | .marginnote code {
115 | font-size: 0.9rem;
116 | }
117 |
118 | pre code { padding: 0 2em; }
119 |
120 | pre {
121 | width: 55%;
122 | overflow: hidden;
123 | }
124 |
125 | hr {
126 | width: 55%;
127 | float: left;
128 | clear: both;
129 | }
130 |
131 | .fullwidth { max-width: 95%; }
132 |
133 | ul {padding-left: 7%;}
134 | ol {padding-left: 7%;}
135 |
136 | .sidenote, .marginnote { float: right;
137 | clear: right;
138 | margin-right: -60%;
139 | width: 50%;
140 | margin-top: 0;
141 | margin-bottom: 20px;
142 | font-size: 1.0rem;
143 | line-height: 1.96;
144 | vertical-align: baseline;
145 | position: relative; }
146 |
147 | .marginnote a {font-size: 1.0rem;
148 | color: #777; }
149 | .sidenote a {font-size: 1.0rem;
150 | color: #777; }
151 |
152 | li .marginnote { float: right;
153 | clear: right;
154 | margin-right: -64.52%;
155 | width: 53.76%;
156 | margin-top: 0;
157 | margin-bottom: 20px;
158 | font-size: 1.0rem;
159 | line-height: 1.96;
160 | vertical-align: baseline;
161 | position: relative; }
162 |
163 |
164 | .checklist { padding-left:20px; list-style: none; }
165 |
166 | .checklist li { margin-bottom:10px; }
167 | .checklist li:before {
168 | font-family: FontAwesome;
169 | font-size: 11px;
170 | content: "\f096";
171 | margin:0 8px 0 -15px;
172 | }
173 |
174 | @media screen and (max-width: 600px) { .sidenote, .marginnote { width: 25%;
175 | margin-right: -35%; }}
176 | @media screen and (max-width: 400px) { .sidenote, .marginnote { display:none; }}
177 |
178 | a.url { text-decoration: none;
179 | word-break: break-all;
180 | }
181 |
182 | span.newthought { font-variant: small-caps; }
183 |
184 | /* LaTeX-logo-specific styling */
185 | .latex sub, .latex sup { text-transform: uppercase; }
186 |
187 | .latex sub { vertical-align: 0.2rem;
188 | margin-left: -0.1667rem;
189 | margin-right: -0.125rem; }
190 |
191 | .latex sup { vertical-align: -0.2rem;
192 | margin-left: -0.36rem;
193 | margin-right: -0.15rem; }
194 |
195 | @media print { *, *:before, *:after { background: transparent !important;
196 | /* Black prints faster: http://www.sanbeiji.com/archives/953 */
197 | color: #000 !important;
198 | box-shadow: none !important;
199 | text-shadow: none !important; }
200 |
201 | thead { display: table-header-group; }
202 |
203 | tr, img { page-break-inside: avoid; }
204 |
205 | img { max-width: 100% !important; }
206 |
207 |
208 | p, h2, h3 { orphans: 3;
209 | widows: 3; }
210 |
211 | h2, h3 { page-break-after: avoid; }}
--------------------------------------------------------------------------------
/articles/js/d3.tip.v0.6.3.js:
--------------------------------------------------------------------------------
1 | // d3.tip
2 | // Copyright (c) 2013 Justin Palmer
3 | //
4 | // Tooltips for d3.js SVG visualizations
5 |
6 | // Public - contructs a new tooltip
7 | //
8 | // Returns a tip
9 | d3.tip = function() {
10 | var direction = d3_tip_direction,
11 | offset = d3_tip_offset,
12 | html = d3_tip_html,
13 | node = initNode(),
14 | svg = null,
15 | point = null,
16 | target = null
17 |
18 | function tip(vis) {
19 | svg = getSVGNode(vis)
20 | point = svg.createSVGPoint()
21 | document.body.appendChild(node)
22 | }
23 |
24 | // Public - show the tooltip on the screen
25 | //
26 | // Returns a tip
27 | tip.show = function() {
28 | var args = Array.prototype.slice.call(arguments)
29 | if(args[args.length - 1] instanceof SVGElement) target = args.pop()
30 |
31 | var content = html.apply(this, args),
32 | poffset = offset.apply(this, args),
33 | dir = direction.apply(this, args),
34 | nodel = d3.select(node), i = 0,
35 | coords
36 |
37 | nodel.html(content)
38 | .style({ opacity: 1, 'pointer-events': 'all' })
39 |
40 | while(i--) nodel.classed(directions[i], false)
41 | coords = direction_callbacks.get(dir).apply(this)
42 | nodel.classed(dir, true).style({
43 | top: (coords.top + poffset[0]) + 'px',
44 | left: (coords.left + poffset[1]) + 'px'
45 | })
46 |
47 | return tip
48 | }
49 |
50 | // Public - hide the tooltip
51 | //
52 | // Returns a tip
53 | tip.hide = function() {
54 | nodel = d3.select(node)
55 | nodel.style({ opacity: 0, 'pointer-events': 'none' })
56 | return tip
57 | }
58 |
59 | // Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.
60 | //
61 | // n - name of the attribute
62 | // v - value of the attribute
63 | //
64 | // Returns tip or attribute value
65 | tip.attr = function(n, v) {
66 | if (arguments.length < 2 && typeof n === 'string') {
67 | return d3.select(node).attr(n)
68 | } else {
69 | var args = Array.prototype.slice.call(arguments)
70 | d3.selection.prototype.attr.apply(d3.select(node), args)
71 | }
72 |
73 | return tip
74 | }
75 |
76 | // Public: Proxy style calls to the d3 tip container. Sets or gets a style value.
77 | //
78 | // n - name of the property
79 | // v - value of the property
80 | //
81 | // Returns tip or style property value
82 | tip.style = function(n, v) {
83 | if (arguments.length < 2 && typeof n === 'string') {
84 | return d3.select(node).style(n)
85 | } else {
86 | var args = Array.prototype.slice.call(arguments)
87 | d3.selection.prototype.style.apply(d3.select(node), args)
88 | }
89 |
90 | return tip
91 | }
92 |
93 | // Public: Set or get the direction of the tooltip
94 | //
95 | // v - One of n(north), s(south), e(east), or w(west), nw(northwest),
96 | // sw(southwest), ne(northeast) or se(southeast)
97 | //
98 | // Returns tip or direction
99 | tip.direction = function(v) {
100 | if (!arguments.length) return direction
101 | direction = v == null ? v : d3.functor(v)
102 |
103 | return tip
104 | }
105 |
106 | // Public: Sets or gets the offset of the tip
107 | //
108 | // v - Array of [x, y] offset
109 | //
110 | // Returns offset or
111 | tip.offset = function(v) {
112 | if (!arguments.length) return offset
113 | offset = v == null ? v : d3.functor(v)
114 |
115 | return tip
116 | }
117 |
118 | // Public: sets or gets the html value of the tooltip
119 | //
120 | // v - String value of the tip
121 | //
122 | // Returns html value or tip
123 | tip.html = function(v) {
124 | if (!arguments.length) return html
125 | html = v == null ? v : d3.functor(v)
126 |
127 | return tip
128 | }
129 |
130 | function d3_tip_direction() { return 'n' }
131 | function d3_tip_offset() { return [0, 0] }
132 | function d3_tip_html() { return ' ' }
133 |
134 | var direction_callbacks = d3.map({
135 | n: direction_n,
136 | s: direction_s,
137 | e: direction_e,
138 | w: direction_w,
139 | nw: direction_nw,
140 | ne: direction_ne,
141 | sw: direction_sw,
142 | se: direction_se
143 | }),
144 |
145 | directions = direction_callbacks.keys()
146 |
147 | function direction_n() {
148 | var bbox = getScreenBBox()
149 | return {
150 | top: bbox.n.y - node.offsetHeight,
151 | left: bbox.n.x - node.offsetWidth / 2
152 | }
153 | }
154 |
155 | function direction_s() {
156 | var bbox = getScreenBBox()
157 | return {
158 | top: bbox.s.y,
159 | left: bbox.s.x - node.offsetWidth / 2
160 | }
161 | }
162 |
163 | function direction_e() {
164 | var bbox = getScreenBBox()
165 | return {
166 | top: bbox.e.y - node.offsetHeight / 2,
167 | left: bbox.e.x
168 | }
169 | }
170 |
171 | function direction_w() {
172 | var bbox = getScreenBBox()
173 | return {
174 | top: bbox.w.y - node.offsetHeight / 2,
175 | left: bbox.w.x - node.offsetWidth
176 | }
177 | }
178 |
179 | function direction_nw() {
180 | var bbox = getScreenBBox()
181 | return {
182 | top: bbox.nw.y - node.offsetHeight,
183 | left: bbox.nw.x - node.offsetWidth
184 | }
185 | }
186 |
187 | function direction_ne() {
188 | var bbox = getScreenBBox()
189 | return {
190 | top: bbox.ne.y - node.offsetHeight,
191 | left: bbox.ne.x
192 | }
193 | }
194 |
195 | function direction_sw() {
196 | var bbox = getScreenBBox()
197 | return {
198 | top: bbox.sw.y,
199 | left: bbox.sw.x - node.offsetWidth
200 | }
201 | }
202 |
203 | function direction_se() {
204 | var bbox = getScreenBBox()
205 | return {
206 | top: bbox.se.y,
207 | left: bbox.e.x
208 | }
209 | }
210 |
211 | function initNode() {
212 | var node = d3.select(document.createElement('div'))
213 | node.style({
214 | position: 'absolute',
215 | opacity: 0,
216 | pointerEvents: 'none',
217 | boxSizing: 'border-box'
218 | })
219 |
220 | return node.node()
221 | }
222 |
223 | function getSVGNode(el) {
224 | el = el.node()
225 | if(el.tagName.toLowerCase() == 'svg')
226 | return el
227 |
228 | return el.ownerSVGElement
229 | }
230 |
231 | // Private - gets the screen coordinates of a shape
232 | //
233 | // Given a shape on the screen, will return an SVGPoint for the directions
234 | // n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest),
235 | // sw(southwest).
236 | //
237 | // +-+-+
238 | // | |
239 | // + +
240 | // | |
241 | // +-+-+
242 | //
243 | // Returns an Object {n, s, e, w, nw, sw, ne, se}
244 | function getScreenBBox() {
245 | var targetel = target || d3.event.target,
246 | bbox = {},
247 | matrix = targetel.getScreenCTM(),
248 | tbbox = targetel.getBBox(),
249 | width = tbbox.width,
250 | height = tbbox.height,
251 | x = tbbox.x,
252 | y = tbbox.y,
253 | scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
254 | scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
255 |
256 |
257 | point.x = x + scrollLeft
258 | point.y = y + scrollTop
259 | bbox.nw = point.matrixTransform(matrix)
260 | point.x += width
261 | bbox.ne = point.matrixTransform(matrix)
262 | point.y += height
263 | bbox.se = point.matrixTransform(matrix)
264 | point.x -= width
265 | bbox.sw = point.matrixTransform(matrix)
266 | point.y -= height / 2
267 | bbox.w = point.matrixTransform(matrix)
268 | point.x += width
269 | bbox.e = point.matrixTransform(matrix)
270 | point.x -= width / 2
271 | point.y -= height / 2
272 | bbox.n = point.matrixTransform(matrix)
273 | point.y += height
274 | bbox.s = point.matrixTransform(matrix)
275 |
276 | return bbox
277 | }
278 |
279 | return tip
280 | };
281 |
--------------------------------------------------------------------------------
/articles/js/glasseyePictograms.js:
--------------------------------------------------------------------------------
1 | //Class amd methods
2 |
3 | var Bugs = function(processed_data, div, size, scales) {
4 |
5 |
6 | GlasseyeChart.call(this, div, size, undefined, 1000);
7 |
8 | this.processed_data = processed_data;
9 |
10 | //Make this less repetitive
11 | this.body_scale = scales[0].scale_func.range([5, 20]);
12 | this.ant_l_scale = scales[1].scale_func.range([0, 20]);
13 | this.ant_r_scale = scales[2].scale_func.range([0, 20]);
14 |
15 | this.leg_ml_scale = scales[3].scale_func.range([0, 20]);
16 | this.leg_mr_scale = scales[4].scale_func.range([0, 20]);
17 |
18 | this.leg_bl_scale = scales[5].scale_func.range([0, 20]);
19 | this.leg_br_scale = scales[6].scale_func.range([0, 20]);
20 |
21 |
22 |
23 | }
24 |
25 | Bugs.prototype = Object.create(GlasseyeChart.prototype);
26 |
27 | Bugs.prototype.add_bugs = function() {
28 |
29 | var body_scale = this.body_scale;
30 | var ant_r_scale = this.ant_r_scale;
31 | var ant_l_scale = this.ant_l_scale;
32 | var leg_ml_scale = this.leg_ml_scale;
33 | var leg_mr_scale = this.leg_mr_scale;
34 | var leg_bl_scale = this.leg_bl_scale;
35 | var leg_br_scale = this.leg_br_scale;
36 |
37 | var bug_glyphs = this.chart_area.selectAll("bug_glyph")
38 | .data(this.processed_data)
39 | .enter()
40 | .append("g")
41 | .attr("class", "bug_glyph")
42 | .attr("transform", function(d, i) {
43 | return ("translate(" + (10 + (i % 5) * 100) + "," + (10 + ((i - (i % 5))/5) * 100) + ")")
44 | });
45 |
46 |
47 |
48 |
49 | //Right ant
50 | bug_glyphs.append("line")
51 | .attr("class", "bugleg")
52 | .attr("x1", 50)
53 | .attr("y1", 50)
54 | .attr("x2", function(d) {
55 | return(50 + Math.cos(Math.PI / 3)*(body_scale(d.body)+ant_r_scale(d.ant_r)));
56 | })
57 | .attr("y2", function(d) {
58 | return(50 - Math.sin(Math.PI / 3)*(body_scale(d.body)+ant_r_scale(d.ant_r)));
59 | });
60 |
61 | //Left ant
62 | bug_glyphs.append("line")
63 | .attr("class", "bugleg")
64 | .attr("x1", 50)
65 | .attr("y1", 50)
66 | .attr("x2", function(d) {
67 | return(50 - Math.cos(Math.PI / 3)* (body_scale(d.body)+ant_l_scale(d.ant_l)));
68 | })
69 | .attr("y2", function(d) {
70 | return(50 - Math.sin(Math.PI / 3)*(body_scale(d.body)+ant_l_scale(d.ant_l)));
71 | });
72 |
73 | //Right bottom
74 | bug_glyphs.append("line")
75 | .attr("class", "bugleg")
76 | .attr("x1", 50)
77 | .attr("y1", 50)
78 | .attr("x2", function(d) {
79 | return(50 + Math.cos(Math.PI / 3)*(body_scale(d.body)+leg_br_scale(d.leg_br)));
80 | })
81 | .attr("y2", function(d) {
82 | return(50 + Math.sin(Math.PI / 3)*(body_scale(d.body)+leg_br_scale(d.leg_br)));
83 | });
84 |
85 | //Left bottom
86 | bug_glyphs.append("line")
87 | .attr("class", "bugleg")
88 | .attr("x1", 50)
89 | .attr("y1", 50)
90 | .attr("x2", function(d) {
91 | return(50 - Math.cos(Math.PI / 3)*(body_scale(d.body)+leg_bl_scale(d.leg_bl)));
92 | })
93 | .attr("y2", function(d) {
94 | return(50 + Math.sin(Math.PI / 3)*(body_scale(d.body)+leg_bl_scale(d.leg_bl)));
95 | });
96 |
97 | //Right middle
98 | bug_glyphs.append("line")
99 | .attr("class", "bugleg")
100 | .attr("x1", 50)
101 | .attr("y1", 50)
102 | .attr("x2", function(d) {
103 | return (50+ (body_scale(d.body)+leg_mr_scale(d.leg_mr)));
104 | })
105 | .attr("y2", 50);
106 |
107 | //Left middle
108 | bug_glyphs.append("line")
109 | .attr("class", "bugleg")
110 | .attr("x1", 50)
111 | .attr("y1", 50)
112 | .attr("x2", function(d) {
113 | return (50 - (body_scale(d.body)+leg_ml_scale(d.leg_ml)));
114 | })
115 | .attr("y2", 50);
116 |
117 | bug_glyphs.append("circle")
118 | .attr("class", "bugbody")
119 | .attr("cx", 50)
120 | .attr("cy", 50)
121 | .attr("r", function(d) {
122 | return body_scale(d.body)})
123 | //.attr("r", 10)
124 | .attr("fill", d3.hsl("hsl(204, 70%, 23%)"));
125 |
126 | bug_glyphs.append("text")
127 | .attr("x", 50)
128 | .attr("y", 95)
129 | .attr("text-anchor", "middle")
130 | .text(function(d){return (d.label)});
131 |
132 |
133 | }
134 |
135 |
136 | //Builder function
137 |
138 | function bugs(data, div, size){
139 |
140 | var inline_parser = function(data) {
141 | return data;
142 | }
143 |
144 | var csv_parser = function(data) {
145 |
146 | var processed_data = data.map(function(d) {
147 | return {
148 | label: d.label,
149 | body: -d.body,
150 | ant_l: +d.ant_l,
151 | ant_r: +d.ant_r,
152 | leg_ml: +d.leg_ml,
153 | leg_mr: +d.leg_mr,
154 | leg_bl: +d.leg_ml,
155 | leg_br: +d.leg_mr,
156 | }
157 | });
158 |
159 | return processed_data;
160 | }
161 |
162 | var draw = function(processed_data, div, size) {
163 |
164 | console.log(processed_data);
165 |
166 | //Make this nicer
167 |
168 | var body_values = processed_data.map(function(d) {
169 | return d.body;
170 | });
171 |
172 | var ant_l_values = processed_data.map(function(d) {
173 | return d.ant_l;
174 | });
175 |
176 | var ant_r_values = processed_data.map(function(d) {
177 | return d.ant_r;
178 | });
179 |
180 | var leg_ml_values = processed_data.map(function(d) {
181 | return d.leg_ml;
182 | });
183 |
184 | var leg_mr_values = processed_data.map(function(d) {
185 | return d.leg_mr;
186 | });
187 |
188 | var leg_bl_values = processed_data.map(function(d) {
189 | return d.leg_bl;
190 | });
191 |
192 | var leg_br_values = processed_data.map(function(d) {
193 | return d.leg_br;
194 | });
195 |
196 |
197 | var scales = [create_scale(body_values, d3.scale.linear()), create_scale(ant_l_values, d3.scale.linear()), create_scale(ant_r_values,
198 | d3.scale.linear()), create_scale(leg_ml_values, d3.scale.linear()), create_scale(leg_mr_values, d3.scale.linear()), create_scale(leg_bl_values, d3.scale.linear())
199 | , create_scale(leg_br_values, d3.scale.linear())];
200 |
201 |
202 | var glasseye_chart = new Bugs(processed_data, div, size, scales);
203 |
204 | glasseye_chart.add_svg().add_bugs();
205 |
206 | }
207 |
208 | build_chart(data, div, size, undefined, csv_parser, inline_parser, draw);
209 |
210 | }
211 |
212 |
--------------------------------------------------------------------------------
/articles/js/icheck.min.js:
--------------------------------------------------------------------------------
1 | /*! iCheck v1.0.2 by Damir Sultanov, http://git.io/arlzeA, MIT Licensed */
2 | (function(f){function A(a,b,d){var c=a[0],g=/er/.test(d)?_indeterminate:/bl/.test(d)?n:k,e=d==_update?{checked:c[k],disabled:c[n],indeterminate:"true"==a.attr(_indeterminate)||"false"==a.attr(_determinate)}:c[g];if(/^(ch|di|in)/.test(d)&&!e)x(a,g);else if(/^(un|en|de)/.test(d)&&e)q(a,g);else if(d==_update)for(var f in e)e[f]?x(a,f,!0):q(a,f,!0);else if(!b||"toggle"==d){if(!b)a[_callback]("ifClicked");e?c[_type]!==r&&q(a,g):x(a,g)}}function x(a,b,d){var c=a[0],g=a.parent(),e=b==k,u=b==_indeterminate,
3 | v=b==n,s=u?_determinate:e?y:"enabled",F=l(a,s+t(c[_type])),B=l(a,b+t(c[_type]));if(!0!==c[b]){if(!d&&b==k&&c[_type]==r&&c.name){var w=a.closest("form"),p='input[name="'+c.name+'"]',p=w.length?w.find(p):f(p);p.each(function(){this!==c&&f(this).data(m)&&q(f(this),b)})}u?(c[b]=!0,c[k]&&q(a,k,"force")):(d||(c[b]=!0),e&&c[_indeterminate]&&q(a,_indeterminate,!1));D(a,e,b,d)}c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"default");g[_add](B||l(a,b)||"");g.attr("role")&&!u&&g.attr("aria-"+(v?n:k),"true");
4 | g[_remove](F||l(a,s)||"")}function q(a,b,d){var c=a[0],g=a.parent(),e=b==k,f=b==_indeterminate,m=b==n,s=f?_determinate:e?y:"enabled",q=l(a,s+t(c[_type])),r=l(a,b+t(c[_type]));if(!1!==c[b]){if(f||!d||"force"==d)c[b]=!1;D(a,e,s,d)}!c[n]&&l(a,_cursor,!0)&&g.find("."+C).css(_cursor,"pointer");g[_remove](r||l(a,b)||"");g.attr("role")&&!f&&g.attr("aria-"+(m?n:k),"false");g[_add](q||l(a,s)||"")}function E(a,b){if(a.data(m)){a.parent().html(a.attr("style",a.data(m).s||""));if(b)a[_callback](b);a.off(".i").unwrap();
5 | f(_label+'[for="'+a[0].id+'"]').add(a.closest(_label)).off(".i")}}function l(a,b,f){if(a.data(m))return a.data(m).o[b+(f?"":"Class")]}function t(a){return a.charAt(0).toUpperCase()+a.slice(1)}function D(a,b,f,c){if(!c){if(b)a[_callback]("ifToggled");a[_callback]("ifChanged")[_callback]("if"+t(f))}}var m="iCheck",C=m+"-helper",r="radio",k="checked",y="un"+k,n="disabled";_determinate="determinate";_indeterminate="in"+_determinate;_update="update";_type="type";_click="click";_touch="touchbegin.i touchend.i";
6 | _add="addClass";_remove="removeClass";_callback="trigger";_label="label";_cursor="cursor";_mobile=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);f.fn[m]=function(a,b){var d='input[type="checkbox"], input[type="'+r+'"]',c=f(),g=function(a){a.each(function(){var a=f(this);c=a.is(d)?c.add(a):c.add(a.find(d))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(a))return a=a.toLowerCase(),g(this),c.each(function(){var c=
7 | f(this);"destroy"==a?E(c,"ifDestroyed"):A(c,!0,a);f.isFunction(b)&&b()});if("object"!=typeof a&&a)return this;var e=f.extend({checkedClass:k,disabledClass:n,indeterminateClass:_indeterminate,labelHover:!0},a),l=e.handle,v=e.hoverClass||"hover",s=e.focusClass||"focus",t=e.activeClass||"active",B=!!e.labelHover,w=e.labelHoverClass||"hover",p=(""+e.increaseArea).replace("%","")|0;if("checkbox"==l||l==r)d='input[type="'+l+'"]';-50>p&&(p=-50);g(this);return c.each(function(){var a=f(this);E(a);var c=this,
8 | b=c.id,g=-p+"%",d=100+2*p+"%",d={position:"absolute",top:g,left:g,display:"block",width:d,height:d,margin:0,padding:0,background:"#fff",border:0,opacity:0},g=_mobile?{position:"absolute",visibility:"hidden"}:p?d:{position:"absolute",opacity:0},l="checkbox"==c[_type]?e.checkboxClass||"icheckbox":e.radioClass||"i"+r,z=f(_label+'[for="'+b+'"]').add(a.closest(_label)),u=!!e.aria,y=m+"-"+Math.random().toString(36).substr(2,6),h='
")[_callback]("ifCreated").parent().append(e.insert);d=f('').css(d).appendTo(h);a.data(m,{o:e,s:a.attr("style")}).css(g);e.inheritClass&&h[_add](c.className||"");e.inheritID&&b&&h.attr("id",m+"-"+b);"static"==h.css("position")&&h.css("position","relative");A(a,!0,_update);if(z.length)z.on(_click+".i mouseover.i mouseout.i "+_touch,function(b){var d=b[_type],e=f(this);if(!c[n]){if(d==_click){if(f(b.target).is("a"))return;
10 | A(a,!1,!0)}else B&&(/ut|nd/.test(d)?(h[_remove](v),e[_remove](w)):(h[_add](v),e[_add](w)));if(_mobile)b.stopPropagation();else return!1}});a.on(_click+".i focus.i blur.i keyup.i keydown.i keypress.i",function(b){var d=b[_type];b=b.keyCode;if(d==_click)return!1;if("keydown"==d&&32==b)return c[_type]==r&&c[k]||(c[k]?q(a,k):x(a,k)),!1;if("keyup"==d&&c[_type]==r)!c[k]&&x(a,k);else if(/us|ur/.test(d))h["blur"==d?_remove:_add](s)});d.on(_click+" mousedown mouseup mouseover mouseout "+_touch,function(b){var d=
11 | b[_type],e=/wn|up/.test(d)?t:v;if(!c[n]){if(d==_click)A(a,!1,!0);else{if(/wn|er|in/.test(d))h[_add](e);else h[_remove](e+" "+t);if(z.length&&B&&e==v)z[/ut|nd/.test(d)?_remove:_add](w)}if(_mobile)b.stopPropagation();else return!1}})})}})(window.jQuery||window.Zepto);
12 |
--------------------------------------------------------------------------------
/articles/logreg:
--------------------------------------------------------------------------------
1 | Although logistic regression has been around for a very long time now it is used less often than it should be. Part of the reason is that is difficult to explain the results to an audience that is not statistically minded. Unlike linear regression there is no one answer to the question how much does the increase in a particular input change the output.
2 |
3 | Changing:
4 |
5 | For a subject with attributes gender = male, age = 35 and ... the impact of changing the attribute X from y to z is that the probability of q increases from a to b.
6 |
--------------------------------------------------------------------------------
/articles/stack.csv:
--------------------------------------------------------------------------------
1 | "group","label","value"
2 | kermit, burgers, 22
3 | kermit, hotdogs, 12
4 | kermit, pizzas, 55
5 | kermit, fries, 33
6 | gonzo, burgers, 13
7 | gonzo, hotdogs, 14
8 | gonzo, pizzas, 99
9 | gonzo, fries, 10
10 | beaker, burgers, 11
11 | beaker, hotdogs, 52
12 | beaker, pizzas, 35
13 | beaker, fries, 55
14 |
--------------------------------------------------------------------------------
/articles/templates/template.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Glasseye
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |