```python
from jupyterthemes import get_themes
from jupyterthemes.stylefx import set_nb_theme
themes = get_themes()
set_nb_theme(themes[1])
```

<style> @font-face {
 font-family: 'Droid Sans Mono';
 font-weight: normal;
 font-style: normal;
 src: local('Droid Sans Mono'), url('fonts/droid-sans-mono.woff') format('woff');
}
@font-face {
 font-family: 'Exo_2';
 font-weight: normal;
 font-style: normal;
 src: local('Exo_2'), url('fonts/exo-II-regular.ttf') format('truetype');
}
@font-face {
 font-family: 'Fira Code';
 font-weight: normal;
 font-style: normal;
 src: local('Fira Code'), url('fonts/firacode.otf') format('opentype');
}
@font-face {
 font-family: 'Lora';
 font-weight: normal;
 font-style: normal;
 src: local('Lora'), url('fonts/Lora-Regular.ttf') format('truetype');
}
div#notebook {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 line-height: 170%;
 color: #303030;
}
body,
div.body {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 background-color: #ffffff;
 background: #ffffff;
}
body.notebook_app {
 padding: 0;
 background-color: #ffffff;
 background: #ffffff;
 padding-right: 0px !important;
 overflow-y: hidden;
}
a {
 font-family: "Exo_2", sans-serif;
 color: #303030;
}
a:hover,
a:focus {
 color: #2f2f2f;
}
.list_header,
div#notebook_list_header.row.list_header {
 font-size: 14pt;
 color: #2f2f2f;
 background-color: #ffffff;
}
div#cluster_list_header.row.list_header,
div#running .row.list_header {
 font-size: 14pt;
 color: #303030;
 background: #eeeeee;
 background-color: #eeeeee;
 border-bottom: 2px solid rgba(180,180,180,.30);
}
div#cluster_list > div.list_item.row,
div#cluster_list > div.list_item.row:hover {
 background: #f7f7f7;
 background-color: #f7f7f7;
}
div#clusters.tab-pane.active {
 font-size: 12.0pt;
 padding: 4px 0 4px 0;
}
#running .panel-group .panel .panel-heading {
 font-size: 14pt;
 color: #303030;
 padding: 8px 8px;
 background: #eeeeee;
 background-color: #eeeeee;
}
#running .panel-group .panel .panel-heading a {
 font-size: 14pt;
 color: #303030;
}
#running .panel-group .panel .panel-heading a:focus,
#running .panel-group .panel .panel-heading a:hover {
 font-size: 14pt;
 color: #303030;
}
#running .panel-group .panel .panel-body .list_container .list_item {
 background: #f7f7f7;
 background-color: #f7f7f7;
 padding: 2px;
 border-bottom: 2px solid rgba(180,180,180,.30);
}
#running .panel-group .panel .panel-body .list_container .list_item:hover {
 background: #f7f7f7;
 background-color: #f7f7f7;
}
#running .panel-group .panel .panel-body {
 padding: 2px;
}
div.running_list_info.toolbar_info {
 font-size: 12.0pt;
 padding: 4px 0 4px 0;
 height: inherit;
 line-height: inherit;
 text-shadow: none;
}
.list_placeholder {
 font-weight: normal;
}
#tree-selector {
 padding: 0px;
}
#project_name > ul > li > a > i.fa.fa-home {
 color: #ff7823;
 font-size: 17pt;
 display: inline-block;
 position: static;
 padding: 0px 0px;
 font-weight: normal;
 text-align: center;
 vertical-align: text-top;
}
#project_name {
 display: inline-flex;
 padding-left: 7px;
 margin-left: -2px;
 margin-bottom: -20px;
 text-align: -webkit-auto;
 vertical-align: text-top;
}
div#notebook_toolbar div.dynamic-instructions {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
}
.toolbar_info {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 color: #303030;
 text-shadow: none;
 border: none;
 height: inherit;
 line-height: inherit;
}
.list_container {
 font-size: 12.0pt;
 color: #303030;
 border: none;
 text-shadow: none !important;
}
.list_container > div {
 border-bottom: 1px solid rgba(180,180,180,.14);
 font-size: 12.0pt;
}
.list_header > div,
.list_item > div {
 padding-left: 0px;
}
.list_header > div input,
.list_item > div input {
 top: 0px;
}
.list_header > div .item_link,
.list_item > div .item_link {
 margin-left: -1px;
 vertical-align: middle;
 line-height: 22px;
 font-size: 12.0pt;
}
.item_icon {
 font-size: 12.0pt;
 vertical-align: middle;
}
.list_item input:not([type="checkbox"]) {
 padding-right: 0px;
 height: auto;
 width: 20%;
 margin: 6px 0 0;
 margin-top: 1px;
}
#button-select-all {
 height: auto;
 font-size: 12.0pt;
 padding: 5px;
 min-width: 65px;
 z-index: 0;
}
button#tree-selector-btn {
 height: auto;
 font-size: 12.0pt;
 padding: 5px;
}
input#select-all.pull-left.tree-selector {
 margin-left: 7px;
 margin-right: 2px;
 margin-top: 5px;
}
input[type="radio"],
input[type="checkbox"] {
 margin: 6px 0 0;
 margin-top: 1px;
 line-height: normal;
}
.list_container a {
 font-size: 17px;
 color: #303030;
 border: none;
 text-shadow: none !important;
 font-weight: normal;
 font-style: normal;
}
div.list_container a:hover {
 color: #2f2f2f;
}
div.list_item:hover {
 background-color: #fafafa;
}
.breadcrumb > li {
 font-size: 12.0pt;
 color: #303030;
 border: none;
 text-shadow: none !important;
}
ul#tabs a {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 font-weight: normal;
 font-style: normal;
 border-color: transparent;
 text-shadow: none !important;
}
.nav-tabs {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 font-weight: normal;
 font-style: normal;
 background: #ffffff;
 text-shadow: none !important;
 border-color: transparent;
 border-bottom-color: rgba(180,180,180,.30);
}
.nav-tabs > li > a:hover {
 color: #2f2f2f;
 background-color: rgba(180,180,180,.14);
}
.nav-tabs > li > a:active,
.nav-tabs > li > a:focus,
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:focus,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a,
.nav-tabs > li.active > a:hover,
.nav-tabs > li.active > a:focus {
 color: #1c1c1c;
 background-color: #eeeeee;
 border: 1px solid transparent;
 border-bottom-color: transparent;
 cursor: default;
}
.nav > li > a:hover,
.nav > li > a:focus {
 text-decoration: none;
 background-color: rgba(180,180,180,.14);
}
.nav > li.disabled > a,
.nav > li.disabled > a:hover {
 color: #aaaaaa;
}
div#notebook {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 padding-top: 4px;
}
.notebook_app {
 background-color: #ffffff;
}
#notebook-container {
 padding: 13px;
 background-color: #ffffff;
 min-height: 0px;
 box-shadow: none;
 width: 980px;
 margin-right: auto;
 margin-left: auto;
}
div#ipython-main-app.container {
 width: 980px;
 margin-right: auto;
 margin-left: auto;
 margin-right: auto;
 margin-left: auto;
}
.container {
 width: 980px;
 margin-right: auto;
 margin-left: auto;
}
.notebook_app #header {
 box-shadow: none !important;
 background-color: #ffffff;
 border-bottom: 2px solid rgba(180,180,180,.14);
}
#header {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 box-shadow: none;
 background-color: #ffffff;
}
#header .header-bar {
 background: #ffffff;
 background-color: #ffffff;
}
body > #header .header-bar {
 width: 100%;
 background: #ffffff;
}
#menubar {
 background-color: #ffffff;
}
#menubar .navbar,
.navbar-default {
 background-color: #ffffff;
 margin-bottom: 0px;
}
.navbar {
 border: none;
}
.navbar-default {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 background-color: #ffffff;
 border-color: rgba(180,180,180,.14);
 line-height: 1.5em;
 padding-bottom: 0px;
}
.navbar-default .navbar-nav > li > a {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 display: block;
 line-height: 1.5em;
 padding-top: 8px;
 padding-bottom: 6px;
}
.navbar-default .navbar-nav > li > a:hover,
.navbar-default .navbar-nav > li > a:focus {
 color: #2f2f2f;
 background-color: rgba(180,180,180,.14);
 border-color: rgba(180,180,180,.14);
 line-height: 1.5em;
}
.navbar-default .navbar-nav > .open > a,
.navbar-default .navbar-nav > .open > a:hover,
.navbar-default .navbar-nav > .open > a:focus {
 color: #1c1c1c;
 background-color: rgba(180,180,180,.14);
 border-color: rgba(180,180,180,.14);
 line-height: 1.5em;
}
.edit_mode .modal_indicator:before {
 font-size: 13pt;
 color: #2c85f7;
 content: "\f040";
}
.item_icon {
 color: #126dce;
}
.item_buttons .kernel-name {
 font-size: 13pt;
 color: #126dce;
 line-height: 22px;
}
.running_notebook_icon:before {
 color: #009e07 !important;
}
.item_buttons .running-indicator {
 padding-top: 2px;
 color: #009e07;
}
#modal_indicator {
 float: right !important;
 color: #126dce;
 background: #ffffff;
 background-color: #ffffff;
}
#kernel_indicator {
 float: right !important;
 color: #ff7823;
 background: #ffffff;
 background-color: #ffffff;
 font-size: 14.5pt;
 border-left: 2px solid #ff7823;
 padding-bottom: 2px;
}
#kernel_indicator .kernel_indicator_name {
 color: #ff7823;
 background: #ffffff;
 background-color: #ffffff;
 font-size: 14.5pt;
 padding-left: 5px;
 padding-right: 5px;
}
div.notification_widget.info,
.notification_widget.info,
.notification_widget:active:hover,
.notification_widget.active:hover,
.open > .dropdown-toggle.notification_widget:hover,
.notification_widget:active:focus,
.notification_widget.active:focus,
.open > .dropdown-toggle.notification_widget:focus,
.notification_widget:active.focus,
.notification_widget.active.focus,
.open > .dropdown-toggle.notification_widget.focus,
div#notification_notebook.notification_widget.btn.btn-xs.navbar-btn,
div#notification_notebook.notification_widget.btn.btn-xs.navbar-btn:hover,
div#notification_notebook.notification_widget.btn.btn-xs.navbar-btn:focus {
 color: #126dce;
 background-color: #ffffff;
 border-color: #ffffff;
}
#notification_area,
div.notification_area {
 float: right !important;
 position: static;
}
#kernel_logo_widget,
#kernel_logo_widget .current_kernel_logo {
 display: none;
}
div#ipython_notebook {
 display: none;
}
i.fa.fa-icon {
 -webkit-font-smoothing: antialiased;
 -moz-osx-font-smoothing: grayscale;
 text-rendering: auto;
}
.fa {
 display: inline-block;
 font: normal normal normal 12pt/1 "FontAwesome", "Exo_2", sans-serif;
 text-rendering: auto;
 -webkit-font-smoothing: antialiased;
 -moz-osx-font-smoothing: grayscale;
}
.dropdown-menu {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 box-shadow: none;
 padding: 0px;
 text-align: left;
 border: 2px solid rgba(180,180,180,.30);
 background-color: #ffffff;
 background: #ffffff;
 line-height: 1.3;
 margin: 0px;
}
.dropdown-menu:hover {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 border: 2px solid rgba(180,180,180,.30);
 background-color: #ffffff;
 box-shadow: none;
 line-height: 1.3;
}
.dropdown-header {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 display: block;
 color: #ff7823;
 text-decoration: underline;
 white-space: nowrap;
 padding: 8px 0px 0px 6px;
 line-height: 1.3;
}
.dropdown-menu > li > a {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 line-height: 1.3;
 display: block;
 padding: 10px 25px 10px 14px;
 color: #303030;
 background-color: #ffffff;
 background: #ffffff;
}
.dropdown-menu > li > a:hover {
 color: #2f2f2f;
 background-color: rgba(180,180,180,.14);
 background: rgba(180,180,180,.14);
 border-color: rgba(180,180,180,.14);
}
.dropdown-menu .divider {
 height: 2px;
 margin: 0px 0px;
 overflow: hidden;
 background-color: rgba(180,180,180,.30);
}
.dropdown-submenu > .dropdown-menu {
 top: 0;
 left: 100%;
 margin-top: -2px;
 margin-left: 0px;
 padding-top: 0px;
}
.dropdown-menu > .disabled > a,
.dropdown-menu > .disabled > a:hover,
.dropdown-menu > .disabled > a:focus {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 font-weight: normal;
 color: #aaaaaa;
 padding: none;
 display: block;
 clear: both;
 line-height: 1.2;
 white-space: nowrap;
}
.dropdown-submenu > a:after {
 color: #303030;
 margin-right: -16px;
}
.dropdown-submenu:hover > a:after,
.dropdown-submenu:active > a:after,
.dropdown-submenu:focus > a:after,
.dropdown-submenu:visited > a:after {
 color: #ff7823;
 margin-right: -16px;
}
div.kse-dropdown > .dropdown-menu,
.kse-dropdown > .dropdown-menu {
 min-width: 0;
 top: 94%;
}
.btn,
.btn-default {
 font-family: "Exo_2", sans-serif;
 color: #303030;
 background: #ebebeb;
 background-color: #ebebeb;
 border: 2px solid #e8e8e8;
 font-weight: normal;
 box-shadow: none;
 text-shadow: none;
 border-radius: 2px;
 font-size: inherit;
}
.btn:hover,
.btn:active:hover,
.btn.active:hover,
.btn-default:hover,
.open > .dropdown-toggle.btn-default:hover,
.open > .dropdown-toggle.btn:hover {
 color: #2f2f2f;
 background-color: #e4e4e4;
 background: #e4e4e4;
 border-color: #e4e4e4;
 background-image: none;
 box-shadow: none !important;
 border-radius: 2px;
}
.btn:active,
.btn.active,
.btn:active:focus,
.btn.active:focus,
.btn:active.focus,
.btn.active.focus,
.btn-default:focus,
.btn-default.focus,
.btn-default:active,
.btn-default.active,
.btn-default:active:hover,
.btn-default.active:hover,
.btn-default:active:focus,
.btn-default.active:focus,
.btn-default:active.focus,
.btn-default.active.focus,
.open > .dropdown-toggle.btn:focus,
.open > .dropdown-toggle.btn.focus,
.open > .dropdown-toggle.btn-default {
 color: #1c1c1c;
 background-color: #e4e4e4;
 background: #e4e4e4;
 border-color: #e4e4e4;
 background-image: none;
 box-shadow: none !important;
 border-radius: 2px;
}
.item_buttons > .btn,
.item_buttons > .btn-group,
.item_buttons > .input-group {
 margin-left: 5px;
 background: #eeeeee;
 background-color: #eeeeee;
 border: 2px solid #eeeeee;
}
.item_buttons > .btn:hover,
.item_buttons > .btn-group:hover,
.item_buttons > .input-group:hover {
 margin-left: 5px;
 background: #e9e9e9;
 background-color: #e9e9e9;
 border: 2px solid #e9e9e9;
}
.btn-group > .btn-mini,
.btn-sm,
.btn-group-sm > .btn,
.btn-xs,
.btn-group-xs > .btn,
.alternate_upload .btn-upload,
.btn-group,
.btn-group-vertical {
 font-size: 12.0pt;
 font-weight: normal;
}
.btn-xs,
.btn-group-xs > .btn {
 font-size: 12.0pt;
 background-image: none;
 font-weight: normal;
 text-shadow: none;
 display: inline-table;
}
.alternate_upload .btn-upload {
 display: none;
}
.alternate_upload input.fileinput {
 display: none;
}
button.close {
 border: 0px none;
 font-family: sans-serif;
 font-size: 25pt;
}
.dynamic-buttons {
 font-size: inherit;
 padding-top: 0px;
 display: inline-block;
}
.close {
 color: #de143d;
 opacity: .5;
 text-shadow: none;
}
.close:hover {
 color: #de143d;
 opacity: 1;
}
div.btn.btn-default.output_collapsed {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
div.btn.btn-default.output_collapsed:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
div.nbext-enable-btns .btn[disabled],
div.nbext-enable-btns .btn[disabled]:hover,
.btn-default.disabled,
.btn-default[disabled],
.btn-default.disabled:hover,
.btn-default[disabled]:hover,
fieldset[disabled] .btn-default:hover,
.btn-default.disabled:focus,
.btn-default[disabled]:focus,
fieldset[disabled] .btn-default:focus,
.btn-default.disabled.focus,
.btn-default[disabled].focus,
fieldset[disabled] .btn-default.focus {
 color: #4a4a4a;
 background: #e8e8e8;
 background-color: #e8e8e8;
 border-color: #e8e8e8;
}
.input-group-addon {
 padding: 2px 5px;
 font-size: 12.0pt;
 font-weight: normal;
 height: auto;
 color: #303030;
 text-align: center;
 background-color: #ffffff;
 border: none;
}
.btn-group > .btn + .dropdown-toggle {
 padding-left: 8px;
 padding-right: 8px;
 height: 100%;
 border-left: 2px solid #ff7823 !important;
}
.btn-group > .btn + .dropdown-toggle:hover {
 border-left: 2px solid #ff7823 !important;
}
.input-group-btn {
 position: relative;
 font-size: inherit;
 white-space: nowrap;
}
.input-group-btn:first-child > .btn,
.input-group-btn:first-child > .btn-group {
 background: #eeeeee;
 background-color: #eeeeee;
 border: 1px solid #e9e9e9;
 margin: 2px;
 font-size: inherit;
}
.input-group-btn:first-child > .btn:hover,
.input-group-btn:first-child > .btn-group:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border: 1px solid #e9e9e9;
 margin: 2px;
 font-size: inherit;
}
div.modal .btn-group > .btn:first-child {
 background: #eeeeee;
 background-color: #eeeeee;
 border: 1px solid #e9e9e9;
 margin-top: 0px !important;
 margin-left: 0px;
 margin-bottom: 2px;
}
div.modal .btn-group > .btn:first-child:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border: 1px solid #e9e9e9;
}
div.modal > button,
div.modal-footer > button {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
div.modal > button:hover,
div.modal-footer > button:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
.modal-content {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 position: relative;
 background: #eeeeee;
 background-color: #eeeeee;
 border: none;
 border-radius: 1px;
 background-clip: padding-box;
 outline: none;
}
.modal-header {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: rgba(180,180,180,.30);
 padding: 12px;
 min-height: 16.4286px;
}
.modal-content h4 {
 font-family: "Exo_2", sans-serif;
 font-size: 16pt;
 color: #303030;
 padding: 5px;
}
.modal-body {
 background-color: #ffffff;
 position: relative;
 padding: 15px;
}
.modal-footer {
 padding: 10px;
 text-align: right;
 background-color: #f7f7f7;
 border-top: 1px solid rgba(180,180,180,.30);
}
.alert-info {
 background-color: #fdfdfd;
 border-color: rgba(180,180,180,.30);
 color: #303030;
}
.modal-header .close {
 margin-top: -5px;
 font-size: 25pt;
}
.modal-backdrop,
.modal-backdrop.in {
 opacity: 0.75;
 background-color: #eeeeee;
}
div.panel,
div.panel-default,
.panel,
.panel-default {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 background-color: #f7f7f7;
 color: #303030;
 margin-bottom: 14px;
 border: 0;
 box-shadow: none;
}
div.panel > .panel-heading,
div.panel-default > .panel-heading {
 font-size: 14pt;
 color: #303030;
 background: #eeeeee;
 background-color: #eeeeee;
 border: 0;
}
.modal .modal-dialog {
 min-width: 950px;
 margin: 50px auto;
}
div.container-fluid {
 margin-right: auto;
 margin-left: auto;
 padding-left: 7px;
 padding-right: 12px;
}
div.form-control,
.form-control {
 font-family: "Exo_2", sans-serif;
 font-size: inherit;
 color: #303030;
 background-color: #ffffff;
 border: 2px solid #e7e7e7;
 margin-left: 2px;
 height: auto;
 box-shadow: none;
 padding: 6px 12px;
 transition: border-color 0.15s ease-in-out 0s, box-shadow 0.15s ease-in-out 0s;
}
.form-group.list-group-item {
 color: #303030;
 background-color: #f7f7f7;
 border-color: rgba(180,180,180,.30);
 margin-bottom: 0px;
}
input,
button,
select,
textarea {
 background-color: #ffffff;
 font-weight: normal;
 border: 2px solid rgba(180,180,180,.30);
}
select.form-control.select-xs {
 height: auto;
}
div.output.output_scroll {
 box-shadow: none;
}
::-webkit-scrollbar-track {
 -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.11);
 background-color: #d0d0d0;
 border-radius: 6px;
}
::-webkit-scrollbar {
 width: 14px;
 height: 10px;
 background-color: #d0d0d0;
 border-radius: 6px;
}
::-webkit-scrollbar-thumb {
 background-color: #ffffff;
 background-image: -webkit-gradient(linear,40% 0%,75% 86%,from(#ff6b0f ),color-stop(0.5,#ff8b42 ),to(#ff6b0f ));
 min-height: 60px;
 border-radius: 2px;
}
div.input_area {
 background-color: #efefef;
 padding-right: 1.2em;
 border: 0px;
 border-top-left-radius: 0px;
 border-top-right-radius: 2px;
 border-bottom-left-radius: 0px;
 border-bottom-right-radius: 0px;
}
div.cell {
 padding: 0px;
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ffffff;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
div.cell.selected {
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ff7823;
 padding: 0px;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
.edit_mode div.cell.selected {
 padding: 0px;
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ffd5bb;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
div.cell.edit_mode {
 padding: 0px;
 background: #efefef;
 background-color: #efefef;
 border: medium solid #ffd5bb;
 border-top-right-radius: 2px;
 border-top-left-radius: 2px;
}
div.prompt,
.prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 font-weight: normal;
 color: #aaaaaa;
 line-height: 170%;
 padding: 0px;
 padding-top: 4px;
 padding-left: .25em;
 text-align: left !important;
 min-width: 12ex;
 width: 12ex;
}
div.prompt.input_prompt {
 background-color: #efefef;
 border-right: 2px solid rgba(240,147,43,.50);
 border-top-left-radius: 2px;
 border-top-right-radius: 0px;
 border-bottom-left-radius: 0px;
 border-bottom-right-radius: 0px;
 min-width: 12ex;
 width: 12ex !important;
}
div.output_wrapper {
 background-color: #ffffff;
 border: 0px;
 margin-bottom: 0em;
 margin-top: 0em;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-left-radius: 2px;
 border-bottom-right-radius: 2px;
}
div.output_subarea.output_text.output_stream.output_stdout,
div.output_subarea.output_text {
 font-family: "Droid Sans Mono", monospace;
 font-size: 10.0pt;
 line-height: 150% !important;
 background-color: #ffffff;
 color: #303030;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-left-radius: 2px;
 border-bottom-right-radius: 2px;
}
div.output_area pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 10.0pt;
 line-height: 150% !important;
 color: #303030;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-left-radius: 2px;
 border-bottom-right-radius: 2px;
}
div.output_area {
 display: -webkit-box;
}
div.output_html {
 font-family: "Droid Sans Mono", monospace;
 font-size: 10.0pt;
 color: #353535;
 background-color: #ffffff;
 background: #ffffff;
}
div.output_subarea {
 overflow-x: auto;
 padding: .8em;
 -webkit-box-flex: 1;
 -moz-box-flex: 1;
 box-flex: 1;
 flex: 1;
 max-width: 90%;
}
div.prompt.output_prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 background-color: #ffffff;
 color: #ffffff;
 border-bottom-left-radius: 2px;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-right-radius: 0px;
 min-width: 12ex;
 width: 12ex;
}
div.out_prompt_overlay.prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 background-color: #ffffff;
 border-bottom-left-radius: 2px;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 border-bottom-right-radius: 0px;
 min-width: 12ex;
 width: 12ex;
}
div.out_prompt_overlay.prompt:hover {
 background-color: #ffffff;
 box-shadow: #e8e8e8 2px 1px 2px 2.5px inset;
 border-bottom-left-radius: 2px;
 -webkit-border-: 2px;
 -moz-border-radius: 2px;
 border-top-right-radius: 0px;
 border-top-left-radius: 0px;
 min-width: 12ex;
 width: 12ex !important;
}
div.text_cell,
div.text_cell_render pre,
div.text_cell_render {
 font-family: "Lora", serif;
 font-size: 13pt;
 line-height: 170% !important;
 color: #353535;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
div.cell.text_cell.rendered.selected {
 font-family: "Lora", serif;
 border: medium solid #126dce;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
div.cell.text_cell.unrendered.selected {
 font-family: "Lora", serif;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border: medium solid #126dce;
 border-radius: 2px;
}
div.cell.text_cell.selected {
 font-family: "Lora", serif;
 line-height: 170% !important;
 border: medium solid #126dce;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
.edit_mode div.cell.text_cell.selected {
 font-family: "Lora", serif;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border: medium solid #87b0db;
 border-radius: 2px;
}
div.text_cell.unrendered,
div.text_cell.unrendered.selected,
div.edit_mode div.text_cell.unrendered {
 font-family: "Lora", serif;
 line-height: 170% !important;
 background: #ffffff;
 background-color: #ffffff;
 border-radius: 2px;
}
div.cell.text_cell.rendered .input_prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 font-weight: normal;
 color: #aaaaaa;
 text-align: left !important;
 min-width: 0ex;
 width: 0ex !important;
 background-color: #ffffff;
 border-right: 2px solid transparent;
}
div.cell.text_cell.unrendered .input_prompt {
 font-family: "Fira Code", monospace;
 font-size: 9.5pt;
 font-weight: normal;
 color: #aaaaaa;
 text-align: left !important;
 min-width: 0ex;
 width: 0ex !important;
 border-right: 2px solid transparent;
}
div.rendered_html code {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 padding-top: 3px;
 color: #303030;
 background: #efefef;
 background-color: #efefef;
}
pre,
code,
kbd,
samp {
 white-space: pre-wrap;
}
code {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt !important;
 line-height: 170% !important;
 color: #353535;
 background: #efefef;
 background-color: #efefef;
}
kbd {
 padding: 4px;
 font-size: 11pt;
 color: #303030;
 background-color: #efefef;
 border: 0;
 box-shadow: none;
}
pre {
 display: block;
 padding: 8.5px;
 margin: 0 0 9px;
 font-size: 12.0pt;
 line-height: 1.42857143;
 color: #303030;
 background-color: #efefef;
 border: 1px solid #e7e7e7;
 border-radius: 2px;
}
div.rendered_html {
 color: #353535;
}
div.rendered_html pre,
div.text_cell_render pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt !important;
 line-height: 170% !important;
 color: #353535;
 background: #efefef;
 background-color: #efefef;
 border: 2px #e7e7e7  solid;
 max-width: 86%;
 border-radius: 2px;
 padding: 5px;
}
div.text_cell_render h1,
div.rendered_html h1,
div.text_cell_render h2,
div.rendered_html h2,
div.text_cell_render h3,
div.rendered_html h3,
div.text_cell_render h4,
div.rendered_html h4,
div.text_cell_render h5,
div.rendered_html h5 {
 font-family: "Exo_2", sans-serif;
}
.rendered_html h1:first-child,
.rendered_html h2:first-child,
.rendered_html h3:first-child,
.rendered_html h4:first-child,
.rendered_html h5:first-child,
.rendered_html h6:first-child {
 margin-top: 0.2em;
}
.rendered_html h1,
.text_cell_render h1 {
 color: #126dce;
 font-size: 220%;
 text-align: center;
 font-weight: lighter;
}
.rendered_html h2,
.text_cell_render h2 {
 text-align: left;
 font-size: 170%;
 color: #126dce;
 font-style: normal;
 font-weight: lighter;
}
.rendered_html h3,
.text_cell_render h3 {
 font-size: 150%;
 color: #126dce;
 font-weight: lighter;
 text-decoration: italic;
 font-style: normal;
}
.rendered_html h4,
.text_cell_render h4 {
 font-size: 120%;
 color: #126dce;
 font-weight: underline;
 font-style: normal;
}
.rendered_html h5,
.text_cell_render h5 {
 font-size: 100%;
 color: #2f2f2f;
 font-weight: lighter;
 text-decoration: underline;
}
.rendered_html table,
.rendered_html tr,
.rendered_html td {
 font-family: "Fira Code", monospace;
 font-size: 10.0pt !important;
 line-height: 150% !important;
 border: 1px solid #d6d6d6;
 color: #353535;
 background-color: #ffffff;
 background: #ffffff;
}
table.dataframe,
.rendered_html tr,
.dataframe * {
 font-family: "Fira Code", monospace;
 font-size: 10.0pt !important;
 border: 1px solid #d6d6d6;
}
.dataframe th,
.rendered_html th {
 font-family: "Exo_2", sans-serif;
 font-size: 11pt !important;
 font-weight: bold;
 border: 1px solid #c4c4c4;
 background: #eeeeee;
}
.dataframe td,
.rendered_html td {
 font-family: "Fira Code", monospace;
 font-size: 10.0pt !important;
 color: #353535;
 background: #ffffff;
 border: 1px solid #d6d6d6;
 text-align: left;
 min-width: 4em;
}
.dataframe-summary-row tr:last-child,
.dataframe-summary-col td:last-child {
 font-family: "Exo_2", sans-serif;
 font-size: 11pt !important;
 font-weight: bold;
 color: #353535;
 border: 1px solid #d6d6d6;
 background: #eeeeee;
}
div.widget-area {
 background-color: #ffffff;
 background: #ffffff;
 color: #303030;
}
div.widget-area a {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 font-weight: normal;
 font-style: normal;
 color: #303030;
 text-shadow: none !important;
}
div.widget-area a:hover,
div.widget-area a:focus {
 font-family: "Exo_2", sans-serif;
 font-size: 12.0pt;
 font-weight: normal;
 font-style: normal;
 color: #2f2f2f;
 background: rgba(180,180,180,.14);
 background-color: rgba(180,180,180,.14);
 border-color: transparent;
 background-image: none;
 text-shadow: none !important;
}
div.widget_item.btn-group > button.btn.btn-default.widget-combo-btn,
div.widget_item.btn-group > button.btn.btn-default.widget-combo-btn:hover {
 background: #eeeeee;
 background-color: #eeeeee;
 border: 2px solid #eeeeee !important;
 font-size: inherit;
 z-index: 0;
}
div.jupyter-widgets.widget-hprogress.widget-hbox,
div.widget-hbox,
.widget-hbox {
 display: inline-table;
}
div.jupyter-widgets.widget-hprogress.widget-hbox .widget-label,
div.widget-hbox .widget-label,
.widget-hbox .widget-label {
 font-size: 11pt;
 min-width: 100%;
 padding-top: 5px;
 padding-right: 10px;
 text-align: left;
 vertical-align: text-top;
}
.progress {
 overflow: hidden;
 height: 20px;
 margin-bottom: 10px;
 padding-left: 10px;
 background-color: #c6c6c6;
 border-radius: 4px;
 -webkit-box-shadow: none;
 box-shadow: none;
}
.rendered_html :link {
 font-family: "Exo_2", sans-serif;
 font-size: 100%;
 color: #2c85f7;
 text-decoration: underline;
}
.rendered_html :visited,
.rendered_html :visited:active,
.rendered_html :visited:focus {
 color: #2e6eb2;
}
.rendered_html :visited:hover,
.rendered_html :link:hover {
 font-family: "Exo_2", sans-serif;
 font-size: 100%;
 color: #eb6a18;
}
a.anchor-link:link:hover {
 font-size: inherit;
 color: #eb6a18;
}
a.anchor-link:link {
 font-size: inherit;
 text-decoration: none;
 padding: 0px 20px;
 visibility: none;
 color: #126dce;
}
div#nbextensions-configurator-container.container {
 width: 980px;
 margin-right: 0;
 margin-left: 0;
}
div.nbext-selector > nav > .nav > li > a {
 font-family: "Exo_2", sans-serif;
 font-size: 12pt;
}
div.nbext-readme > .nbext-readme-contents > .rendered_html {
 font-family: "Exo_2", sans-serif;
 font-size: 12pt;
 line-height: 145%;
 padding: 1em 1em;
 color: #353535;
 background-color: #ffffff;
 -webkit-box-shadow: none;
 -moz-box-shadow: none;
 box-shadow: none;
}
.nbext-icon,
.nbext-desc,
.nbext-compat-div,
.nbext-enable-btns,
.nbext-params {
 margin-bottom: 8px;
 font-size: 12pt;
}
div.nbext-readme > .nbext-readme-contents {
 padding: 0;
 overflow-y: hidden;
}
div.nbext-readme > .nbext-readme-contents:not(:empty) {
 margin-top: 0.5em;
 margin-bottom: 2em;
 border: none;
 border-top-color: rgba(180,180,180,.30);
}
.nbext-showhide-incompat {
 padding-bottom: 0.5em;
 color: #4a4a4a;
 font-size: 12.0pt;
}
.shortcut_key,
span.shortcut_key {
 display: inline-block;
 width: 16ex;
 text-align: right;
 font-family: monospace;
}
mark,
.mark {
 background-color: #ffffff;
 color: #353535;
 padding: .15em;
}
a.text-warning,
a.text-warning:hover {
 color: #aaaaaa;
}
a.text-warning.bg-warning {
 background-color: #ffffff;
}
span.bg-success.text-success {
 background-color: transparent;
 color: #009e07;
}
span.bg-danger.text-danger {
 background-color: #ffffff;
 color: #de143d;
}
.has-success .input-group-addon {
 color: #009e07;
 border-color: transparent;
 background: inherit;
 background-color: rgba(83,180,115,.10);
}
.has-success .form-control {
 border-color: #009e07;
 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
 box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
}
.has-error .input-group-addon {
 color: #de143d;
 border-color: transparent;
 background: inherit;
 background-color: rgba(192,57,67,.10);
}
.has-error .form-control {
 border-color: #de143d;
 -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
 box-shadow: inset 0 1px 1px rgba(0,0,0,0.025);
}
.kse-input-group-pretty > kbd {
 font-family: "Droid Sans Mono", monospace;
 color: #303030;
 font-weight: normal;
 background: transparent;
}
.kse-input-group-pretty > kbd {
 font-family: "Droid Sans Mono", monospace;
 color: #303030;
 font-weight: normal;
 background: transparent;
}
div.nbext-enable-btns .btn[disabled],
div.nbext-enable-btns .btn[disabled]:hover,
.btn-default.disabled,
.btn-default[disabled] {
 background: #e8e8e8;
 background-color: #e8e8e8;
 color: #282828;
}
label#Keyword-Filter {
 display: none;
}
.nav-pills > li.active > a,
.nav-pills > li.active > a:hover,
.nav-pills > li.active > a:focus {
 color: #ffffff;
 background-color: #126dce;
}
.input-group .nbext-list-btn-add,
.input-group-btn:last-child > .btn-group > .btn {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
.input-group .nbext-list-btn-add:hover,
.input-group-btn:last-child > .btn-group > .btn:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
#notebook-container > div.cell.code_cell.rendered.selected > div.widget-area > div.widget-subarea > div > div.widget_item.btn-group > button.btn.btn-default.dropdown-toggle.widget-combo-carrot-btn {
 background: #eeeeee;
 background-color: #eeeeee;
 border-color: #eeeeee;
}
#notebook-container > div.cell.code_cell.rendered.selected > div.widget-area > div.widget-subarea > div > div.widget_item.btn-group > button.btn.btn-default.dropdown-toggle.widget-combo-carrot-btn:hover {
 background: #e9e9e9;
 background-color: #e9e9e9;
 border-color: #e9e9e9;
}
input.raw_input {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt !important;
 color: #303030;
 background-color: #efefef;
 border-color: #ececec;
 background: #ececec;
 width: auto;
 vertical-align: baseline;
 padding: 0em 0.25em;
 margin: 0em 0.25em;
 -webkit-box-shadow: none;
 box-shadow: none;
}
audio,
video {
 display: inline;
 vertical-align: middle;
 align-content: center;
 margin-left: 20%;
}
.cmd-palette .modal-body {
 padding: 0px;
 margin: 0px;
}
.cmd-palette form {
 background: #eeeeee;
 background-color: #eeeeee;
}
.typeahead-field input:last-child,
.typeahead-hint {
 background: #eeeeee;
 background-color: #eeeeee;
 z-index: 1;
}
.typeahead-field input {
 font-family: "Exo_2", sans-serif;
 color: #303030;
 border: none;
 font-size: 28pt;
 display: inline-block;
 line-height: inherit;
 padding: 3px 10px;
 height: 70px;
}
.typeahead-select {
 background-color: #eeeeee;
}
body > div.modal.cmd-palette.typeahead-field {
 display: table;
 border-collapse: separate;
 background-color: #f7f7f7;
}
.typeahead-container button {
 font-family: "Exo_2", sans-serif;
 font-size: 28pt;
 background-color: #d0d0d0;
 border: none;
 display: inline-block;
 line-height: inherit;
 padding: 3px 10px;
 height: 70px;
}
.typeahead-search-icon {
 min-width: 40px;
 min-height: 55px;
 display: block;
 vertical-align: middle;
 text-align: center;
}
.typeahead-container button:focus,
.typeahead-container button:hover {
 color: #2f2f2f;
 background-color: #ff7823;
 border-color: #ff7823;
}
.typeahead-list > li.typeahead-group.active > a,
.typeahead-list > li.typeahead-group > a,
.typeahead-list > li.typeahead-group > a:focus,
.typeahead-list > li.typeahead-group > a:hover {
 display: none;
}
.typeahead-dropdown > li > a,
.typeahead-list > li > a {
 color: #303030;
 text-decoration: none;
}
.typeahead-dropdown,
.typeahead-list {
 font-family: "Exo_2", sans-serif;
 font-size: 13pt;
 color: #303030;
 background-color: #ffffff;
 border: none;
 background-clip: padding-box;
 margin-top: 0px;
 padding: 3px 2px 3px 0px;
 line-height: 1.7;
}
.typeahead-dropdown > li.active > a,
.typeahead-dropdown > li > a:focus,
.typeahead-dropdown > li > a:hover,
.typeahead-list > li.active > a,
.typeahead-list > li > a:focus,
.typeahead-list > li > a:hover {
 color: #2f2f2f;
 background-color: #f7f7f7;
 border-color: #f7f7f7;
}
.command-shortcut:before {
 content: "(command)";
 padding-right: 3px;
 color: #aaaaaa;
}
.edit-shortcut:before {
 content: "(edit)";
 padding-right: 3px;
 color: #aaaaaa;
}
ul.typeahead-list i {
 margin-left: 1px;
 width: 18px;
 margin-right: 10px;
}
ul.typeahead-list {
 max-height: 50vh;
 overflow: auto;
}
.typeahead-list > li {
 position: relative;
 border: none;
}
div.input.typeahead-hint,
input.typeahead-hint,
body > div.modal.cmd-palette.in > div > div > div > form > div > div.typeahead-field > span.typeahead-query > input.typeahead-hint {
 color: #aaaaaa !important;
 background-color: transparent;
 padding: 3px 10px;
}
.typeahead-dropdown > li > a,
.typeahead-list > li > a {
 display: block;
 padding: 5px;
 clear: both;
 font-weight: 400;
 line-height: 1.7;
 border: 1px solid #ffffff;
 border-bottom-color: rgba(180,180,180,.30);
}
body > div.modal.cmd-palette.in > div {
 min-width: 750px;
 margin: 150px auto;
}
.typeahead-container strong {
 font-weight: bolder;
 color: #ff7823;
}
#find-and-replace #replace-preview .match,
#find-and-replace #replace-preview .insert {
 color: #ffffff;
 background-color: #ff7823;
 border-color: #ff7823;
 border-style: solid;
 border-width: 1px;
 border-radius: 0px;
}
#find-and-replace #replace-preview .replace .match {
 background-color: #de143d;
 border-color: #de143d;
 border-radius: 0px;
}
#find-and-replace #replace-preview .replace .insert {
 background-color: #009e07;
 border-color: #009e07;
 border-radius: 0px;
}
div.CodeMirror,
div.CodeMirror pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 line-height: 170%;
 color: #303030;
}
div.CodeMirror-lines {
 padding-bottom: .6em;
 padding-left: .5em;
 padding-right: 1.5em;
 padding-top: 4px;
}
span.ansiblack {
 color: #dc4384;
}
span.ansiblue {
 color: #009e07;
}
span.ansigray {
 color: #ff7823;
}
span.ansigreen {
 color: #333333;
}
span.ansipurple {
 color: #653bc5;
}
span.ansicyan {
 color: #055be0;
}
span.ansiyellow {
 color: #ff7823;
}
span.ansired {
 color: #de143d;
}
div.output-stderr {
 background-color: #ebb5b7;
}
div.output-stderr pre {
 color: #000000;
}
div.js-error {
 color: #de143d;
}
.ipython_tooltip {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 line-height: 170%;
 border: 2px solid #dadada;
 background: #eeeeee;
 background-color: #eeeeee;
 border-radius: 2px;
 overflow-x: visible;
 overflow-y: visible;
 box-shadow: none;
 position: absolute;
 z-index: 1000;
}
.ipython_tooltip .tooltiptext pre {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 line-height: 170%;
 background: #eeeeee;
 background-color: #eeeeee;
 color: #303030;
 overflow-x: visible;
 overflow-y: visible;
 max-width: 900px;
}
div#tooltip.ipython_tooltip {
 overflow-x: wrap;
 overflow-y: visible;
 max-width: 800px;
}
div.tooltiptext.bigtooltip {
 overflow-x: visible;
 overflow-y: scroll;
 height: 400px;
 max-width: 800px;
}
.cm-s-ipython.CodeMirror {
 font-family: "Droid Sans Mono", monospace;
 font-size: 11pt;
 background: #efefef;
 color: #303030;
 border-radius: 2px;
 font-style: normal;
 font-weight: normal;
}
.cm-s-ipython div.CodeMirror-selected {
 background: #e0e1e3;
}
.cm-s-ipython .CodeMirror-gutters {
 background: #e0e1e3;
 border: none;
 border-radius: 0px;
}
.cm-s-ipython .CodeMirror-linenumber {
 color: #aaaaaa;
}
.cm-s-ipython .CodeMirror-cursor {
 border-left: 2px solid #ff711a;
}
.cm-s-ipython span.cm-comment {
 color: #8d8d8d;
 font-style: italic;
}
.cm-s-ipython span.cm-atom {
 color: #055be0;
}
.cm-s-ipython span.cm-number {
 color: #ff8132;
}
.cm-s-ipython span.cm-property {
 color: #e22978;
}
.cm-s-ipython span.cm-attribute {
 color: #de143d;
}
.cm-s-ipython span.cm-keyword {
 color: #713bc5;
 font-weight: normal;
}
.cm-s-ipython span.cm-string {
 color: #009e07;
}
.cm-s-ipython span.cm-meta {
 color: #aa22ff;
}
.cm-s-ipython span.cm-operator {
 color: #055be0;
}
.cm-s-ipython span.cm-builtin {
 color: #e22978;
}
.cm-s-ipython span.cm-variable {
 color: #303030;
}
.cm-s-ipython span.cm-variable-2 {
 color: #de143d;
}
.cm-s-ipython span.cm-variable-3 {
 color: #aa22ff;
}
.cm-s-ipython span.cm-def {
 color: #e22978;
 font-weight: normal;
}
.cm-s-ipython span.cm-error {
 background: rgba(191,97,106,.40);
}
.cm-s-ipython span.cm-tag {
 color: #e22978;
}
.cm-s-ipython span.cm-link {
 color: #ff7823;
}
.cm-s-ipython span.cm-storage {
 color: #055be0;
}
.cm-s-ipython span.cm-entity {
 color: #e22978;
}
.cm-s-ipython span.cm-quote {
 color: #009e07;
}
div.CodeMirror span.CodeMirror-matchingbracket {
 color: #1c1c1c;
 background-color: rgba(30,112,199,.30);
}
div.CodeMirror span.CodeMirror-nonmatchingbracket {
 color: #1c1c1c;
 background: rgba(191,97,106,.40) !important;
}
div.cell.text_cell .cm-s-default .cm-header {
 color: #126dce;
}
div.cell.text_cell .cm-s-default span.cm-variable-2 {
 color: #353535;
}
div.cell.text_cell .cm-s-default span.cm-variable-3 {
 color: #aa22ff;
}
.cm-s-default span.cm-comment {
 color: #8d8d8d;
}
.cm-s-default .cm-tag {
 color: #009fb7;
}
.cm-s-default .cm-builtin {
 color: #e22978;
}
.cm-s-default .cm-string {
 color: #009e07;
}
.cm-s-default .cm-keyword {
 color: #713bc5;
}
.cm-s-default .cm-number {
 color: #ff8132;
}
.cm-s-default .cm-error {
 color: #055be0;
}
.CodeMirror-cursor {
 border-left: 2px solid #ff711a;
 border-right: none;
 width: 0;
}
.cm-s-default div.CodeMirror-selected {
 background: #e0e1e3;
}
.cm-s-default .cm-selected {
 background: #e0e1e3;
}
div#maintoolbar {
 display: none !important;
}
#header-container {
 display: none !important;
}

/**********************************
 MathJax Settings and Style Script
**********************************/
.MathJax_Display,
.MathJax nobr>span.math>span {
    border: 0 !important;
    font-size: 110% !important;
    text-align: center !important;
    margin: 0em !important;
}
/* Prevents MathJax from jittering */
/* cell position when cell is selected */
.MathJax:focus, body :focus .MathJax {
    display: inline-block !important;
}

 </style>

```python
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

# 1. magic for inline plot
# 2. magic to print version
# 3. magic so that the notebook will reload external python modules
%matplotlib inline
%load_ext watermark
%load_ext autoreload
%autoreload 2

from sklearn.decomposition import PCA
from sklearn.pipeline import Pipeline
from sklearn.datasets import load_iris
from sklearn.metrics import accuracy_score
from sklearn.preprocessing import StandardScaler
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split

%watermark -a 'Ethen' -d -t -v -p numpy,pandas,matplotlib,sklearn
```

    Ethen 2017-07-30 14:06:12

    CPython 3.5.2
    IPython 6.1.0

    numpy 1.13.1
    pandas 0.19.2
    matplotlib 2.0.0
    sklearn 0.18.1

# Dimensionality Reduction

The starting point most data analysis problems is to perform some sort of exploratory data analysis on our raw data. This step is important because until we have basic understanding of the structure of our raw data, it might be hard to know whether the data is suitable for the task at hand or even derive insights that we can later share. During this exploratoy process, unsupervised methods such as dimensionality reduction can help us identify simpler and more compact representations of the original raw data to either aid our understanding or provide useful input to other stages of analysis. Here, we'll be focusing on a specific dimensionality reduction technique called **Principal Component Analysis (PCA)**.

Imagine that we're trying to understand some underlying phenomenon, in order to do so we measure various quantities potentially related to it. If we knew exactly what to measure in advance, we might be able to find some simple relationships in our data. But we typically don't, so we often measure anything that might be relevant and end up having irrelevant or redundant signals in our measurement. To make this a bit more concrete, we'll generate a toy 2-dimensional dataset to work with using the equation below.

$$x_2 = 500 + 20 \times x_1 + \epsilon$$

```python
np.random.seed(123)
x1 = np.arange(12, 56, 0.5)
e  = np.random.normal(0, 100, x1.shape[0])
x2 = 500 + 20 * x1 + e
X = np.c_[x1, x2]

# change default style figure and font size
plt.style.use('fivethirtyeight')
plt.rcParams['figure.figsize'] = 8, 6
plt.rcParams['font.size'] = 12

def plot2var(m):
    plt.scatter(m[:, 0], m[:, 1], s = 40, alpha = 0.8)
    plt.xlabel('x1')
    plt.ylabel('x2')

plot2var(X)
```

We can clearly see from the plot that there's linear relationship between the two variables, thus we probably don't need to include both of them as $x_1$ can be easily explained by $x_2$ and vice versa.

## PCA

If it is the case that one of the features is considered redundant, we should be able to summarize the data with less characteristics (features). So, the way PCA tackles this problem is: Instead of simply picking out the useful features and discarding the others, it uses a linear combination of the existing features and constructs some new features that are good alternative representation of the original data. In our 2D toy dataset, PCA will try to pick the best single direction, or often referred to as **first principal components** in 2D, and project our points onto that single direction. So the next question becomes, out of the many possible lines in 2D, what line should we pick?

It turns out, there are two different answers to this question. First answer is that we are looking for some features that strongly differ across data points, thus, PCA looks for features that captures as much variation across data points as possible. The second answer is that we are looking for the features that would allow us to "reconstruct" the original features. Imagine that we come up with a feature that has no relation to the original ones; If we were to use this new feature, there is no way we can relate this to the original ones. So PCA looks for features that minimizes the reconstruction error. These two notions can be depicted in the graph below, where the black dots represents the original data point, the black line represents the projected line, the red dot on the left shows the points on the projected line and the red line on the right shows the reconstruction error.

Surprisingly, it turns out that these two aims are equivalent and PCA can kill two birds with one stone. To see why minimizing squared residuals is equivalent to maximizing variance consider the 2 dimensions visualization below.

Consider a datapoint $a_i$. The contribution of this specific data point to the total variance is $a_i^Ta_i$, or equivalently the squared Euclidean length $\lVert \mathbf{a}_i \lVert^2$. Applying the Pythagorean theorem shows that this total variance equals the sum of variance lost (the squared residual) and variance remaining. Thus, it is equivalent to either maximize remaining variance or minimize lost variance to find the principal components.

Before we go another deeper, let's build some intuition using the scikit-learn library. The following section standardizes the data, fits the PCA model and prints out some of the important informations.

```python
# we start by standardizing our dataset
X_std = StandardScaler().fit_transform(X)

# call PCA specifying we only want the
# first two principal components (since
# we only have a 2d datset)
pca = PCA(n_components = 2)
pca.fit(X_std)

# important information
print('Components:\n ', pca.components_)
print('Explained Variance Ratio:\n ', pca.explained_variance_ratio_)
```

    Components:
      [[-0.70710678 -0.70710678]
     [ 0.70710678 -0.70710678]]
    Explained Variance Ratio:
      [ 0.95588995  0.04411005]

After fitting the PCA on the dataset, the fit learns some quantities from the data, most importantly the "components", which is the principal components (the new direction that our data points will be projected upon) and "explained variance ratio", which corresponds to the percentage of variance explained by each of the principal components. To get a better sense of what these numbers mean, let's visualize them over our standardized input data.

```python
def draw_vector(v0, v1):
    """draw principal components as vectors"""
    ax = plt.gca()
    arrowprops = dict(arrowstyle = '->',
                      linewidth = 2, edgecolor = 'black',
                      shrinkA = 0, shrinkB = 0)
    plt.annotate('', v1, v0, arrowprops = arrowprops)

# plot data
plt.scatter(X_std[:, 0], X_std[:, 1], s = 40, alpha = 0.8)
for length, vector in zip(pca.explained_variance_, pca.components_):
    # the larger the explained variance, the longer the
    # annotated line will be
    v = vector * 2 * np.sqrt(length)
    draw_vector(pca.mean_, pca.mean_ + v)

plt.axis('equal')
plt.show()
```

From the plot, we see that our PCA model gives us two principal components (the black line) and the length of the lines indicate of how important that principal component is in describing the variation of the original data. So if we were to choose 1 principal component to summarize our 2d dataset, it will be line that has the longest length (largest explained variance ratio). There're two things worth noting:

- The number of principal components matches the total number of features
- The first and second principal components are orthogonal to each other

The reason for this is that principal components transform the data into a new set of dimensions, and these new dimensions have to be equal to the original amount of dimensions. And just like the original $x$, $y$ axis that we're used to, they have to be orthogonal to each other. Let's now reduce the dimension of our 2d dataset into 1d by transforming our data onto the most important principal component and plot it along with the original data.

```python
# dimensionality reduction, keeping only
# the first principal component
pca = PCA(n_components = 1)
X_pca = pca.fit_transform(X_std)
print("original shape:   ", X.shape)
print("transformed shape:", X_pca.shape)

# inverse transform to obtain the projected data
# and compare with the original
X_new = pca.inverse_transform(X_pca)
plt.scatter(X_std[:, 0], X_std[:, 1], s = 40, alpha = 0.2)
plt.scatter(X_new[:, 0], X_new[:, 1], s = 40, alpha = 0.8)
plt.show()
```

In the plot above, the lighter points are the original data and the darker points are the projected version. Looking at the projections we see that the points projected onto the first principal component all seem close to their initial representations and at the same time, it also captures most of the variations in our original data points.

Hopefully, this elucidate what a PCA dimensionality reduction is doing. In a nutshell, PCA aims to find the directions or so called the principal components of maximum variance in high-dimensional data and project it onto a smaller dimensional subspace while retaining most of the information. In our 2d example, the linear relationship between $x_1$ and $x_2$ is mostly preserved using only 1 feature instead of 2.

## PCA From Scratch

Now that we have a high level understanding of what PCA is accomplishing, let's now formalize this with some notations. Recall that PCA is trying the find the direction such that the projection of the data on it has the highest variance. So given $X$, the centered data matrix, the projection, $Xw$ (dot product between the data point, $X$ and the projection weight, $w$), its variance can be computed as follows:

\begin{align}
\frac{1}{n-1}(\mathbf{Xw})^\top \mathbf{Xw} = \mathbf w^\top (\frac{1}{n-1}\mathbf X^\top\mathbf X) \mathbf w = \mathbf w^\top \mathbf{Cw}
\end{align}

Where $\mathbf{C}$ is the covariance matrix of the data $\mathbf{X}$. In case this looks unfamiliar, the covariance matrix is a $d \times d$ matrix ($d$ is the total number of dimensions, features) where each element represents the covariance between two features. The covariance between two features $x_j$ and $x_k$ is calculated as follows:

\begin{align}
\sigma_{jk} = \frac{1}{n-1} \sum_{i=1}^{n} \left( x_{ij} - \bar{x}_j \right) \left( x_{ik} - \bar{x}_k \right)
\end{align}

Where $\bar{x}_j$ is simply the mean of vector (feature) $\bar{x}_j = \sum \limits_{i=1}^n x_{ij}$.

We can also express the calculation of the covariance matrix via the following matrix equation:

\begin{align}
\mathbf{C} = \frac{1}{n-1} \big( (X - \bar{x})^\top( X - \bar{x}) \big)
\end{align}

Because we already assume to data point $X$ has been centered, thus the $X - \bar{x}$ part can be simplified into just $X$. And the formula above simply becomes:

\begin{align}
\mathbf{C} = \frac{1}{n-1} X^\top X
\end{align}

Next, apart from the original objective function $\mathbf w^\top \mathbf{Cw}$, we also introduce an additional constraint $\|\mathbf w\|=\mathbf w^\top \mathbf w=1$, saying our weight vector should have unit length. The intuition behind this is that: If we were to simply maximize the formula $\mathbf w^\top \mathbf{Cw}$, we can multiply $w$ by any number and the objective function will increase by the square of this number. So the problem becomes ill-defined since the maximum of this expression is infinite. Given these two pieces of information, our objective function for PCA becomes:

\begin{align}
&  \underset{\mathbf{w}}{\text{maximize}}
&& \mathbf w^\top \mathbf{Cw} \nonumber \\
&  \text{subject to}
&& \mathbf w^\top \mathbf w=1
\end{align}

This objective function can be solved by the Lagrange multiplier, minimizing the loss function:

\begin{align}
L &= \mathbf w^\top \mathbf{Cw}-\lambda(\mathbf w^\top \mathbf w-1)
\end{align}

If this looks unfamiliar, check out the following tutorial on Lagrange multiplier. [Khan Academy: Lagrange multipliers, examples](https://www.khanacademy.org/math/multivariable-calculus/applications-of-multivariable-derivatives/constrained-optimization/a/lagrange-multipliers-examples). Next, to solve for $w$, we set the partial derivative of $L$ with respect to $w$ to 0.

\begin{align}
\frac{\partial L}{\partial \mathbf w}
& \implies \mathbf{Cw} - \lambda \mathbf w = 0 \\
& \implies \mathbf{Cw} = \lambda \mathbf w
\end{align}

Hopefully the formula above looks familar, since it's essentially an eigendecomposition problem. The notion of eigendecomposition is basically trying to solve the equation:

\begin{align}
Ax &= \lambda x
\end{align}

In our case, $A$ is our covariance matrix correponding to $\mathbf C$; $x$ is our eigenvector, correponding to $\mathbf w$ and $\lambda$ is our eigenvalue correponding to explained variance. After solving the equation above, we'll obtain eigenvector and eigenvalue pairs, where very eigenvector has a corresponding eigenvalue. An eigenvector is essentially the direction of each principal component and the eigenvalue is a number, telling us how much variance there is in the data in that direction, in other words, how spread out the data is on the line. For those interested, the following blog walks through the calculating eigenvalue and eigenvectors from scratch. [Blog: What are eigenvectors and eigenvalues?](http://www.visiondummy.com/2014/03/eigenvalues-eigenvectors/)

Given all of that, let's see how this works in code. Just to summarize, the general framework for computing PCA is as follows:

- Standardize the data
- Obtain the Eigenvectors and Eigenvalues from the covariance matrix
- Sort eigenvalues in descending order and choose the $k$ eigenvectors that correspond to the $k$ largest eigenvalues where $k$ is the number of dimensions of the new feature subspace
- Projection onto the new feature space. During this step we will take the top $k$ eigenvectors and use it to transform the original dataset $X$ to obtain a k-dimensional feature subspace $X'$

For the section below, we will be working with the famous "Iris" dataset. The iris dataset is a 150×4 matrix where the columns are the different features (sepal length in cm, sepal width in cm, petal length in cm, petal width in cm) and every every row represents a separate flower sample. The three classes in the Iris dataset are: Iris-setosa (n=50), Iris-versicolor (n=50), Iris-virginica (n=50). We'll use histograms to get a feeling of how the 3 different flower classes are distributes along the 4 different features.

```python
iris = load_iris()
X = iris['data']
y = iris['target']

label_dict = {0: 'Iris-Setosa',
              1: 'Iris-Versicolor',
              2: 'Iris-Virgnica'}

feature_dict = {0: 'sepal length [cm]',
                1: 'sepal width [cm]',
                2: 'petal length [cm]',
                3: 'petal width [cm]'}

fig = plt.figure(figsize = (10, 6))
for feature in range(len(feature_dict)):
    plt.subplot(2, 2, feature + 1)
    for index, label in label_dict.items():
        plt.hist(X[y == index, feature], label = label,
                 bins = 10, alpha = 0.3)
        plt.xlabel(feature_dict[feature])

plt.legend(loc = 'upper right', fancybox = True, fontsize = 12)
plt.tight_layout()
plt.show()
```

### Standardize

In general, it's important to standardize the data prior to a PCA on the covariance matrix depends on the measurement scales of the original features. Since PCA yields a feature subspace that maximizes the variance along the axes, it makes sense to standardize the data, especially if it was measured on different scales so different features will have equal contribution in terms of their scales.

```python
# subtract the mean and divide the
# standard deviation of each features
mean = np.mean(X, axis = 0)
scale = np.std(X, axis = 0)
X_std = (X - mean) / scale
```

### Eigendecomposition - Computing Eigenvectors and Eigenvalues

The eigenvectors and eigenvalues of a covariance matrix is the core of PCA: The eigenvectors (principal components) determine the directions of the new feature space, and the eigenvalues determine their magnitude (variance explained along the principal components).

```python
# for those unfamiliar with the @ syntax it
# is equivalent of .dot, the dot product
vec_mean = np.mean(X_std, axis = 0)
vec_diff = X_std - vec_mean
cov_mat  = vec_diff.T @ vec_diff / (X_std.shape[0] - 1)
print('Covariance matrix \n {}'.format(cov_mat))

# note that since we already standardize the data,
# meaning the mean vector for each features, vec_mean
# will be 0 (really small numbers if you were to print them out),
# hence we don't have to substract the mean to standardize them
cov_mat = X_std.T @ X_std / (X_std.shape[0] - 1)
print('Covariance matrix \n {}'.format(cov_mat))

# equivalently, we could have used the np.cov function:
# since each row represents a variable for np.cov,
# we'll need to transpose the matrix
print('NumPy covariance matrix: \n {}'.format(np.cov(X_std.T)))
```

    Covariance matrix
     [[ 1.00671141 -0.11010327  0.87760486  0.82344326]
     [-0.11010327  1.00671141 -0.42333835 -0.358937  ]
     [ 0.87760486 -0.42333835  1.00671141  0.96921855]
     [ 0.82344326 -0.358937    0.96921855  1.00671141]]
    Covariance matrix
     [[ 1.00671141 -0.11010327  0.87760486  0.82344326]
     [-0.11010327  1.00671141 -0.42333835 -0.358937  ]
     [ 0.87760486 -0.42333835  1.00671141  0.96921855]
     [ 0.82344326 -0.358937    0.96921855  1.00671141]]
    NumPy covariance matrix:
     [[ 1.00671141 -0.11010327  0.87760486  0.82344326]
     [-0.11010327  1.00671141 -0.42333835 -0.358937  ]
     [ 0.87760486 -0.42333835  1.00671141  0.96921855]
     [ 0.82344326 -0.358937    0.96921855  1.00671141]]

After obtaining the covariance matrix, we perform an eigendecomposition on it to obtain the eigenvalues and eigenvectors.

```python
# since computing this by hand can be quite tedious
# we'll simply use the pre-implemented function
eig_vals, eig_vecs = np.linalg.eig(cov_mat)
print('Eigenvectors \n%s' % eig_vecs)
print('\nEigenvalues \n%s' % eig_vals)
```

    Eigenvectors
    [[ 0.52237162 -0.37231836 -0.72101681  0.26199559]
     [-0.26335492 -0.92555649  0.24203288 -0.12413481]
     [ 0.58125401 -0.02109478  0.14089226 -0.80115427]
     [ 0.56561105 -0.06541577  0.6338014   0.52354627]]

    Eigenvalues
    [ 2.93035378  0.92740362  0.14834223  0.02074601]

### Choosing Top K Eigenvectors

Recall that the typical goal of a PCA is to reduce the dimensionality of the original feature space by projecting it onto a smaller subspace. In order to decide which eigenvector(s) can dropped without losing too much information for the construction of lower-dimensional subspace, we need to inspect the corresponding eigenvalues. The idea is: eigenvectors with the lowest eigenvalues bear the least information about the distribution of the data and those are the ones can be dropped. In order to do so, the common approach is to rank the eigenvalues from highest to lowest in order choose the top $k$ eigenvectors.

After sorting the eigenpairs, the next question is "how many principal components are we going to choose for our new feature subspace?" A useful measure is the so-called “explained variance,” which can be calculated from the eigenvalues. The explained variance tells us how much extra information (variance) does each of the principal components contribute.

```python
eig_vals_total = np.sum(eig_vals)
var_exp = eig_vals / eig_vals_total
cum_var_exp = np.cumsum(var_exp)
print('Variance Explained: ', var_exp)
print('Cumulative Variance Explained: ', cum_var_exp)

plt.bar(range(var_exp.shape[0]), var_exp, alpha = 0.5,
        align = 'center', label = 'individual explained variance')
plt.step(range(var_exp.shape[0]), cum_var_exp,
         where = 'mid', label = 'cumulative explained variance')
plt.ylabel('Explained variance ratio')
plt.xlabel('Principal components')
plt.ylim(0, 1.1)
plt.legend(loc = 'best')
plt.tight_layout()
```

The plot above clearly shows that most of the variance (72.77% of the variance to be precise) can be explained by the first principal component alone. The second principal component still bears some information (23.03%) while the third and fourth principal components can safely be dropped without losing to much information. Together, the first two principal components explains 95.8% of the variance. Or in other words, it contain 95.8% of the information (95% or 99% are comon threshold that people use).

### Projection Onto the New Feature Space

In the last step, we will use the 4×2-dimensional eigenvectors to transform our samples onto the new subspace via the equation $Y=XW$, where Y will be our 150×2 matrix of transformed samples (we reduce the dimension from the original 4 down to 2).

```python
def plot_iris_pca(X_pca, y):
    """a scatter plot of the 2-dimensional iris data"""
    markers = 's', 'x', 'o'
    colors = list(plt.rcParams['axes.prop_cycle'])
    target = np.unique(y)
    for idx, (t, m) in enumerate( zip(target, markers) ):
        subset = X_pca[y == t]
        plt.scatter(subset[:, 0], subset[:, 1], s = 50,
                    c = colors[idx]['color'], label = t, marker = m)

    plt.xlabel('PC 1')
    plt.ylabel('PC 2')
    plt.legend(loc = 'lower left')
    plt.tight_layout()
    plt.show()
```

```python
X_std_pca = X_std.dot(eig_vecs[:, 0:2])
plot_iris_pca(X_std_pca, y)
```

We'll put all of this into a single class, train it and confirm the result with scikit-learn's PCA model by printing out the explained variance ratio.

```python
class PCAModel:
    """
    Principal component analysis (PCA)

    Parameters
    ----------
    n_components : int
        top number of principal components to keep
    """
    def __init__(self, n_components):
        self.n_components = n_components

    def fit(self, X):
        # standardize
        X = X.copy()
        self.mean = np.mean(X, axis = 0)
        self.scale = np.std(X, axis = 0)
        X = (X - self.mean) / self.scale

        # eigendecomposition
        eig_vals, eig_vecs = np.linalg.eig(np.cov(X.T))
        self.components = eig_vecs[:, :self.n_components]
        var_exp = eig_vals / np.sum(eig_vals)
        self.explained_variance_ratio = var_exp[:self.n_components]
        return self

    def transform(self, X):
        X = X.copy()
        X = (X - self.mean) / self.scale
        X_pca = X @ self.components
        return X_pca
```

```python
# implementation from scratch
pca_model = PCAModel(n_components = 2).fit(X)

# using library to confirm results
scaler = StandardScaler()
X_std = scaler.fit_transform(X)
pca = PCA(n_components = 2).fit(X_std)

# print explained ratio to see if the matches
print('library: ', pca.explained_variance_ratio_)
print('from scratch: ', pca_model.explained_variance_ratio)
```

    library:  [ 0.72770452  0.23030523]
    from scratch:  [ 0.72770452  0.23030523]

## Takeaway

Let's wrap this up with a summary of PCA and some of its applications. In order to identify patterns in our data, we often look for variation across observations to distinguish them from one another. Hence it seems reasonable to be able to find a succinct representation that best captures the variation in our initial data. PCA, in particular, look to explain our data via its maximum directions of variance. By compressing a higher dimensional dataset into lower one, while still retaining most of the variance this allows us to:

- Perform Visualization: PCA summarizes our data along the principal components (or eigenvectors), which explains most the variance. Thus we can reduce the dataset to 2 or 3 dimensions and visualize our data's distribution. This can be helpful when we're performing clustering algorithm that needs to choose the cluster number beforehand.
- Speed up machine learning algorithms: When dealing with Big Data, we might want to decompose the features into a lower dimension, without a significant loss in variance. By performing dimensionality reduction methods, we can reduce the amount of features we have to speed up the training algorithm and save memory. For this part, we'll use the Iris dataset again and show that by keeping the data's top 3 principal components we can obtain the same level of accuracy as keeping all 4 features.

```python
# split 30% of the iris data into a test set for evaluation
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.3,
                                                    random_state = 1)

# create the pipeline, where we'll
# standardize the data, perform PCA and
# fit the logistic regression
pipe1 = Pipeline([
    ('standardize', StandardScaler()),
    ('pca', PCA(n_components = 3)),
    ('logistic', LogisticRegression(random_state = 1))
])
pipe1.fit(X_train, y_train)
y_pred1 = pipe1.predict(X_test)

# pipeline without PCA
pipe2 = Pipeline([
    ('standardize', StandardScaler()),
    ('logistic', LogisticRegression(random_state = 1))
])
pipe2.fit(X_train, y_train)
y_pred2 = pipe2.predict(X_test)

# access the prediction accuracy
print('PCA Accuracy %.3f' % accuracy_score(y_test, y_pred1))
print('Accuracy %.3f' % accuracy_score(y_test, y_pred2))
```

    PCA Accuracy 0.822
    Accuracy 0.822

# Reference

- [Youtube: Dimensionality Reduction](https://www.youtube.com/playlist?list=PLnnr1O8OWc6aVexn2BY0qjklobY6TUEIy)
- [Blog: What are eigenvectors and eigenvalues?](http://www.visiondummy.com/2014/03/eigenvalues-eigenvectors/)
- [Blog: Principal Component Analysis 4 Dummies](https://georgemdallas.wordpress.com/2013/10/30/principal-component-analysis-4-dummies-eigenvectors-eigenvalues-and-dimension-reduction/)
- [Blog: Everything you did and didn't know about PCA](http://alexhwilliams.info/itsneuronalblog/2016/03/27/pca/)
- [Blog: Principal Component Analysis in 3 Simple Steps](http://sebastianraschka.com/Articles/2015_pca_in_3_steps.html)
- [Notebook: In Depth: Principal Component Analysis](http://nbviewer.jupyter.org/github/jakevdp/PythonDataScienceHandbook/blob/95664b978439df948b2cd2f5f5b4e31f28b30394/notebooks/05.09-Principal-Component-Analysis.ipynb)
- [StackExchange: Making sense of principal component analysis, eigenvectors & eigenvalues](http://stats.stackexchange.com/questions/2691/making-sense-of-principal-component-analysis-eigenvectors-eigenvalues)
- [StackExchange: What is an intuitive explanation for how PCA turns from a geometric problem (with distances) to a linear algebra problem (with eigenvectors)?](http://stats.stackexchange.com/questions/217995/what-is-an-intuitive-explanation-for-how-pca-turns-from-a-geometric-problem-wit)