├── .gitignore ├── BUILDING.md ├── LICENSE ├── Makefile ├── README.md ├── assets ├── auto-render.min.js ├── fonts │ ├── KaTeX_AMS-Regular.eot │ ├── KaTeX_AMS-Regular.ttf │ ├── KaTeX_AMS-Regular.woff │ ├── KaTeX_AMS-Regular.woff2 │ ├── KaTeX_Caligraphic-Bold.eot │ ├── KaTeX_Caligraphic-Bold.ttf │ ├── KaTeX_Caligraphic-Bold.woff │ ├── KaTeX_Caligraphic-Bold.woff2 │ ├── KaTeX_Caligraphic-Regular.eot │ ├── KaTeX_Caligraphic-Regular.ttf │ ├── KaTeX_Caligraphic-Regular.woff │ ├── KaTeX_Caligraphic-Regular.woff2 │ ├── KaTeX_Fraktur-Bold.eot │ ├── KaTeX_Fraktur-Bold.ttf │ ├── KaTeX_Fraktur-Bold.woff │ ├── KaTeX_Fraktur-Bold.woff2 │ ├── KaTeX_Fraktur-Regular.eot │ ├── KaTeX_Fraktur-Regular.ttf │ ├── KaTeX_Fraktur-Regular.woff │ ├── KaTeX_Fraktur-Regular.woff2 │ ├── KaTeX_Main-Bold.eot │ ├── KaTeX_Main-Bold.ttf │ ├── KaTeX_Main-Bold.woff │ ├── KaTeX_Main-Bold.woff2 │ ├── KaTeX_Main-Italic.eot │ ├── KaTeX_Main-Italic.ttf │ ├── KaTeX_Main-Italic.woff │ ├── KaTeX_Main-Italic.woff2 │ ├── KaTeX_Main-Regular.eot │ ├── KaTeX_Main-Regular.ttf │ ├── KaTeX_Main-Regular.woff │ ├── KaTeX_Main-Regular.woff2 │ ├── KaTeX_Math-BoldItalic.eot │ ├── KaTeX_Math-BoldItalic.ttf │ ├── KaTeX_Math-BoldItalic.woff │ ├── KaTeX_Math-BoldItalic.woff2 │ ├── KaTeX_Math-Italic.eot │ ├── KaTeX_Math-Italic.ttf │ ├── KaTeX_Math-Italic.woff │ ├── KaTeX_Math-Italic.woff2 │ ├── KaTeX_Math-Regular.eot │ ├── KaTeX_Math-Regular.ttf │ ├── KaTeX_Math-Regular.woff │ ├── KaTeX_Math-Regular.woff2 │ ├── KaTeX_SansSerif-Bold.eot │ ├── KaTeX_SansSerif-Bold.ttf │ ├── KaTeX_SansSerif-Bold.woff │ ├── KaTeX_SansSerif-Bold.woff2 │ ├── KaTeX_SansSerif-Italic.eot │ ├── KaTeX_SansSerif-Italic.ttf │ ├── KaTeX_SansSerif-Italic.woff │ ├── KaTeX_SansSerif-Italic.woff2 │ ├── KaTeX_SansSerif-Regular.eot │ ├── KaTeX_SansSerif-Regular.ttf │ ├── KaTeX_SansSerif-Regular.woff │ ├── KaTeX_SansSerif-Regular.woff2 │ ├── KaTeX_Script-Regular.eot │ ├── KaTeX_Script-Regular.ttf │ ├── KaTeX_Script-Regular.woff │ ├── KaTeX_Script-Regular.woff2 │ ├── KaTeX_Size1-Regular.eot │ ├── KaTeX_Size1-Regular.ttf │ ├── KaTeX_Size1-Regular.woff │ ├── KaTeX_Size1-Regular.woff2 │ ├── KaTeX_Size2-Regular.eot │ ├── KaTeX_Size2-Regular.ttf │ ├── KaTeX_Size2-Regular.woff │ ├── KaTeX_Size2-Regular.woff2 │ ├── KaTeX_Size3-Regular.eot │ ├── KaTeX_Size3-Regular.ttf │ ├── KaTeX_Size3-Regular.woff │ ├── KaTeX_Size3-Regular.woff2 │ ├── KaTeX_Size4-Regular.eot │ ├── KaTeX_Size4-Regular.ttf │ ├── KaTeX_Size4-Regular.woff │ ├── KaTeX_Size4-Regular.woff2 │ ├── KaTeX_Typewriter-Regular.eot │ ├── KaTeX_Typewriter-Regular.ttf │ ├── KaTeX_Typewriter-Regular.woff │ └── KaTeX_Typewriter-Regular.woff2 ├── github.svg ├── index.html.jinja ├── katex.min.css ├── katex.min.js ├── remark.min.js ├── requirements-slides.txt ├── style.css └── twitter.svg ├── environment.yml ├── images ├── .gitkeep ├── amazon.png ├── blood_quality.png ├── clustering.png ├── data-representation.svg ├── dota.png ├── favicon_org.png ├── higgs.png ├── ml-prediction.svg ├── ml-training.svg ├── ml-workflow-sklearn.svg ├── ml-workflow.svg ├── pipeline.svg ├── reinforcement.svg ├── scikit-learn-logo-notext.png ├── traditional-programming.svg └── train-test.svg ├── index.html ├── maint_tools └── check_notebooks.sh ├── make.py ├── notebooks ├── .gitkeep ├── 01-loading-data.ipynb ├── 02-supervised-learning.ipynb ├── 03-preprocessing.ipynb ├── 04-pipelines.ipynb ├── images │ ├── housing_box.svg │ ├── housing_scatter.svg │ ├── knn-data.svg │ └── knn-scaling.svg ├── slide-images.ipynb └── solutions │ ├── 01-ex1-solution.py │ ├── 02-ex1-solution.py │ ├── 02-ex2-solution.py │ ├── 03-ex1-solution.py │ └── 04-ex01-solution.py ├── requirements.txt └── slides.md /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 98 | __pypackages__/ 99 | 100 | # Celery stuff 101 | celerybeat-schedule 102 | celerybeat.pid 103 | 104 | # SageMath parsed files 105 | *.sage.py 106 | 107 | # Environments 108 | .env 109 | .venv 110 | env/ 111 | venv/ 112 | ENV/ 113 | env.bak/ 114 | venv.bak/ 115 | 116 | # Spyder project settings 117 | .spyderproject 118 | .spyproject 119 | 120 | # Rope project settings 121 | .ropeproject 122 | 123 | # mkdocs documentation 124 | /site 125 | 126 | # mypy 127 | .mypy_cache/ 128 | .dmypy.json 129 | dmypy.json 130 | 131 | # Pyre type checker 132 | .pyre/ 133 | 134 | # pytype static type analyzer 135 | .pytype/ 136 | 137 | # Cython debug symbols 138 | cython_debug/ 139 | -------------------------------------------------------------------------------- /BUILDING.md: -------------------------------------------------------------------------------- 1 | # FAQ 2 | 3 | ## How do I build slides? 4 | 5 | Install the dependencies: `pip install -r assets/requirements-slides.txt`. 6 | 7 | ```py 8 | python make.py build 9 | ``` 10 | 11 | Remember to rebuild when `slides.md` get updated. 12 | 13 | ## How do I develop and live reload? 14 | 15 | ```py 16 | python make.py live 17 | ``` 18 | 19 | ## How to host on github pages? 20 | 21 | 1. Go to settings. 22 | 2. Enable GitHub Pages. 23 | 24 | ## How to change my favicon? 25 | 26 | Replace favicon with something else 27 | 28 | ## How to save as pdf? 29 | 30 | 1. Install decktape 31 | 32 | ```bash 33 | npm install -g decktape 34 | ``` 35 | 36 | 2. Run decktape 37 | 38 | ```bash 39 | decktape "http://localhost:5500" slides.pdf 40 | ``` 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Thomas Fan 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 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | .PHONY: clean check 2 | 3 | clean: 4 | jupyter nbconvert --clear-output --inplace notebooks/0*.ipynb 5 | 6 | check: 7 | bash maint_tools/check_notebooks.sh 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Introduction to scikit-learn: Machine Learning in Python 2 | 3 | *By Thomas J. Fan* 4 | 5 | [Link to slides](https://thomasjpfan.github.io/ml-workshop-intro/) 6 | 7 | Scikit-learn is a Python machine learning library used by data science practitioners from many disciplines. We will start this training by learning about scikit-learn's API for supervised machine learning. scikit-learn's API mainly consists of three methods: fit to build models, predict to make predictions from models, and transform to modify data. This consistent and straightforward interface abstracts away the underlying algorithm, thus enabling us to focus on our particular problems. We will learn about the importance of splitting your data into train and test sets for model evaluation. Next, we will learn about combining preprocessing techniques with machine learning models using scikit-learn's Pipeline. The Pipeline allows us to connect transformers with a classifier or regressor to build a data flow, where the output of one layer is the input or another. After this training, you will have the foundations to apply scikit-learn to your machine learning problems. 8 | 9 | ## Obtaining the Material 10 | 11 | ### With git 12 | 13 | The most convenient way to download the material is with git: 14 | 15 | ```bash 16 | git clone https://github.com/thomasjpfan/ml-workshop-intro 17 | ``` 18 | 19 | Please note that I may add and improve the material until shortly before the session. You can update your copy by running: 20 | 21 | ```bash 22 | git pull origin master 23 | ``` 24 | 25 | ### Download zip 26 | 27 | If you are not familiar with git, you can download this repository as a zip file at: [github.com/thomasjpfan/ml-workshop-intro/archive/master.zip](https://github.com/thomasjpfan/ml-workshop-intro/archive/master.zip). Please note that I may add and improve the material until shortly before the session. To update your copy please re-download the material a day before the session. 28 | 29 | ## Running the notebooks 30 | 31 | ### Local Installation 32 | 33 | Local installation requires `conda` to be installed on your machine. The simplest way to install `conda` is to install `miniconda` by using an installer for your operating system provided at [docs.conda.io/en/latest/miniconda.html](https://docs.conda.io/en/latest/miniconda.html). After `conda` is installed, navigate to this repository on your local machine: 34 | 35 | ```bash 36 | cd ml-workshop-intro 37 | ``` 38 | 39 | Then download and install the dependencies: 40 | 41 | ```bash 42 | conda env create -f environment.yml 43 | ``` 44 | 45 | This will create a virtual environment named `ml-workshop-intro`. To activate this environment: 46 | 47 | ```bash 48 | conda activate ml-workshop-intro 49 | ``` 50 | 51 | Finally, to start `jupyterlab` run: 52 | 53 | ```bash 54 | jupyter lab 55 | ``` 56 | 57 | This should open a browser window with the `jupterlab` interface. 58 | 59 | ### Run with Google's Colab 60 | 61 | If you have any issues with installing `conda` or running `jupyter` on your local computer, then you can run the notebooks on Google's Colab: 62 | 63 | 1. [Loading data into machine learning](https://colab.research.google.com/github/thomasjpfan/ml-workshop-intro/blob/master/notebooks/01-loading-data.ipynb) 64 | 2. [Supervised learning with scikit-learn](https://colab.research.google.com/github/thomasjpfan/ml-workshop-intro/blob/master/notebooks/02-supervised-learning.ipynb) 65 | 3. [Preprocessing](https://colab.research.google.com/github/thomasjpfan/ml-workshop-intro/blob/master/notebooks/03-preprocessing.ipynb) 66 | 4. [Pipelines](https://colab.research.google.com/github/thomasjpfan/ml-workshop-intro/blob/master/notebooks/04-pipelines.ipynb) 67 | 68 | 69 | ## License 70 | 71 | This repo is under the [MIT License](LICENSE). 72 | -------------------------------------------------------------------------------- /assets/auto-render.min.js: -------------------------------------------------------------------------------- 1 | (function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.renderMathInElement=e()}})(function(){var e,t,n;return function e(t,n,r){function o(c,a){if(!n[c]){if(!t[c]){var u=typeof require=="function"&&require;if(!a&&u)return u(c,!0);if(i)return i(c,!0);var f=new Error("Cannot find module '"+c+"'");throw f.code="MODULE_NOT_FOUND",f}var s=n[c]={exports:{}};t[c][0].call(s.exports,function(e){var n=t[c][1][e];return o(n?n:e)},s,s.exports,e,t,n,r)}return n[c].exports}var i=typeof require=="function"&&require;for(var c=0;cf){s=a[f++];if(s!=s)return true}else for(;u>f;f++)if(e||f in a){if(a[f]===n)return e||f||0}return!e&&-1}}},{"./_to-index":32,"./_to-iobject":34,"./_to-length":35}],8:[function(e,t,n){var r={}.toString;t.exports=function(e){return r.call(e).slice(8,-1)}},{}],9:[function(e,t,n){var r=t.exports={version:"2.4.0"};if(typeof __e=="number")__e=r},{}],10:[function(e,t,n){var r=e("./_a-function");t.exports=function(e,t,n){r(e);if(t===undefined)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},{"./_a-function":5}],11:[function(e,t,n){t.exports=function(e){if(e==undefined)throw TypeError("Can't call method on "+e);return e}},{}],12:[function(e,t,n){t.exports=!e("./_fails")(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7})},{"./_fails":16}],13:[function(e,t,n){var r=e("./_is-object"),o=e("./_global").document,i=r(o)&&r(o.createElement);t.exports=function(e){return i?o.createElement(e):{}}},{"./_global":17,"./_is-object":22}],14:[function(e,t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],15:[function(e,t,n){var r=e("./_global"),o=e("./_core"),i=e("./_ctx"),c=e("./_hide"),a="prototype";var u=function(e,t,n){var f=e&u.F,s=e&u.G,l=e&u.S,p=e&u.P,d=e&u.B,_=e&u.W,v=s?o:o[t]||(o[t]={}),h=v[a],b=s?r:l?r[t]:(r[t]||{})[a],y,g,x;if(s)n=t;for(y in n){g=!f&&b&&b[y]!==undefined;if(g&&y in v)continue;x=g?b[y]:n[y];v[y]=s&&typeof b[y]!="function"?n[y]:d&&g?i(x,r):_&&b[y]==x?function(e){var t=function(t,n,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(t);case 2:return new e(t,n)}return new e(t,n,r)}return e.apply(this,arguments)};t[a]=e[a];return t}(x):p&&typeof x=="function"?i(Function.call,x):x;if(p){(v.virtual||(v.virtual={}))[y]=x;if(e&u.R&&h&&!h[y])c(h,y,x)}}};u.F=1;u.G=2;u.S=4;u.P=8;u.B=16;u.W=32;u.U=64;u.R=128;t.exports=u},{"./_core":9,"./_ctx":10,"./_global":17,"./_hide":19}],16:[function(e,t,n){t.exports=function(e){try{return!!e()}catch(e){return true}}},{}],17:[function(e,t,n){var r=t.exports=typeof window!="undefined"&&window.Math==Math?window:typeof self!="undefined"&&self.Math==Math?self:Function("return this")();if(typeof __g=="number")__g=r},{}],18:[function(e,t,n){var r={}.hasOwnProperty;t.exports=function(e,t){return r.call(e,t)}},{}],19:[function(e,t,n){var r=e("./_object-dp"),o=e("./_property-desc");t.exports=e("./_descriptors")?function(e,t,n){return r.f(e,t,o(1,n))}:function(e,t,n){e[t]=n;return e}},{"./_descriptors":12,"./_object-dp":24,"./_property-desc":29}],20:[function(e,t,n){t.exports=!e("./_descriptors")&&!e("./_fails")(function(){return Object.defineProperty(e("./_dom-create")("div"),"a",{get:function(){return 7}}).a!=7})},{"./_descriptors":12,"./_dom-create":13,"./_fails":16}],21:[function(e,t,n){var r=e("./_cof");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return r(e)=="String"?e.split(""):Object(e)}},{"./_cof":8}],22:[function(e,t,n){t.exports=function(e){return typeof e==="object"?e!==null:typeof e==="function"}},{}],23:[function(e,t,n){"use strict";var r=e("./_object-keys"),o=e("./_object-gops"),i=e("./_object-pie"),c=e("./_to-object"),a=e("./_iobject"),u=Object.assign;t.exports=!u||e("./_fails")(function(){var e={},t={},n=Symbol(),r="abcdefghijklmnopqrst";e[n]=7;r.split("").forEach(function(e){t[e]=e});return u({},e)[n]!=7||Object.keys(u({},t)).join("")!=r})?function e(t,n){var u=c(t),f=arguments.length,s=1,l=o.f,p=i.f;while(f>s){var d=a(arguments[s++]),_=l?r(d).concat(l(d)):r(d),v=_.length,h=0,b;while(v>h)if(p.call(d,b=_[h++]))u[b]=d[b]}return u}:u},{"./_fails":16,"./_iobject":21,"./_object-gops":25,"./_object-keys":27,"./_object-pie":28,"./_to-object":36}],24:[function(e,t,n){var r=e("./_an-object"),o=e("./_ie8-dom-define"),i=e("./_to-primitive"),c=Object.defineProperty;n.f=e("./_descriptors")?Object.defineProperty:function e(t,n,a){r(t);n=i(n,true);r(a);if(o)try{return c(t,n,a)}catch(e){}if("get"in a||"set"in a)throw TypeError("Accessors not supported!");if("value"in a)t[n]=a.value;return t}},{"./_an-object":6,"./_descriptors":12,"./_ie8-dom-define":20,"./_to-primitive":37}],25:[function(e,t,n){n.f=Object.getOwnPropertySymbols},{}],26:[function(e,t,n){var r=e("./_has"),o=e("./_to-iobject"),i=e("./_array-includes")(false),c=e("./_shared-key")("IE_PROTO");t.exports=function(e,t){var n=o(e),a=0,u=[],f;for(f in n)if(f!=c)r(n,f)&&u.push(f);while(t.length>a)if(r(n,f=t[a++])){~i(u,f)||u.push(f)}return u}},{"./_array-includes":7,"./_has":18,"./_shared-key":30,"./_to-iobject":34}],27:[function(e,t,n){var r=e("./_object-keys-internal"),o=e("./_enum-bug-keys");t.exports=Object.keys||function e(t){return r(t,o)}},{"./_enum-bug-keys":14,"./_object-keys-internal":26}],28:[function(e,t,n){n.f={}.propertyIsEnumerable},{}],29:[function(e,t,n){t.exports=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}}},{}],30:[function(e,t,n){var r=e("./_shared")("keys"),o=e("./_uid");t.exports=function(e){return r[e]||(r[e]=o(e))}},{"./_shared":31,"./_uid":38}],31:[function(e,t,n){var r=e("./_global"),o="__core-js_shared__",i=r[o]||(r[o]={});t.exports=function(e){return i[e]||(i[e]={})}},{"./_global":17}],32:[function(e,t,n){var r=e("./_to-integer"),o=Math.max,i=Math.min;t.exports=function(e,t){e=r(e);return e<0?o(e+t,0):i(e,t)}},{"./_to-integer":33}],33:[function(e,t,n){var r=Math.ceil,o=Math.floor;t.exports=function(e){return isNaN(e=+e)?0:(e>0?o:r)(e)}},{}],34:[function(e,t,n){var r=e("./_iobject"),o=e("./_defined");t.exports=function(e){return r(o(e))}},{"./_defined":11,"./_iobject":21}],35:[function(e,t,n){var r=e("./_to-integer"),o=Math.min;t.exports=function(e){return e>0?o(r(e),9007199254740991):0}},{"./_to-integer":33}],36:[function(e,t,n){var r=e("./_defined");t.exports=function(e){return Object(r(e))}},{"./_defined":11}],37:[function(e,t,n){var r=e("./_is-object");t.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&typeof(n=e.toString)=="function"&&!r(o=n.call(e)))return o;if(typeof(n=e.valueOf)=="function"&&!r(o=n.call(e)))return o;if(!t&&typeof(n=e.toString)=="function"&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":22}],38:[function(e,t,n){var r=0,o=Math.random();t.exports=function(e){return"Symbol(".concat(e===undefined?"":e,")_",(++r+o).toString(36))}},{}],39:[function(e,t,n){var r=e("./_export");r(r.S+r.F,"Object",{assign:e("./_object-assign")})},{"./_export":15,"./_object-assign":23}]},{},[1])(1)}); 2 | -------------------------------------------------------------------------------- /assets/fonts/KaTeX_AMS-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_AMS-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_AMS-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_AMS-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_AMS-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_AMS-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_AMS-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_AMS-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Bold.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Bold.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Bold.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Caligraphic-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Caligraphic-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Bold.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Bold.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Bold.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Fraktur-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Fraktur-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Bold.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Bold.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Bold.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Italic.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Italic.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Italic.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Main-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Main-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-BoldItalic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-BoldItalic.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-BoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-BoldItalic.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-BoldItalic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-BoldItalic.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-BoldItalic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-BoldItalic.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Italic.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Italic.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Italic.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Math-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Math-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Bold.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Bold.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Bold.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Italic.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Italic.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Italic.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Italic.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Italic.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Italic.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Italic.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_SansSerif-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_SansSerif-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Script-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Script-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Script-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Script-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Script-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Script-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Script-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Script-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size1-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size1-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size1-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size1-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size1-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size1-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size1-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size1-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size2-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size2-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size2-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size2-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size2-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size2-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size2-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size2-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size3-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size3-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size3-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size3-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size3-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size3-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size3-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size3-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size4-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size4-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size4-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size4-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size4-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size4-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Size4-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Size4-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Typewriter-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Typewriter-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Typewriter-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Typewriter-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Typewriter-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Typewriter-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/KaTeX_Typewriter-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/assets/fonts/KaTeX_Typewriter-Regular.woff2 -------------------------------------------------------------------------------- /assets/github.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /assets/index.html.jinja: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{ title }} 6 | 7 | 8 | 9 | {% if use_katex %} 10 | 11 | 12 | 13 | {% endif %} 14 | 15 | 16 | 17 | 18 | 19 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /assets/katex.min.css: -------------------------------------------------------------------------------- 1 | @font-face{font-family:KaTeX_AMS;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Caligraphic;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Fraktur;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:KaTeX_Main;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype");font-weight:700;font-style:italic}@font-face{font-family:KaTeX_Math;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype");font-weight:700;font-style:normal}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype");font-weight:400;font-style:italic}@font-face{font-family:"KaTeX_SansSerif";src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Script;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size1;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size2;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size3;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Size4;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype");font-weight:400;font-style:normal}@font-face{font-family:KaTeX_Typewriter;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype");font-weight:400;font-style:normal}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important}.katex .katex-version:after{content:"0.11.1"}.katex .katex-mathml{position:absolute;clip:rect(1px,1px,1px,1px);padding:0;border:0;height:1px;width:1px;overflow:hidden}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathdefault{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-weight:700;font-style:italic}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;vertical-align:bottom;position:relative}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;vertical-align:bottom;font-size:1px;width:2px;min-width:2px}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .clap,.katex .llap,.katex .rlap{width:0;position:relative}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{display:inline-block;border:0 solid;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{display:inline-block;width:100%;border-bottom-style:solid}.katex .hdashline{display:inline-block;width:100%;border-bottom-style:dashed}.katex .sqrt>.root{margin-left:.27777778em;margin-right:-.55555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.83333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.16666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.66666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.45666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.14666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.71428571em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.85714286em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.14285714em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.28571429em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.42857143em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.71428571em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.05714286em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.46857143em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.96285714em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.55428571em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.55555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.66666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.77777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.88888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.11111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.33333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.30444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.76444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.41666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.58333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.66666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.83333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.72833333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.07333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.34722222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.41666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.48611111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.55555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.69444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.83333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.44027778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.72777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.28935185em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.34722222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.40509259em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.46296296em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.52083333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.69444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.83333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.20023148em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.43981481em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.24108004em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.28929605em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.33751205em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.38572806em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.43394407em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.48216008em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.57859209em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.69431051em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.83317261em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.19961427em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.20096463em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.24115756em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.28135048em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.32154341em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.36173633em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.40192926em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.48231511em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.57877814em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.69453376em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.83360129em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .op-limits>.vlist-t{text-align:center}.katex .accent>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{display:block;position:absolute;width:100%;height:inherit;fill:currentColor;stroke:currentColor;fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex svg path{stroke:none}.katex img{border-style:none;min-width:0;min-height:0;max-width:none;max-height:none}.katex .stretchy{width:100%;display:block;position:relative;overflow:hidden}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{width:100%;position:relative;overflow:hidden}.katex .halfarrow-left{position:absolute;left:0;width:50.2%;overflow:hidden}.katex .halfarrow-right{position:absolute;right:0;width:50.2%;overflow:hidden}.katex .brace-left{position:absolute;left:0;width:25.1%;overflow:hidden}.katex .brace-center{position:absolute;left:25%;width:50%;overflow:hidden}.katex .brace-right{position:absolute;right:0;width:25.1%;overflow:hidden}.katex .x-arrow-pad{padding:0 .5em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{box-sizing:border-box;border:.04em solid}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{text-align:left} 2 | -------------------------------------------------------------------------------- /assets/requirements-slides.txt: -------------------------------------------------------------------------------- 1 | certifi 2 | Jinja2 3 | livereload 4 | MarkupSafe 5 | six 6 | tornado 7 | -------------------------------------------------------------------------------- /assets/style.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-family: Helvetica, sans-serif; 3 | color: #354046; 4 | line-height: 1.4; 5 | font-size: 16pt; 6 | word-wrap: break-word; 7 | } 8 | 9 | 10 | /* Remark ------------------------------------------------------------------- */ 11 | 12 | .remark-container { 13 | background: #ddd; 14 | } 15 | 16 | .remark-slide-content { 17 | font-size: 1em; 18 | border-top: solid 5px #520b92; 19 | padding-top: 0.5em; 20 | vertical-align: middle; 21 | } 22 | 23 | .remark-slide-content h1 { 24 | font-weight: bold; 25 | font-size: 1.9em; 26 | margin: 0.25em 0; 27 | color: #520b92; 28 | } 29 | 30 | .remark-slide-content h2 { 31 | font-size: 1.5em; 32 | font-weight: bold; 33 | margin: 0.25em 0; 34 | } 35 | 36 | .remark-slide-content h3 { 37 | font-size: 1.2em; 38 | font-weight: bold; 39 | margin: 0.25em 0; 40 | } 41 | 42 | .remark-slide-content p, 43 | .remark-slide-content ul, 44 | .remark-slide-content ol { 45 | font-size: 1.2em; 46 | margin: 0.5em 0; 47 | } 48 | 49 | .remark-slide-number { 50 | font-size: 0.5em; 51 | bottom: 2em; 52 | } 53 | 54 | /* Styles ------------------------------------------------------------------- */ 55 | 56 | a { 57 | color: #008000; 58 | text-decoration: none; 59 | } 60 | 61 | a:hover { 62 | text-decoration: underline; 63 | } 64 | 65 | .italic { 66 | font-style: italic; 67 | } 68 | 69 | .bold { 70 | font-weight: bold; 71 | } 72 | 73 | em { 74 | font-style: italic; 75 | } 76 | 77 | strong { 78 | font-style: normal; 79 | font-weight: bold; 80 | } 81 | 82 | pre { 83 | margin: 0.2em; 84 | } 85 | 86 | .larger { 87 | font-size: 1.3em; 88 | } 89 | 90 | .smaller { 91 | font-size: 0.8em; 92 | } 93 | 94 | .smaller-x { 95 | font-size: 0.5em; 96 | } 97 | 98 | .katex { 99 | color: black; 100 | } 101 | 102 | .black-slide .katex, 103 | .black-slide h1, 104 | .black-slide a { 105 | color: white; 106 | } 107 | 108 | ul>li, 109 | ol>li { 110 | margin: 0.3em 0; 111 | } 112 | 113 | li>p { 114 | margin: 0.2em 0; 115 | } 116 | 117 | ul>li>ul>li { 118 | font-size: 0.8em; 119 | } 120 | 121 | .caption { 122 | display: block; 123 | text-align: center; 124 | font-size: 0.8em; 125 | font-style: italic; 126 | } 127 | 128 | img { 129 | max-width: 100%; 130 | } 131 | 132 | .circle img { 133 | border-radius: 50%; 134 | } 135 | 136 | .footnote { 137 | position: absolute; 138 | bottom: 0.5em; 139 | font-size: 0.8em; 140 | opacity: 0.9; 141 | left: 1.5em; 142 | } 143 | 144 | .footnote a { 145 | color: #0288d1; 146 | /*#20707e;*/ 147 | } 148 | 149 | .footnote-back { 150 | position: absolute; 151 | bottom: 0.5em; 152 | font-size: 0.7em; 153 | opacity: 0.9; 154 | right: 1.5em; 155 | } 156 | 157 | .inactive { 158 | color: lightgray; 159 | } 160 | 161 | .success { 162 | background-color: rgba(40, 167, 69, 0.25); 163 | border: 2px solid rgb(40, 167, 69); 164 | border-radius: 5px; 165 | width: 95%; 166 | display: block; 167 | padding: 1em; 168 | } 169 | 170 | .alert { 171 | color: #721c24; 172 | background-color: #f8d7da; 173 | border: 2px solid #f5c6cb; 174 | border-radius: 5px; 175 | width: 95%; 176 | display: block; 177 | padding: 1em; 178 | } 179 | 180 | .hljs-github .hljs-comment { 181 | color: #520b92; 182 | } 183 | 184 | 185 | /* Specials ----------------------------------------------------------------- */ 186 | 187 | .title-slide { 188 | font-size: 1.1em; 189 | text-align: center; 190 | vertical-align: middle; 191 | } 192 | 193 | .title-slide h1 { 194 | margin-top: 1em; 195 | } 196 | 197 | .chapter-slide { 198 | background-color: #520b92; 199 | color: white; 200 | vertical-align: middle; 201 | font-size: 1.2em; 202 | text-align: center; 203 | } 204 | 205 | .chapter-slide h1, 206 | .chapter-slide a { 207 | color: white; 208 | } 209 | 210 | .black-slide { 211 | background-color: black; 212 | color: white; 213 | border-top: solid 0px; 214 | } 215 | 216 | .red-slide { 217 | background-color: red; 218 | color: white; 219 | border-top: solid 0px; 220 | } 221 | 222 | .this-talk-link { 223 | font-size: 0.8em; 224 | display: block; 225 | font-style: italic; 226 | margin-top: 1em; 227 | } 228 | 229 | 230 | blockquote { 231 | font-size: 1.4em; 232 | width: 75%; 233 | margin: 0 auto; 234 | font-style: italic; 235 | color: #555555; 236 | padding: 1.2em 30px 1.2em 75px; 237 | border-left: 8px solid #008000; 238 | line-height: 1.6; 239 | position: relative; 240 | background: #EDEDED; 241 | } 242 | 243 | 244 | blockquote::before { 245 | font-family: Arial; 246 | content: "\201C"; 247 | color: #008000; 248 | font-size: 4em; 249 | position: absolute; 250 | left: 0; 251 | top: -10px; 252 | } 253 | 254 | blockquote::after { 255 | content: ''; 256 | } 257 | 258 | blockquote cite { 259 | display: block; 260 | color: #333333; 261 | font-style: normal; 262 | font-weight: bold; 263 | margin-top: 1em; 264 | } 265 | 266 | .icon { 267 | background-size: cover; 268 | display: inline-block; 269 | transform: scale(1.5); 270 | margin-top: 12px; 271 | height: 24px; 272 | width: 25px; 273 | } 274 | 275 | .icon-left { 276 | margin-right: 16px; 277 | } 278 | 279 | .icon-twitter { 280 | background: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E %3Cg transform='matrix(0.995894,0,0,0.995894,0.0514823,0.156485)'%3E %3Cpath d='M24,4.557C23.117,4.949 22.168,5.213 21.172,5.332C22.189,4.723 22.97,3.758 23.337,2.608C22.386,3.172 21.332,3.582 20.21,3.803C19.313,2.846 18.032,2.248 16.616,2.248C13.437,2.248 11.101,5.214 11.819,8.293C7.728,8.088 4.1,6.128 1.671,3.149C0.381,5.362 1.002,8.257 3.194,9.723C2.388,9.697 1.628,9.476 0.965,9.107C0.911,11.388 2.546,13.522 4.914,13.997C4.221,14.185 3.462,14.229 2.69,14.081C3.316,16.037 5.134,17.46 7.29,17.5C5.22,19.123 2.612,19.848 0,19.54C2.179,20.937 4.768,21.752 7.548,21.752C16.69,21.752 21.855,14.031 21.543,7.106C22.505,6.411 23.34,5.544 24,4.557Z' style='fill-rule:nonzero;'/%3E %3C/g%3E %3C/svg%3E ") no-repeat; 281 | } 282 | 283 | .icon-twitter-white { 284 | background: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E %3Cg transform='matrix(0.995894,0,0,0.995894,0.0514823,0.156485)'%3E %3Cpath d='M24,4.557C23.117,4.949 22.168,5.213 21.172,5.332C22.189,4.723 22.97,3.758 23.337,2.608C22.386,3.172 21.332,3.582 20.21,3.803C19.313,2.846 18.032,2.248 16.616,2.248C13.437,2.248 11.101,5.214 11.819,8.293C7.728,8.088 4.1,6.128 1.671,3.149C0.381,5.362 1.002,8.257 3.194,9.723C2.388,9.697 1.628,9.476 0.965,9.107C0.911,11.388 2.546,13.522 4.914,13.997C4.221,14.185 3.462,14.229 2.69,14.081C3.316,16.037 5.134,17.46 7.29,17.5C5.22,19.123 2.612,19.848 0,19.54C2.179,20.937 4.768,21.752 7.548,21.752C16.69,21.752 21.855,14.031 21.543,7.106C22.505,6.411 23.34,5.544 24,4.557Z' style='fill:white;fill-rule:nonzero;'/%3E %3C/g%3E %3C/svg%3E ") no-repeat; 285 | 286 | } 287 | 288 | .icon-github-white { 289 | background: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 25 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E %3Cg transform='matrix(1,0,0,1,0.0503063,0.209536)'%3E %3Cpath d='M12,0C5.374,0 0,5.373 0,12C0,17.302 3.438,21.8 8.207,23.387C8.806,23.498 9,23.126 9,22.81L9,20.576C5.662,21.302 4.967,19.16 4.967,19.16C4.421,17.773 3.634,17.404 3.634,17.404C2.545,16.659 3.717,16.675 3.717,16.675C4.922,16.759 5.556,17.912 5.556,17.912C6.626,19.746 8.363,19.216 9.048,18.909C9.155,18.134 9.466,17.604 9.81,17.305C7.145,17 4.343,15.971 4.343,11.374C4.343,10.063 4.812,8.993 5.579,8.153C5.455,7.85 5.044,6.629 5.696,4.977C5.696,4.977 6.704,4.655 8.997,6.207C9.954,5.941 10.98,5.808 12,5.803C13.02,5.808 14.047,5.941 15.006,6.207C17.297,4.655 18.303,4.977 18.303,4.977C18.956,6.63 18.545,7.851 18.421,8.153C19.191,8.993 19.656,10.064 19.656,11.374C19.656,15.983 16.849,16.998 14.177,17.295C14.607,17.667 15,18.397 15,19.517L15,22.81C15,23.129 15.192,23.504 15.801,23.386C20.566,21.797 24,17.3 24,12C24,5.373 18.627,0 12,0Z' style='fill:white;fill-rule:nonzero;'/%3E %3C/g%3E %3C/svg%3E ") no-repeat; 290 | } 291 | 292 | .icon-github { 293 | background: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 25 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E %3Cg transform='matrix(1,0,0,1,0.0191268,0.228032)'%3E %3Cpath d='M12,0C5.374,0 0,5.373 0,12C0,17.302 3.438,21.8 8.207,23.387C8.806,23.498 9,23.126 9,22.81L9,20.576C5.662,21.302 4.967,19.16 4.967,19.16C4.421,17.773 3.634,17.404 3.634,17.404C2.545,16.659 3.717,16.675 3.717,16.675C4.922,16.759 5.556,17.912 5.556,17.912C6.626,19.746 8.363,19.216 9.048,18.909C9.155,18.134 9.466,17.604 9.81,17.305C7.145,17 4.343,15.971 4.343,11.374C4.343,10.063 4.812,8.993 5.579,8.153C5.455,7.85 5.044,6.629 5.696,4.977C5.696,4.977 6.704,4.655 8.997,6.207C9.954,5.941 10.98,5.808 12,5.803C13.02,5.808 14.047,5.941 15.006,6.207C17.297,4.655 18.303,4.977 18.303,4.977C18.956,6.63 18.545,7.851 18.421,8.153C19.191,8.993 19.656,10.064 19.656,11.374C19.656,15.983 16.849,16.998 14.177,17.295C14.607,17.667 15,18.397 15,19.517L15,22.81C15,23.129 15.192,23.504 15.801,23.386C20.566,21.797 24,17.3 24,12C24,5.373 18.627,0 12,0Z' style='fill-rule:nonzero;'/%3E %3C/g%3E %3C/svg%3E ") no-repeat; 294 | } 295 | 296 | .icon-github:hover, 297 | .icon-github-white:hover { 298 | background: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 25 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E %3Cg transform='matrix(1,0,0,1,0.0503063,0.209536)'%3E %3Cpath d='M12,0C5.374,0 0,5.373 0,12C0,17.302 3.438,21.8 8.207,23.387C8.806,23.498 9,23.126 9,22.81L9,20.576C5.662,21.302 4.967,19.16 4.967,19.16C4.421,17.773 3.634,17.404 3.634,17.404C2.545,16.659 3.717,16.675 3.717,16.675C4.922,16.759 5.556,17.912 5.556,17.912C6.626,19.746 8.363,19.216 9.048,18.909C9.155,18.134 9.466,17.604 9.81,17.305C7.145,17 4.343,15.971 4.343,11.374C4.343,10.063 4.812,8.993 5.579,8.153C5.455,7.85 5.044,6.629 5.696,4.977C5.696,4.977 6.704,4.655 8.997,6.207C9.954,5.941 10.98,5.808 12,5.803C13.02,5.808 14.047,5.941 15.006,6.207C17.297,4.655 18.303,4.977 18.303,4.977C18.956,6.63 18.545,7.851 18.421,8.153C19.191,8.993 19.656,10.064 19.656,11.374C19.656,15.983 16.849,16.998 14.177,17.295C14.607,17.667 15,18.397 15,19.517L15,22.81C15,23.129 15.192,23.504 15.801,23.386C20.566,21.797 24,17.3 24,12C24,5.373 18.627,0 12,0Z' style='fill:rgb(0,128,0);fill-rule:nonzero;'/%3E %3C/g%3E %3C/svg%3E ") no-repeat; 299 | } 300 | 301 | .icon-twitter:hover, 302 | .icon-twitter-white:hover { 303 | background: url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 24 24' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E %3Cg transform='matrix(0.995894,0,0,0.995894,0.0514823,0.156485)'%3E %3Cpath d='M24,4.557C23.117,4.949 22.168,5.213 21.172,5.332C22.189,4.723 22.97,3.758 23.337,2.608C22.386,3.172 21.332,3.582 20.21,3.803C19.313,2.846 18.032,2.248 16.616,2.248C13.437,2.248 11.101,5.214 11.819,8.293C7.728,8.088 4.1,6.128 1.671,3.149C0.381,5.362 1.002,8.257 3.194,9.723C2.388,9.697 1.628,9.476 0.965,9.107C0.911,11.388 2.546,13.522 4.914,13.997C4.221,14.185 3.462,14.229 2.69,14.081C3.316,16.037 5.134,17.46 7.29,17.5C5.22,19.123 2.612,19.848 0,19.54C2.179,20.937 4.768,21.752 7.548,21.752C16.69,21.752 21.855,14.031 21.543,7.106C22.505,6.411 23.34,5.544 24,4.557Z' style='fill:rgb(0,128,0);fill-rule:nonzero;'/%3E %3C/g%3E %3C/svg%3E ") no-repeat; 304 | 305 | } 306 | 307 | .remark-slide table { 308 | border: none; 309 | border-collapse: collapse; 310 | border-spacing: 0; 311 | color: black; 312 | table-layout: fixed; 313 | } 314 | 315 | .remark-slide table thead { 316 | border-bottom: 1px solid black; 317 | vertical-align: bottom; 318 | } 319 | 320 | .remark-slide table tr, 321 | .remark-slide table th, 322 | .remark-slide table td { 323 | text-align: right; 324 | vertical-align: middle; 325 | padding: 0.5em 0.5em; 326 | line-height: normal; 327 | white-space: normal; 328 | max-width: none; 329 | border: none; 330 | } 331 | 332 | .remark-slide table th { 333 | font-weight: bold; 334 | } 335 | 336 | .remark-slide table tbody tr:nth-child(odd) { 337 | background: #f5f5f5; 338 | } 339 | 340 | .remark-slide table tbody tr:hover { 341 | background: rgba(66, 165, 245, 0.2); 342 | } 343 | 344 | .remark-slide table.alternationg { 345 | border: none; 346 | border-collapse: collapse; 347 | border-spacing: 0; 348 | } 349 | 350 | .remark-slide table.alternating td, 351 | .remark-slide table.alternating tr { 352 | border: none; 353 | } 354 | 355 | .remark-slide table.alternating tbody tr:nth-child(odd) { 356 | background: #f0f0f0; 357 | } 358 | 359 | /* grid */ 360 | 361 | /* Uncomment and set these variables to customize the grid. */ 362 | 363 | .g { 364 | box-sizing: border-box; 365 | display: -ms-flexbox; 366 | display: -webkit-box; 367 | display: flex; 368 | -ms-flex: 0 1 auto; 369 | -webkit-box-flex: 0; 370 | flex: 0 1 auto; 371 | -ms-flex-direction: row; 372 | -webkit-box-orient: horizontal; 373 | -webkit-box-direction: normal; 374 | flex-direction: row; 375 | -ms-flex-wrap: wrap; 376 | flex-wrap: wrap; 377 | margin: 0.5rem -0.5rem; 378 | } 379 | 380 | .g-1 .g-2, 381 | .g-3, 382 | .g-4, 383 | .g-5, 384 | .g-6, 385 | .g-7, 386 | .g-8, 387 | .g-9, 388 | .g-10, 389 | .g-11, 390 | .g-12 { 391 | box-sizing: border-box; 392 | -ms-flex: 0 0 auto; 393 | -webkit-box-flex: 0; 394 | flex: 0 0 auto; 395 | padding-right: 1rem; 396 | padding-left: 1rem; 397 | } 398 | 399 | .g-1 { 400 | -ms-flex-preferred-size: 8.333%; 401 | flex-basis: 8.333%; 402 | max-width: 8.333%; 403 | } 404 | 405 | .g-2 { 406 | -ms-flex-preferred-size: 16.667%; 407 | flex-basis: 16.667%; 408 | max-width: 16.667%; 409 | } 410 | 411 | .g-3 { 412 | -ms-flex-preferred-size: 25%; 413 | flex-basis: 25%; 414 | max-width: 25%; 415 | } 416 | 417 | .g-4 { 418 | -ms-flex-preferred-size: 33.333%; 419 | flex-basis: 33.333%; 420 | max-width: 33.333%; 421 | } 422 | 423 | .g-5 { 424 | -ms-flex-preferred-size: 41.667%; 425 | flex-basis: 41.667%; 426 | max-width: 41.667%; 427 | } 428 | 429 | .g-6 { 430 | -ms-flex-preferred-size: 50%; 431 | flex-basis: 50%; 432 | max-width: 50%; 433 | } 434 | 435 | .g-7 { 436 | -ms-flex-preferred-size: 58.333%; 437 | flex-basis: 58.333%; 438 | max-width: 58.333%; 439 | } 440 | 441 | .g-8 { 442 | -ms-flex-preferred-size: 66.667%; 443 | flex-basis: 66.667%; 444 | max-width: 66.667%; 445 | } 446 | 447 | .g-9 { 448 | -ms-flex-preferred-size: 75%; 449 | flex-basis: 75%; 450 | max-width: 75%; 451 | } 452 | 453 | .g-10 { 454 | -ms-flex-preferred-size: 83.333%; 455 | flex-basis: 83.333%; 456 | max-width: 83.333%; 457 | } 458 | 459 | .g-11 { 460 | -ms-flex-preferred-size: 91.667%; 461 | flex-basis: 91.667%; 462 | max-width: 91.667%; 463 | } 464 | 465 | .g-12 { 466 | -ms-flex-preferred-size: 100%; 467 | flex-basis: 100%; 468 | max-width: 100%; 469 | } 470 | 471 | .g-start { 472 | -ms-flex-pack: start; 473 | -webkit-box-pack: start; 474 | justify-content: flex-start; 475 | text-align: start; 476 | } 477 | 478 | .g-center { 479 | -ms-flex-pack: center; 480 | -webkit-box-pack: center; 481 | justify-content: center; 482 | text-align: center; 483 | } 484 | 485 | .g-end { 486 | -ms-flex-pack: end; 487 | -webkit-box-pack: end; 488 | justify-content: flex-end; 489 | text-align: end; 490 | } 491 | 492 | .g-top { 493 | -ms-flex-align: start; 494 | -webkit-box-align: start; 495 | align-items: flex-start; 496 | } 497 | 498 | .g-middle { 499 | -ms-flex-align: center; 500 | -webkit-box-align: center; 501 | align-items: center; 502 | } 503 | 504 | .g-bottom { 505 | -ms-flex-align: end; 506 | -webkit-box-align: end; 507 | align-items: flex-end; 508 | } 509 | 510 | .g-around { 511 | -ms-flex-pack: distribute; 512 | justify-content: space-around; 513 | } 514 | 515 | .g-between { 516 | -ms-flex-pack: justify; 517 | -webkit-box-pack: justify; 518 | justify-content: space-between; 519 | } 520 | -------------------------------------------------------------------------------- /assets/twitter.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: ml-workshop-intro 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.9.7 6 | - scikit-learn=1.0.* 7 | - seaborn=0.11.2 8 | - pandas 9 | - jupyterlab=3.1.* 10 | -------------------------------------------------------------------------------- /images/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/.gitkeep -------------------------------------------------------------------------------- /images/amazon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/amazon.png -------------------------------------------------------------------------------- /images/blood_quality.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/blood_quality.png -------------------------------------------------------------------------------- /images/clustering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/clustering.png -------------------------------------------------------------------------------- /images/dota.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/dota.png -------------------------------------------------------------------------------- /images/favicon_org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/favicon_org.png -------------------------------------------------------------------------------- /images/higgs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/higgs.png -------------------------------------------------------------------------------- /images/pipeline.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 |
pipe = make_pipeline(T1(), T2(), Estimator())
pipe.fit(X, y)
pipe = make_pipeline(T1(), T2(), Estimator())...
T1
T1
T2
T2
Estimator
Estimator
T1.fit(X, y)
T1.fit(X, y)
T1.transform(X)
T1.transform(X)
X
X
y
y
T2.fit(X1, y)
T2.fit(X1, y)
T2.transform(X1)
T2.transform(X1)
X1
X1
Estimator.fit(X2, y)
Estimator.fit(X2, y)
X2
X2
pipe.predict(X')
pipe.predict(X')
T1.transform(X')
T1.transform(X')
X'
X'
T2.transform(X'1)
T2.transform(X'1)
X'1
X'1
Estimator.predict(X'2)
Estimator.predict(X'2)
X'2
X'2
y'
y'
Viewer does not support full SVG 1.1
-------------------------------------------------------------------------------- /images/reinforcement.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 |
State
State
Environment
Environment
Agent
Agent
Reward
Reward
Action
Action
Viewer does not support full SVG 1.1
-------------------------------------------------------------------------------- /images/scikit-learn-logo-notext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/images/scikit-learn-logo-notext.png -------------------------------------------------------------------------------- /images/traditional-programming.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 |
Data
Data
Handcrafted Program
Handcrafted Progr...
Computer
Computer
Action
Action
Viewer does not support full SVG 1.1
-------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Introduction to scikit-learn: Machine Learning in Python 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 463 | 464 | 491 | 492 | 493 | -------------------------------------------------------------------------------- /maint_tools/check_notebooks.sh: -------------------------------------------------------------------------------- 1 | set -e 2 | 3 | for f in notebooks/0*.ipynb; do 4 | jupyter nbconvert --execute $f --to notebook --stdout >/dev/null 5 | done 6 | -------------------------------------------------------------------------------- /make.py: -------------------------------------------------------------------------------- 1 | import argparse 2 | from jinja2 import Template 3 | from livereload import Server 4 | from pathlib import Path 5 | 6 | 7 | def build(): 8 | print("building index.html") 9 | 10 | assets = Path("assets") 11 | 12 | with (assets / "index.html.jinja").open("r") as f: 13 | template = Template(f.read()) 14 | 15 | with open("slides.md", "r") as f: 16 | slides = f.readlines() 17 | 18 | # get metadata up to the first title 19 | valid_metadata_keys = set(["title", "use_katex"]) 20 | metadata = {} 21 | for line in slides: 22 | 23 | # first title 24 | if line.startswith("#") or len(metadata) == len(valid_metadata_keys): 25 | break 26 | line_split = line.split(":", maxsplit=1) 27 | if len(line_split) != 2: 28 | continue 29 | 30 | key = line_split[0] 31 | if key not in valid_metadata_keys: 32 | continue 33 | 34 | value = line_split[1].strip() 35 | metadata[key] = value 36 | 37 | if len(metadata) != 2: 38 | raise ValueError( 39 | "Be sure to include title: and use_katex as metadata " "in slides.md file" 40 | ) 41 | 42 | output = template.render( 43 | title=metadata["title"], 44 | use_katex=metadata["use_katex"] == "True", 45 | slides="".join(slides), 46 | ) 47 | 48 | with open("index.html", "w") as f: 49 | f.write(output) 50 | 51 | 52 | def live(): 53 | print("Serving index.html") 54 | cur_dir = Path(".") 55 | 56 | server = Server() 57 | server.watch("slides.md", build) 58 | server.watch(str(cur_dir / "assets" / "style.css")) 59 | server.serve(open_url_delay=2) 60 | 61 | 62 | if __name__ == "__main__": 63 | parser = argparse.ArgumentParser(description="Building slides") 64 | parser.add_argument("action", choices=["build", "live"]) 65 | 66 | args = parser.parse_args() 67 | 68 | if args.action == "build": 69 | build() 70 | else: 71 | live() 72 | -------------------------------------------------------------------------------- /notebooks/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/e09eab489b9e15f84cc7e55adf86f62278f86be0/notebooks/.gitkeep -------------------------------------------------------------------------------- /notebooks/01-loading-data.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "tags": [] 7 | }, 8 | "source": [ 9 | "# Loading data into machine learning\n", 10 | "\n", 11 | "In this notebook, we will review how to load data before any machine learning takes place.\n", 12 | "\n", 13 | "\"Open" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": null, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "# Install dependencies for google colab\n", 23 | "import sys\n", 24 | "IN_COLAB = 'google.colab' in sys.modules\n", 25 | "if IN_COLAB:\n", 26 | " %pip install -r https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/master/requirements.txt" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": null, 32 | "metadata": {}, 33 | "outputs": [], 34 | "source": [ 35 | "import sklearn\n", 36 | "assert sklearn.__version__.startswith(\"1.0\"), \"Plese install scikit-learn 1.0\"" 37 | ] 38 | }, 39 | { 40 | "cell_type": "markdown", 41 | "metadata": {}, 42 | "source": [ 43 | "## Generated datasets" 44 | ] 45 | }, 46 | { 47 | "cell_type": "markdown", 48 | "metadata": {}, 49 | "source": [ 50 | "## Regression" 51 | ] 52 | }, 53 | { 54 | "cell_type": "code", 55 | "execution_count": null, 56 | "metadata": {}, 57 | "outputs": [], 58 | "source": [ 59 | "from sklearn.datasets import make_regression\n", 60 | "\n", 61 | "X, y = make_regression()" 62 | ] 63 | }, 64 | { 65 | "cell_type": "code", 66 | "execution_count": null, 67 | "metadata": {}, 68 | "outputs": [], 69 | "source": [ 70 | "X" 71 | ] 72 | }, 73 | { 74 | "cell_type": "code", 75 | "execution_count": null, 76 | "metadata": {}, 77 | "outputs": [], 78 | "source": [ 79 | "y" 80 | ] 81 | }, 82 | { 83 | "cell_type": "markdown", 84 | "metadata": {}, 85 | "source": [ 86 | "## Classification" 87 | ] 88 | }, 89 | { 90 | "cell_type": "code", 91 | "execution_count": null, 92 | "metadata": {}, 93 | "outputs": [], 94 | "source": [ 95 | "from sklearn.datasets import make_classification\n", 96 | "\n", 97 | "X, y = make_classification()" 98 | ] 99 | }, 100 | { 101 | "cell_type": "code", 102 | "execution_count": null, 103 | "metadata": {}, 104 | "outputs": [], 105 | "source": [ 106 | "X" 107 | ] 108 | }, 109 | { 110 | "cell_type": "code", 111 | "execution_count": null, 112 | "metadata": {}, 113 | "outputs": [], 114 | "source": [ 115 | "y" 116 | ] 117 | }, 118 | { 119 | "cell_type": "markdown", 120 | "metadata": {}, 121 | "source": [ 122 | "## Sample Datasets" 123 | ] 124 | }, 125 | { 126 | "cell_type": "code", 127 | "execution_count": null, 128 | "metadata": {}, 129 | "outputs": [], 130 | "source": [ 131 | "from sklearn.datasets import fetch_openml" 132 | ] 133 | }, 134 | { 135 | "cell_type": "code", 136 | "execution_count": null, 137 | "metadata": {}, 138 | "outputs": [], 139 | "source": [ 140 | "iris = fetch_openml(data_id=61, as_frame=True)" 141 | ] 142 | }, 143 | { 144 | "cell_type": "code", 145 | "execution_count": null, 146 | "metadata": {}, 147 | "outputs": [], 148 | "source": [ 149 | "print(iris.DESCR)" 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": null, 155 | "metadata": {}, 156 | "outputs": [], 157 | "source": [ 158 | "X = iris.data\n", 159 | "X" 160 | ] 161 | }, 162 | { 163 | "cell_type": "code", 164 | "execution_count": null, 165 | "metadata": {}, 166 | "outputs": [], 167 | "source": [ 168 | "y = iris.target\n", 169 | "y" 170 | ] 171 | }, 172 | { 173 | "cell_type": "code", 174 | "execution_count": null, 175 | "metadata": {}, 176 | "outputs": [], 177 | "source": [ 178 | "import matplotlib.pyplot as plt\n", 179 | "plt.scatter(X['sepallength'], X['sepalwidth'], c=y.cat.codes)" 180 | ] 181 | }, 182 | { 183 | "cell_type": "code", 184 | "execution_count": null, 185 | "metadata": {}, 186 | "outputs": [], 187 | "source": [ 188 | "iris_df = iris.frame" 189 | ] 190 | }, 191 | { 192 | "cell_type": "code", 193 | "execution_count": null, 194 | "metadata": {}, 195 | "outputs": [], 196 | "source": [ 197 | "iris_df.head()" 198 | ] 199 | }, 200 | { 201 | "cell_type": "code", 202 | "execution_count": null, 203 | "metadata": {}, 204 | "outputs": [], 205 | "source": [ 206 | "import seaborn as sns\n", 207 | "sns.set_theme(font_scale=1.5)" 208 | ] 209 | }, 210 | { 211 | "cell_type": "code", 212 | "execution_count": null, 213 | "metadata": {}, 214 | "outputs": [], 215 | "source": [ 216 | "iris_df.columns" 217 | ] 218 | }, 219 | { 220 | "cell_type": "code", 221 | "execution_count": null, 222 | "metadata": {}, 223 | "outputs": [], 224 | "source": [ 225 | "sns.relplot(data=iris_df, x='sepallength', y='sepalwidth',\n", 226 | " hue='class', height=6);" 227 | ] 228 | }, 229 | { 230 | "cell_type": "code", 231 | "execution_count": null, 232 | "metadata": {}, 233 | "outputs": [], 234 | "source": [ 235 | "sns.displot(data=iris_df, x='sepallength', hue='class', kind='kde', aspect=2);" 236 | ] 237 | }, 238 | { 239 | "cell_type": "code", 240 | "execution_count": null, 241 | "metadata": {}, 242 | "outputs": [], 243 | "source": [ 244 | "sns.jointplot(data=iris_df, x=\"sepallength\", y=\"sepalwidth\", height=8, hue='class');" 245 | ] 246 | }, 247 | { 248 | "cell_type": "markdown", 249 | "metadata": {}, 250 | "source": [ 251 | "# Exercise 1\n", 252 | "\n", 253 | "1. Load the wine dataset from the `sklearn.datasets` module using the `load_wine` function and with `as_frame=True`.\n", 254 | "2. Print the description of the dataset.\n", 255 | "3. What is the number of samples and features in this dataset?\n", 256 | "4. Is this a classifiation of a regression problem? Hint: The target column is called `target`.\n", 257 | "5. Use `sns.jointplot` to explore the relationship between the `proline` and `flavanoids` features. (Be sure to set `hue` to the target name)" 258 | ] 259 | }, 260 | { 261 | "cell_type": "code", 262 | "execution_count": null, 263 | "metadata": {}, 264 | "outputs": [], 265 | "source": [ 266 | "from sklearn.datasets import load_wine" 267 | ] 268 | }, 269 | { 270 | "cell_type": "code", 271 | "execution_count": null, 272 | "metadata": {}, 273 | "outputs": [], 274 | "source": [] 275 | }, 276 | { 277 | "cell_type": "markdown", 278 | "metadata": {}, 279 | "source": [ 280 | "**If you are running locally**, you can uncomment the following cell to load the solution into the cell. On **Google Colab**, [see solution here](https://github.com/thomasjpfan/ml-workshop-intro/blob/master/notebooks/solutions/01-ex1-solution.py). " 281 | ] 282 | }, 283 | { 284 | "cell_type": "code", 285 | "execution_count": null, 286 | "metadata": {}, 287 | "outputs": [], 288 | "source": [ 289 | "# %load solutions/01-ex1-solution.py" 290 | ] 291 | } 292 | ], 293 | "metadata": { 294 | "kernelspec": { 295 | "display_name": "Python 3 (ipykernel)", 296 | "language": "python", 297 | "name": "python3" 298 | }, 299 | "language_info": { 300 | "codemirror_mode": { 301 | "name": "ipython", 302 | "version": 3 303 | }, 304 | "file_extension": ".py", 305 | "mimetype": "text/x-python", 306 | "name": "python", 307 | "nbconvert_exporter": "python", 308 | "pygments_lexer": "ipython3", 309 | "version": "3.9.7" 310 | } 311 | }, 312 | "nbformat": 4, 313 | "nbformat_minor": 4 314 | } 315 | -------------------------------------------------------------------------------- /notebooks/02-supervised-learning.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": { 6 | "tags": [] 7 | }, 8 | "source": [ 9 | "# Supervised learning with scikit-learn\n", 10 | "\n", 11 | "In this notebook, we review scikit-learn's API for training a model.\n", 12 | "\n", 13 | "\"Open" 14 | ] 15 | }, 16 | { 17 | "cell_type": "code", 18 | "execution_count": null, 19 | "metadata": {}, 20 | "outputs": [], 21 | "source": [ 22 | "# Install dependencies for google colab\n", 23 | "import sys\n", 24 | "IN_COLAB = 'google.colab' in sys.modules\n", 25 | "if IN_COLAB:\n", 26 | " %pip install -r https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/master/requirements.txt" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": null, 32 | "metadata": {}, 33 | "outputs": [], 34 | "source": [ 35 | "import sklearn\n", 36 | "assert sklearn.__version__.startswith(\"1.0\"), \"Plese install scikit-learn 1.0\"" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "from sklearn.datasets import fetch_openml\n", 46 | "\n", 47 | "blood = fetch_openml('blood-transfusion-service-center', as_frame=True)" 48 | ] 49 | }, 50 | { 51 | "cell_type": "code", 52 | "execution_count": null, 53 | "metadata": {}, 54 | "outputs": [], 55 | "source": [ 56 | "blood.frame.head()" 57 | ] 58 | }, 59 | { 60 | "cell_type": "code", 61 | "execution_count": null, 62 | "metadata": {}, 63 | "outputs": [], 64 | "source": [ 65 | "X, y = blood.data, blood.target" 66 | ] 67 | }, 68 | { 69 | "cell_type": "code", 70 | "execution_count": null, 71 | "metadata": {}, 72 | "outputs": [], 73 | "source": [ 74 | "X.head()" 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": null, 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "y.head()" 84 | ] 85 | }, 86 | { 87 | "cell_type": "code", 88 | "execution_count": null, 89 | "metadata": {}, 90 | "outputs": [], 91 | "source": [ 92 | "y.value_counts(normalize=True)" 93 | ] 94 | }, 95 | { 96 | "cell_type": "markdown", 97 | "metadata": {}, 98 | "source": [ 99 | "## Split Data" 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "metadata": {}, 106 | "outputs": [], 107 | "source": [ 108 | "from sklearn.model_selection import train_test_split\n", 109 | "\n", 110 | "X_train, X_test, y_train, y_test = train_test_split(\n", 111 | " X, y, random_state=0\n", 112 | ")" 113 | ] 114 | }, 115 | { 116 | "cell_type": "code", 117 | "execution_count": null, 118 | "metadata": {}, 119 | "outputs": [], 120 | "source": [ 121 | "X_train.head()" 122 | ] 123 | }, 124 | { 125 | "cell_type": "code", 126 | "execution_count": null, 127 | "metadata": {}, 128 | "outputs": [], 129 | "source": [ 130 | "y_train.value_counts(normalize=True)" 131 | ] 132 | }, 133 | { 134 | "cell_type": "code", 135 | "execution_count": null, 136 | "metadata": {}, 137 | "outputs": [], 138 | "source": [ 139 | "y_test.value_counts(normalize=True)" 140 | ] 141 | }, 142 | { 143 | "cell_type": "markdown", 144 | "metadata": {}, 145 | "source": [ 146 | "### Stratify!" 147 | ] 148 | }, 149 | { 150 | "cell_type": "code", 151 | "execution_count": null, 152 | "metadata": {}, 153 | "outputs": [], 154 | "source": [ 155 | "X_train, X_test, y_train, y_test = train_test_split(\n", 156 | " X, y, random_state=0, stratify=y\n", 157 | ")" 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": null, 163 | "metadata": {}, 164 | "outputs": [], 165 | "source": [ 166 | "y_train.value_counts(normalize=True)" 167 | ] 168 | }, 169 | { 170 | "cell_type": "code", 171 | "execution_count": null, 172 | "metadata": {}, 173 | "outputs": [], 174 | "source": [ 175 | "y_test.value_counts(normalize=True)" 176 | ] 177 | }, 178 | { 179 | "cell_type": "markdown", 180 | "metadata": {}, 181 | "source": [ 182 | "## scikit-learn API" 183 | ] 184 | }, 185 | { 186 | "cell_type": "code", 187 | "execution_count": null, 188 | "metadata": {}, 189 | "outputs": [], 190 | "source": [ 191 | "from sklearn.linear_model import Perceptron" 192 | ] 193 | }, 194 | { 195 | "cell_type": "code", 196 | "execution_count": null, 197 | "metadata": {}, 198 | "outputs": [], 199 | "source": [ 200 | "percept = Perceptron()" 201 | ] 202 | }, 203 | { 204 | "cell_type": "code", 205 | "execution_count": null, 206 | "metadata": {}, 207 | "outputs": [], 208 | "source": [ 209 | "percept.fit(X_train, y_train)" 210 | ] 211 | }, 212 | { 213 | "cell_type": "code", 214 | "execution_count": null, 215 | "metadata": {}, 216 | "outputs": [], 217 | "source": [ 218 | "percept.predict(X_train)" 219 | ] 220 | }, 221 | { 222 | "cell_type": "code", 223 | "execution_count": null, 224 | "metadata": {}, 225 | "outputs": [], 226 | "source": [ 227 | "y_train" 228 | ] 229 | }, 230 | { 231 | "cell_type": "code", 232 | "execution_count": null, 233 | "metadata": {}, 234 | "outputs": [], 235 | "source": [ 236 | "percept.score(X_train, y_train)" 237 | ] 238 | }, 239 | { 240 | "cell_type": "code", 241 | "execution_count": null, 242 | "metadata": {}, 243 | "outputs": [], 244 | "source": [ 245 | "percept.score(X_test, y_test)" 246 | ] 247 | }, 248 | { 249 | "cell_type": "markdown", 250 | "metadata": {}, 251 | "source": [ 252 | "## Another estimator" 253 | ] 254 | }, 255 | { 256 | "cell_type": "code", 257 | "execution_count": null, 258 | "metadata": {}, 259 | "outputs": [], 260 | "source": [ 261 | "from sklearn.ensemble import RandomForestClassifier" 262 | ] 263 | }, 264 | { 265 | "cell_type": "code", 266 | "execution_count": null, 267 | "metadata": {}, 268 | "outputs": [], 269 | "source": [ 270 | "rf = RandomForestClassifier()" 271 | ] 272 | }, 273 | { 274 | "cell_type": "code", 275 | "execution_count": null, 276 | "metadata": {}, 277 | "outputs": [], 278 | "source": [ 279 | "rf.fit(X_train, y_train)" 280 | ] 281 | }, 282 | { 283 | "cell_type": "code", 284 | "execution_count": null, 285 | "metadata": {}, 286 | "outputs": [], 287 | "source": [ 288 | "rf.score(X_train, y_train)" 289 | ] 290 | }, 291 | { 292 | "cell_type": "code", 293 | "execution_count": null, 294 | "metadata": {}, 295 | "outputs": [], 296 | "source": [ 297 | "rf.score(X_test, y_test)" 298 | ] 299 | }, 300 | { 301 | "cell_type": "markdown", 302 | "metadata": {}, 303 | "source": [ 304 | "## Are these results any good?" 305 | ] 306 | }, 307 | { 308 | "cell_type": "code", 309 | "execution_count": null, 310 | "metadata": {}, 311 | "outputs": [], 312 | "source": [ 313 | "from sklearn.dummy import DummyClassifier" 314 | ] 315 | }, 316 | { 317 | "cell_type": "code", 318 | "execution_count": null, 319 | "metadata": {}, 320 | "outputs": [], 321 | "source": [ 322 | "dc = DummyClassifier()\n", 323 | "dc.fit(X_train, y_train)\n", 324 | "dc.score(X_test, y_test)" 325 | ] 326 | }, 327 | { 328 | "cell_type": "markdown", 329 | "metadata": { 330 | "tags": [] 331 | }, 332 | "source": [ 333 | "## Exercise 1 \n", 334 | "\n", 335 | "1. Import and evaluate the performance of `sklearn.linear_model.LogisticRegression` on the above dataset\n", 336 | "2. How does the test performance compare to the ones we already looked at?" 337 | ] 338 | }, 339 | { 340 | "cell_type": "code", 341 | "execution_count": null, 342 | "metadata": {}, 343 | "outputs": [], 344 | "source": [ 345 | "from sklearn.linear_model import LogisticRegression" 346 | ] 347 | }, 348 | { 349 | "cell_type": "code", 350 | "execution_count": null, 351 | "metadata": {}, 352 | "outputs": [], 353 | "source": [] 354 | }, 355 | { 356 | "cell_type": "markdown", 357 | "metadata": {}, 358 | "source": [ 359 | "**If you are running locally**, you can uncomment the following cell to load the solution into the cell. On **Google Colab**, [see solution here](https://github.com/thomasjpfan/ml-workshop-intro/blob/master/notebooks/solutions/02-ex1-solution.py). " 360 | ] 361 | }, 362 | { 363 | "cell_type": "code", 364 | "execution_count": null, 365 | "metadata": {}, 366 | "outputs": [], 367 | "source": [ 368 | "# %load solutions/02-ex1-solution.py" 369 | ] 370 | }, 371 | { 372 | "cell_type": "markdown", 373 | "metadata": { 374 | "tags": [] 375 | }, 376 | "source": [ 377 | "## Exercise 2\n", 378 | "\n", 379 | "1. Load the wine dataset from `sklearn.datasets` module using the `load_wine` dataset with `as_frame=True`.\n", 380 | "2. Split it into a training and test set using `train_test_split`. (**Hint**: Use `stratify` and set `random_state=42`)\n", 381 | "3. Train `sklearn.neighbors.KNeighborsClassifer`, `sklearn.ensemble.RandomForestClassifier` and `sklearn.linear_model.LogisticRegression` on the wine dataset.\n", 382 | " - **You can ignore warnings here. We will cover it in the next section**\n", 383 | "4. How do they perform on the test set?" 384 | ] 385 | }, 386 | { 387 | "cell_type": "code", 388 | "execution_count": null, 389 | "metadata": {}, 390 | "outputs": [], 391 | "source": [ 392 | "from sklearn.datasets import load_wine\n", 393 | "from sklearn.neighbors import KNeighborsClassifier\n", 394 | "from sklearn.ensemble import RandomForestClassifier\n", 395 | "from sklearn.linear_model import LogisticRegression" 396 | ] 397 | }, 398 | { 399 | "cell_type": "code", 400 | "execution_count": null, 401 | "metadata": {}, 402 | "outputs": [], 403 | "source": [] 404 | }, 405 | { 406 | "cell_type": "markdown", 407 | "metadata": {}, 408 | "source": [ 409 | "**If you are running locally**, you can uncomment the following cell to load the solution into the cell. On **Google Colab**, [see solution here](https://github.com/thomasjpfan/ml-workshop-intro/blob/master/notebooks/solutions/02-ex2-solution.py). " 410 | ] 411 | }, 412 | { 413 | "cell_type": "code", 414 | "execution_count": null, 415 | "metadata": {}, 416 | "outputs": [], 417 | "source": [ 418 | "# %load solutions/02-ex2-solution.py" 419 | ] 420 | } 421 | ], 422 | "metadata": { 423 | "kernelspec": { 424 | "display_name": "Python 3 (ipykernel)", 425 | "language": "python", 426 | "name": "python3" 427 | }, 428 | "language_info": { 429 | "codemirror_mode": { 430 | "name": "ipython", 431 | "version": 3 432 | }, 433 | "file_extension": ".py", 434 | "mimetype": "text/x-python", 435 | "name": "python", 436 | "nbconvert_exporter": "python", 437 | "pygments_lexer": "ipython3", 438 | "version": "3.9.7" 439 | } 440 | }, 441 | "nbformat": 4, 442 | "nbformat_minor": 4 443 | } 444 | -------------------------------------------------------------------------------- /notebooks/03-preprocessing.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Preprocessing\n", 8 | "\n", 9 | "In this notebook, we review preprocessing in scikit-learn.\n", 10 | "\n", 11 | "\"Open" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": null, 17 | "metadata": {}, 18 | "outputs": [], 19 | "source": [ 20 | "# Install dependencies for google colab\n", 21 | "import sys\n", 22 | "IN_COLAB = 'google.colab' in sys.modules\n", 23 | "if IN_COLAB:\n", 24 | " %pip install -r https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/master/requirements.txt" 25 | ] 26 | }, 27 | { 28 | "cell_type": "code", 29 | "execution_count": null, 30 | "metadata": {}, 31 | "outputs": [], 32 | "source": [ 33 | "import sklearn\n", 34 | "assert sklearn.__version__.startswith(\"1.0\"), \"Plese install scikit-learn 1.0\"" 35 | ] 36 | }, 37 | { 38 | "cell_type": "code", 39 | "execution_count": null, 40 | "metadata": {}, 41 | "outputs": [], 42 | "source": [ 43 | "import seaborn as sns\n", 44 | "sns.set_theme(context=\"notebook\", font_scale=1.4, rc={\"figure.constrained_layout.use\": True, \"figure.figsize\": [10, 6]})" 45 | ] 46 | }, 47 | { 48 | "cell_type": "code", 49 | "execution_count": null, 50 | "metadata": {}, 51 | "outputs": [], 52 | "source": [ 53 | "from sklearn.datasets import fetch_openml\n", 54 | "\n", 55 | "housing = fetch_openml(data_id=531, as_frame=True)\n", 56 | "housing_df = housing.frame\n", 57 | "\n", 58 | "# Drop sensative feature\n", 59 | "housing_df = housing_df.drop(\"B\", axis=1)" 60 | ] 61 | }, 62 | { 63 | "cell_type": "code", 64 | "execution_count": null, 65 | "metadata": {}, 66 | "outputs": [], 67 | "source": [ 68 | "housing_df" 69 | ] 70 | }, 71 | { 72 | "cell_type": "code", 73 | "execution_count": null, 74 | "metadata": {}, 75 | "outputs": [], 76 | "source": [ 77 | "feature_names = housing_df.columns.drop(\"MEDV\")" 78 | ] 79 | }, 80 | { 81 | "cell_type": "code", 82 | "execution_count": null, 83 | "metadata": {}, 84 | "outputs": [], 85 | "source": [ 86 | "import matplotlib.pyplot as plt\n", 87 | "\n", 88 | "fig, axes = plt.subplots(2, 4, figsize=(24, 9))\n", 89 | "\n", 90 | "for name, ax in zip(feature_names, axes.ravel()):\n", 91 | " sns.scatterplot(x=name, y='MEDV', ax=ax, data=housing_df)" 92 | ] 93 | }, 94 | { 95 | "cell_type": "code", 96 | "execution_count": null, 97 | "metadata": {}, 98 | "outputs": [], 99 | "source": [ 100 | "housing_df[feature_names].plot(kind='box');" 101 | ] 102 | }, 103 | { 104 | "cell_type": "markdown", 105 | "metadata": {}, 106 | "source": [ 107 | "## Model without scaling" 108 | ] 109 | }, 110 | { 111 | "cell_type": "code", 112 | "execution_count": null, 113 | "metadata": {}, 114 | "outputs": [], 115 | "source": [ 116 | "X = housing_df.drop(\"MEDV\", axis=1)\n", 117 | "y = housing_df[\"MEDV\"]" 118 | ] 119 | }, 120 | { 121 | "cell_type": "markdown", 122 | "metadata": {}, 123 | "source": [ 124 | "Select only numerical data for this example:" 125 | ] 126 | }, 127 | { 128 | "cell_type": "code", 129 | "execution_count": null, 130 | "metadata": {}, 131 | "outputs": [], 132 | "source": [ 133 | "X = X.select_dtypes(include=\"number\")\n", 134 | "feature_names = X.columns" 135 | ] 136 | }, 137 | { 138 | "cell_type": "code", 139 | "execution_count": null, 140 | "metadata": {}, 141 | "outputs": [], 142 | "source": [ 143 | "from sklearn.model_selection import train_test_split\n", 144 | "\n", 145 | "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42)" 146 | ] 147 | }, 148 | { 149 | "cell_type": "code", 150 | "execution_count": null, 151 | "metadata": {}, 152 | "outputs": [], 153 | "source": [ 154 | "from sklearn.neighbors import KNeighborsRegressor\n", 155 | "\n", 156 | "knr = KNeighborsRegressor().fit(X_train, y_train)\n", 157 | "knr.score(X_train, y_train)" 158 | ] 159 | }, 160 | { 161 | "cell_type": "code", 162 | "execution_count": null, 163 | "metadata": {}, 164 | "outputs": [], 165 | "source": [ 166 | "knr.score(X_test, y_test)" 167 | ] 168 | }, 169 | { 170 | "cell_type": "markdown", 171 | "metadata": {}, 172 | "source": [ 173 | "## Model with scaling\n", 174 | "\n", 175 | "### Scale first!" 176 | ] 177 | }, 178 | { 179 | "cell_type": "code", 180 | "execution_count": null, 181 | "metadata": {}, 182 | "outputs": [], 183 | "source": [ 184 | "from sklearn.preprocessing import StandardScaler\n", 185 | "\n", 186 | "scaler = StandardScaler()\n", 187 | "X_train_scaled = scaler.fit_transform(X_train)" 188 | ] 189 | }, 190 | { 191 | "cell_type": "code", 192 | "execution_count": null, 193 | "metadata": {}, 194 | "outputs": [], 195 | "source": [ 196 | "import pandas as pd\n", 197 | "X_train_scaled_df = pd.DataFrame(X_train_scaled, columns=feature_names)" 198 | ] 199 | }, 200 | { 201 | "cell_type": "code", 202 | "execution_count": null, 203 | "metadata": {}, 204 | "outputs": [], 205 | "source": [ 206 | "X_train_scaled_df.plot(kind='box');" 207 | ] 208 | }, 209 | { 210 | "cell_type": "markdown", 211 | "metadata": {}, 212 | "source": [ 213 | "### Train model on scaled data" 214 | ] 215 | }, 216 | { 217 | "cell_type": "code", 218 | "execution_count": null, 219 | "metadata": {}, 220 | "outputs": [], 221 | "source": [ 222 | "knr = KNeighborsRegressor().fit(X_train_scaled, y_train)\n", 223 | "knr.score(X_train_scaled, y_train)" 224 | ] 225 | }, 226 | { 227 | "cell_type": "code", 228 | "execution_count": null, 229 | "metadata": {}, 230 | "outputs": [], 231 | "source": [ 232 | "X_test_scaled = scaler.transform(X_test)\n", 233 | "knr.score(X_test_scaled, y_test)" 234 | ] 235 | }, 236 | { 237 | "cell_type": "markdown", 238 | "metadata": { 239 | "tags": [] 240 | }, 241 | "source": [ 242 | "## Exercise 1\n", 243 | "\n", 244 | "1. Train a `sklearn.svm.SVR` model on the unscaled training data and evaluate on the unscaled test data.\n", 245 | "2. Train the same model on the scaled data and evalute on the scaled test data.\n", 246 | "3. Does scaling the data change the performance of the model?" 247 | ] 248 | }, 249 | { 250 | "cell_type": "code", 251 | "execution_count": null, 252 | "metadata": {}, 253 | "outputs": [], 254 | "source": [ 255 | "from sklearn.svm import SVR\n", 256 | "import numpy as np" 257 | ] 258 | }, 259 | { 260 | "cell_type": "code", 261 | "execution_count": null, 262 | "metadata": {}, 263 | "outputs": [], 264 | "source": [] 265 | }, 266 | { 267 | "cell_type": "markdown", 268 | "metadata": {}, 269 | "source": [ 270 | "**If you are running locally**, you can uncomment the following cell to load the solution into the cell. On **Google Colab**, [see solution here](https://github.com/thomasjpfan/ml-workshop-intro/blob/master/notebooks/solutions/03-ex1-solution.py). " 271 | ] 272 | }, 273 | { 274 | "cell_type": "code", 275 | "execution_count": null, 276 | "metadata": {}, 277 | "outputs": [], 278 | "source": [ 279 | "# %load solutions/03-ex1-solution.py" 280 | ] 281 | }, 282 | { 283 | "cell_type": "markdown", 284 | "metadata": {}, 285 | "source": [ 286 | "## Tree based models" 287 | ] 288 | }, 289 | { 290 | "cell_type": "code", 291 | "execution_count": null, 292 | "metadata": {}, 293 | "outputs": [], 294 | "source": [ 295 | "from sklearn.tree import DecisionTreeRegressor" 296 | ] 297 | }, 298 | { 299 | "cell_type": "code", 300 | "execution_count": null, 301 | "metadata": {}, 302 | "outputs": [], 303 | "source": [ 304 | "tree = DecisionTreeRegressor(random_state=0, max_depth=2).fit(X_train, y_train)\n", 305 | "tree.score(X_test, y_test)" 306 | ] 307 | }, 308 | { 309 | "cell_type": "code", 310 | "execution_count": null, 311 | "metadata": {}, 312 | "outputs": [], 313 | "source": [ 314 | "tree_scaled = DecisionTreeRegressor(random_state=0, max_depth=2).fit(X_train_scaled, y_train)\n", 315 | "tree_scaled.score(X_test_scaled, y_test)" 316 | ] 317 | }, 318 | { 319 | "cell_type": "markdown", 320 | "metadata": {}, 321 | "source": [ 322 | "### Why are the scores the same?" 323 | ] 324 | }, 325 | { 326 | "cell_type": "code", 327 | "execution_count": null, 328 | "metadata": {}, 329 | "outputs": [], 330 | "source": [ 331 | "from sklearn.tree import plot_tree\n", 332 | "sns.reset_orig()\n", 333 | "fig, ax = plt.subplots(figsize=(20, 10))\n", 334 | "_ = plot_tree(tree, ax=ax, fontsize=20, feature_names=feature_names)" 335 | ] 336 | }, 337 | { 338 | "cell_type": "code", 339 | "execution_count": null, 340 | "metadata": {}, 341 | "outputs": [], 342 | "source": [ 343 | "from sklearn.tree import plot_tree\n", 344 | "sns.reset_orig()\n", 345 | "fig, ax = plt.subplots(figsize=(20, 10))\n", 346 | "_ = plot_tree(tree_scaled, ax=ax, fontsize=20, feature_names=feature_names)" 347 | ] 348 | } 349 | ], 350 | "metadata": { 351 | "kernelspec": { 352 | "display_name": "Python 3 (ipykernel)", 353 | "language": "python", 354 | "name": "python3" 355 | }, 356 | "language_info": { 357 | "codemirror_mode": { 358 | "name": "ipython", 359 | "version": 3 360 | }, 361 | "file_extension": ".py", 362 | "mimetype": "text/x-python", 363 | "name": "python", 364 | "nbconvert_exporter": "python", 365 | "pygments_lexer": "ipython3", 366 | "version": "3.9.7" 367 | } 368 | }, 369 | "nbformat": 4, 370 | "nbformat_minor": 4 371 | } 372 | -------------------------------------------------------------------------------- /notebooks/04-pipelines.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "cells": [ 3 | { 4 | "cell_type": "markdown", 5 | "metadata": {}, 6 | "source": [ 7 | "# Pipelines\n", 8 | "\n", 9 | "In this notebook, we will learn about pipelines in scikit-learn.\n", 10 | "\n", 11 | "\"Open" 12 | ] 13 | }, 14 | { 15 | "cell_type": "code", 16 | "execution_count": null, 17 | "metadata": { 18 | "tags": [] 19 | }, 20 | "outputs": [], 21 | "source": [ 22 | "# Install dependencies for google colab\n", 23 | "import sys\n", 24 | "IN_COLAB = 'google.colab' in sys.modules\n", 25 | "if IN_COLAB:\n", 26 | " %pip install -r https://raw.githubusercontent.com/thomasjpfan/ml-workshop-intro/master/requirements.txt" 27 | ] 28 | }, 29 | { 30 | "cell_type": "code", 31 | "execution_count": null, 32 | "metadata": {}, 33 | "outputs": [], 34 | "source": [ 35 | "import sklearn\n", 36 | "assert sklearn.__version__.startswith(\"1.0\"), \"Plese install scikit-learn 1.0\"" 37 | ] 38 | }, 39 | { 40 | "cell_type": "code", 41 | "execution_count": null, 42 | "metadata": {}, 43 | "outputs": [], 44 | "source": [ 45 | "sklearn.set_config(display='diagram')" 46 | ] 47 | }, 48 | { 49 | "cell_type": "markdown", 50 | "metadata": {}, 51 | "source": [ 52 | "Load data from previous notebook " 53 | ] 54 | }, 55 | { 56 | "cell_type": "code", 57 | "execution_count": null, 58 | "metadata": {}, 59 | "outputs": [], 60 | "source": [ 61 | "from sklearn.datasets import fetch_california_housing\n", 62 | "from sklearn.model_selection import train_test_split\n", 63 | "\n", 64 | "housing = fetch_california_housing(as_frame=True)\n", 65 | "X, y = housing.data, housing.target\n", 66 | "\n", 67 | "X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)" 68 | ] 69 | }, 70 | { 71 | "cell_type": "markdown", 72 | "metadata": {}, 73 | "source": [ 74 | "## Make pipeline!" 75 | ] 76 | }, 77 | { 78 | "cell_type": "code", 79 | "execution_count": null, 80 | "metadata": {}, 81 | "outputs": [], 82 | "source": [ 83 | "from sklearn.pipeline import make_pipeline\n", 84 | "from sklearn.preprocessing import StandardScaler\n", 85 | "from sklearn.neighbors import KNeighborsRegressor\n", 86 | "\n", 87 | "knr = make_pipeline(\n", 88 | " StandardScaler(), KNeighborsRegressor()\n", 89 | ")\n", 90 | "knr.fit(X_train, y_train)" 91 | ] 92 | }, 93 | { 94 | "cell_type": "code", 95 | "execution_count": null, 96 | "metadata": {}, 97 | "outputs": [], 98 | "source": [ 99 | "knr.score(X_test, y_test)" 100 | ] 101 | }, 102 | { 103 | "cell_type": "code", 104 | "execution_count": null, 105 | "metadata": {}, 106 | "outputs": [], 107 | "source": [ 108 | "from sklearn.preprocessing import SplineTransformer\n", 109 | "\n", 110 | "knr_spline = make_pipeline(\n", 111 | " StandardScaler(),\n", 112 | " SplineTransformer(),\n", 113 | " KNeighborsRegressor()\n", 114 | ")\n", 115 | "knr_spline.fit(X_train, y_train)" 116 | ] 117 | }, 118 | { 119 | "cell_type": "code", 120 | "execution_count": null, 121 | "metadata": {}, 122 | "outputs": [], 123 | "source": [ 124 | "knr_spline.score(X_test, y_test)" 125 | ] 126 | }, 127 | { 128 | "cell_type": "markdown", 129 | "metadata": {}, 130 | "source": [ 131 | "## Exercise 1\n", 132 | "\n", 133 | "1. Load the cancer dataset from `sklearn.datasets` using the `load_breast_cancer` function.\n", 134 | "2. Is this is a classification or regression problem?\n", 135 | "3. Split the data into training and test dataset. (Use `random_state=0`)\n", 136 | "4. Create a pipeline with a `StandardScaler` and a `sklearn.linear_model.LogisticRegression`.\n", 137 | "5. Evaluate the performance of this pipeline on the test dataset.\n", 138 | "6. **Extra**: Add a `sklearn.preprocessing.PolynomialFeatures` to the pipeline and see if the performance improves." 139 | ] 140 | }, 141 | { 142 | "cell_type": "code", 143 | "execution_count": null, 144 | "metadata": {}, 145 | "outputs": [], 146 | "source": [ 147 | "from sklearn.datasets import load_breast_cancer\n", 148 | "from sklearn.linear_model import LogisticRegression\n", 149 | "from sklearn.preprocessing import PolynomialFeatures" 150 | ] 151 | }, 152 | { 153 | "cell_type": "code", 154 | "execution_count": null, 155 | "metadata": {}, 156 | "outputs": [], 157 | "source": [] 158 | }, 159 | { 160 | "cell_type": "markdown", 161 | "metadata": {}, 162 | "source": [ 163 | "**If you are running locally**, you can uncomment the following cell to load the solution into the cell. On **Google Colab**, [see solution here](https://github.com/thomasjpfan/ml-workshop-intro/blob/master/notebooks/solutions/04-ex01-solution.py). " 164 | ] 165 | }, 166 | { 167 | "cell_type": "code", 168 | "execution_count": null, 169 | "metadata": {}, 170 | "outputs": [], 171 | "source": [ 172 | "# %load solutions/04-ex01-solution.py" 173 | ] 174 | } 175 | ], 176 | "metadata": { 177 | "kernelspec": { 178 | "display_name": "Python 3 (ipykernel)", 179 | "language": "python", 180 | "name": "python3" 181 | }, 182 | "language_info": { 183 | "codemirror_mode": { 184 | "name": "ipython", 185 | "version": 3 186 | }, 187 | "file_extension": ".py", 188 | "mimetype": "text/x-python", 189 | "name": "python", 190 | "nbconvert_exporter": "python", 191 | "pygments_lexer": "ipython3", 192 | "version": "3.9.7" 193 | } 194 | }, 195 | "nbformat": 4, 196 | "nbformat_minor": 4 197 | } 198 | -------------------------------------------------------------------------------- /notebooks/solutions/01-ex1-solution.py: -------------------------------------------------------------------------------- 1 | wine = load_wine(as_frame=True) 2 | 3 | print(wine.DESCR) 4 | 5 | X, y = wine.data, wine.target 6 | 7 | X.shape 8 | 9 | y.unique() 10 | 11 | wine_df = wine.frame 12 | 13 | sns.jointplot(data=wine_df, x="proline", y="flavanoids", hue="target", height=8) 14 | -------------------------------------------------------------------------------- /notebooks/solutions/02-ex1-solution.py: -------------------------------------------------------------------------------- 1 | log_reg = LogisticRegression() 2 | 3 | log_reg.fit(X_train, y_train) 4 | 5 | log_reg.score(X_test, y_test) 6 | -------------------------------------------------------------------------------- /notebooks/solutions/02-ex2-solution.py: -------------------------------------------------------------------------------- 1 | wine = load_wine(as_frame=True) 2 | 3 | X, y = wine.data, wine.target 4 | 5 | X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y, random_state=42) 6 | 7 | knc = KNeighborsClassifier() 8 | knc.fit(X_train, y_train) 9 | 10 | rfc = RandomForestClassifier() 11 | rfc.fit(X_train, y_train) 12 | 13 | log_reg = LogisticRegression() 14 | log_reg.fit(X_train, y_train) 15 | 16 | knc.score(X_test, y_test) 17 | 18 | rfc.score(X_test, y_test) 19 | 20 | log_reg.score(X_test, y_test) 21 | -------------------------------------------------------------------------------- /notebooks/solutions/03-ex1-solution.py: -------------------------------------------------------------------------------- 1 | svr = SVR() 2 | svr.fit(X_train, y_train) 3 | 4 | svr.score(X_test, y_test) 5 | 6 | svr_scaled = SVR() 7 | svr_scaled.fit(X_train_scaled, y_train) 8 | 9 | svr_scaled.score(X_test_scaled, y_test) 10 | -------------------------------------------------------------------------------- /notebooks/solutions/04-ex01-solution.py: -------------------------------------------------------------------------------- 1 | cancer = load_breast_cancer(as_frame=True) 2 | 3 | X, y = cancer.data, cancer.target 4 | 5 | y.unique() 6 | 7 | X_train, X_test, y_train, y_test = train_test_split(X, y, stratify=y, random_state=0) 8 | 9 | log_reg = make_pipeline( 10 | StandardScaler(), 11 | LogisticRegression() 12 | ) 13 | 14 | log_reg.fit(X_train, y_train) 15 | 16 | log_reg.score(X_test, y_test) 17 | 18 | log_reg_poly = make_pipeline( 19 | StandardScaler(), 20 | PolynomialFeatures(), 21 | LogisticRegression() 22 | ) 23 | 24 | log_reg_poly.fit(X_train, y_train) 25 | 26 | log_reg_poly.score(X_test, y_test) 27 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | scikit-learn==1.0.* 2 | seaborn==0.11.2 3 | pandas 4 | -------------------------------------------------------------------------------- /slides.md: -------------------------------------------------------------------------------- 1 | title: Introduction to scikit-learn: Machine Learning in Python 2 | use_katex: True 3 | class: title-slide 4 | 5 | # Introduction to scikit-learn: Machine Learning in Python 6 | 7 | ![](images/scikit-learn-logo-notext.png) 8 | 9 | .larger[Thomas J. Fan]
10 | @thomasjpfan
11 | 12 | 13 | 14 | This workshop on Github: github.com/thomasjpfan/ml-workshop-intro 15 | 16 | ??? 17 | 18 | ## Links 19 | 20 | - https://scikit-learn.org/stable/ 21 | - https://github.com/thomasjpfan/ml-workshop-intro 22 | 23 | --- 24 | 25 | name: table-of-contents 26 | class: title-slide, left 27 | 28 | # Table of Contents 29 | 30 | .g[ 31 | .g-6[ 32 | 1. [Introduction to Machine Learning](#introduction) 33 | 1. [Supervised Learning](#supervised) 34 | 1. [Preprocessing](#preprocessing) 35 | 1. [Pipelines](#pipelines) 36 | ] 37 | .g-6.g-center[ 38 | ![](images/scikit-learn-logo-notext.png) 39 | ] 40 | ] 41 | 42 | --- 43 | 44 | name: introduction 45 | class: chapter-slide 46 | 47 | # 1. Introduction to Machine Learning 48 | 49 | .footnote-back[ 50 | [Back to Table of Contents](#table-of-contents) 51 | ] 52 | 53 | --- 54 | 55 | class: chapter-slide 56 | 57 | # What is machine learning? 58 | 59 | --- 60 | 61 | class: middle 62 | 63 | # Traditional programming 64 | 65 | ## Prediction 66 | 67 | ![](images/traditional-programming.svg) 68 | 69 | --- 70 | 71 | class: middle 72 | 73 | # Machine Learning 74 | 75 | ## Training 76 | 77 | ![](images/ml-training.svg) 78 | 79 | ## Prediction 80 | 81 | ![](images/ml-prediction.svg) 82 | 83 | --- 84 | 85 | class: center 86 | 87 | # Amazon Recommendations 88 | 89 | ![](images/amazon.png) 90 | 91 | --- 92 | 93 | class: center 94 | 95 | # Higgs Boson 96 | 97 | ![](images/higgs.png) 98 | 99 | .footnote[ 100 | [Machine Learning Wins the Higgs Challenge](https://atlas.cern/updates/atlas-news/machine-learning-wins-higgs-challenge) 101 | ] 102 | 103 | --- 104 | 105 | ![](images/blood_quality.png) 106 | 107 | .footnote[ 108 | [Link to Source](https://www.broadinstitute.org/news/deep-learning-model-assesses-quality-stored-blood) 109 | ] 110 | 111 | --- 112 | 113 | class: middle 114 | 115 | # Types of Machine Learning 116 | 117 | - Unsupervised Learning 118 | 119 | - Reinforcement Learning 120 | 121 | - Supervised Learning 122 | 123 | --- 124 | 125 | # Unsupervised Learning 126 | 127 | ![:scale 80%](images/clustering.png) 128 | 129 | .footnote[ 130 | [Link to Source](https://scikit-learn.org/dev/auto_examples/cluster/plot_cluster_comparison.html#sphx-glr-auto-examples-cluster-plot-cluster-comparison-py) 131 | ] 132 | 133 | --- 134 | 135 | # Reinforcement Learning 136 | 137 | ![:scale 80%](images/reinforcement.svg) 138 | 139 | --- 140 | 141 | # Reinforcement Learning 142 | 143 | ![:scale 80%](images/dota.png) 144 | 145 | .footnote[ 146 | [Link to Source](https://arxiv.org/abs/1912.06680) 147 | ] 148 | 149 | 150 | --- 151 | 152 | name: supervised 153 | class: chapter-slide 154 | 155 | # 2. Supervised Learning 156 | 157 | .footnote-back[ 158 | [Back to Table of Contents](#table-of-contents) 159 | ] 160 | 161 | --- 162 | 163 | # Supervised Learning 164 | 165 | $$ 166 | (x_i, y_i) \propto p(x, y) \text{ i.i.d} 167 | $$ 168 | - $p$ is an unknown joint distribution 169 | - i.i.d means independent identically distributed 170 | 171 | $$x_i \in \mathbb{R}^p$$ 172 | $$y_i \in \mathbb{R}$$ 173 | 174 | ## Goal during training 175 | $$f(x_i) \approx y_i$$ 176 | 177 | --- 178 | 179 | # Generalization 180 | 181 | ## Goal during training 182 | $$f(x_i) \approx y_i$$ 183 | 184 | ## Generalization 185 | $$f(x) \approx y$$ 186 | 187 | For *non-training data*: $x$ 188 | 189 | --- 190 | 191 | class: middle 192 | 193 | # Classification and Regression 194 | 195 | .g[ 196 | .g-6[ 197 | ## Classification 198 | - target $y$ is discrete 199 | - Does the patient have cancer? 200 | ] 201 | .g-6[ 202 | ## Regression 203 | - target $y$ is continuous 204 | - What is the price of the home? 205 | ] 206 | ] 207 | 208 | --- 209 | 210 | # Data Representation 211 | 212 | ![:scale 80%](images/data-representation.svg) 213 | 214 | --- 215 | 216 | # Loading Datasets 217 | 218 | ## Random datasets 219 | ```py 220 | from sklearn.datasets import make_classification 221 | from sklearn.datasets import make_regression 222 | ``` 223 | 224 | ## Sample datasets 225 | ```py 226 | from sklearn.datasets import load_breast_cancer 227 | from sklearn.datasets import load_diabetes 228 | from sklearn.datasets import load_digits 229 | from sklearn.datasets import load_iris 230 | from sklearn.datasets import load_wine 231 | ``` 232 | 233 | ## OpenML 234 | 235 | ```py 236 | from sklearn.datasets import fetch_openml 237 | ``` 238 | 239 | --- 240 | 241 | # Splitting Training and Test Data 242 | 243 | ![:scale 70%](images/train-test.svg) 244 | 245 | --- 246 | 247 | class: chapter-slide 248 | 249 | # Notebook 📒! 250 | ## notebooks/01-loading-data.ipynb 251 | 252 | --- 253 | 254 | # Supervised ML Workflow 255 | 256 | ![](images/ml-workflow.svg) 257 | 258 | --- 259 | 260 | # Supervised ML Workflow 261 | 262 | ![](images/ml-workflow-sklearn.svg) 263 | 264 | --- 265 | 266 | class: chapter-slide 267 | 268 | # Notebook 📓! 269 | ## notebooks/02-supervised-learning.ipynb 270 | 271 | --- 272 | 273 | name: preprocessing 274 | class: chapter-slide 275 | 276 | # 3. Preprocessing 277 | 278 | .footnote-back[ 279 | [Back to Table of Contents](#table-of-contents) 280 | ] 281 | 282 | --- 283 | 284 | # Housing Dataset 285 | 286 | ![:scale 100%](notebooks/images/housing_scatter.svg) 287 | 288 | --- 289 | 290 | # Feature Ranges 291 | 292 | 293 | ![:scale 90%](notebooks/images/housing_box.svg) 294 | 295 | --- 296 | 297 | class: chapter-slide 298 | 299 | # Notebook 📕! 300 | ## notebooks/02-preprocessing.ipynb 301 | 302 | --- 303 | 304 | # KNN Scaling 305 | 306 | ![:scale 90%](notebooks/images/knn-data.svg) 307 | 308 | --- 309 | 310 | # KNN Scaling Decision Boundary 311 | 312 | ![:scale 90%](notebooks/images/knn-scaling.svg) 313 | 314 | --- 315 | 316 | # Scikit-Learn API 317 | 318 | 319 | .center[ 320 | ## `estimator.fit(X, [y])` 321 | ] 322 | 323 | .g[ 324 | .g-6[ 325 | ## `estimator.predict` 326 | - Classification 327 | - Regression 328 | - Clustering 329 | ] 330 | .g-6[ 331 | ## `estimator.transform` 332 | - Preprocessing 333 | - Dimensionality reduction 334 | - Feature selection 335 | - Feature extraction 336 | ] 337 | ] 338 | 339 | --- 340 | 341 | name: pipelines 342 | class: chapter-slide 343 | 344 | # 4. Pipelines 345 | 346 | .footnote-back[ 347 | [Back to Table of Contents](#table-of-contents) 348 | ] 349 | 350 | --- 351 | 352 | # Why Pipelines? 353 | 354 | - Preprocessing must be fitted on training data only! 355 | 356 | ## Bad 357 | ```py 358 | scaler = StandardScaler() 359 | X_train_scaled = scaler.fit_transform(X_train) 360 | X_test_scaled = scaler.fit_transform(X_test) 361 | ``` 362 | 363 | ## Good 364 | ```py 365 | scaler = StandardScaler() 366 | X_train_scaled = scaler.fit_transform(X_train) 367 | X_test_scaled = scaler.transform(X_test) 368 | ``` 369 | 370 | --- 371 | 372 | # Pipeline Example 373 | 374 | ## Before 375 | 376 | ```py 377 | scaler = StandardScaler().fit(X_train) 378 | X_train_scaled = scaler.transform(X_train) 379 | 380 | est = Ridge().fit(X_train_scaled, y_train) 381 | 382 | # Evaluate on test data 383 | X_test_scaled = scaler.transform(X_test) 384 | est.score(X_test_scaled, y_test) 385 | ``` 386 | 387 | ## After 388 | 389 | ```py 390 | *from sklearn.pipeline import make_pipeline 391 | 392 | pipe = make_pipeline(StandardScaler(), Ridge()) 393 | 394 | pipe.fit(X_train, y_train) 395 | pipe.score(X_test, y_test) 396 | ``` 397 | 398 | --- 399 | 400 | # Pipeline Overview 401 | 402 | ![](images/pipeline.svg) 403 | 404 | --- 405 | 406 | class: chapter-slide 407 | 408 | # Notebook 📕! 409 | ## notebooks/04-pipelines.ipynb 410 | 411 | --- 412 | 413 | # Whats next? 414 | ## Intermediate Machine Learning with scikit-learn 415 | - Cross Validation 416 | - Parameter Tuning 417 | - Pandas interoperability 418 | - Missing Values 419 | 420 | ## Other Workshops 421 | - Intermediate Machine Learning with scikit-learn:
*Evaluation, Calibration, and Inspection* 422 | - Advanced Machine Learning with scikit-learn:
*Text Data, Imbalanced Data, and Poisson Regression* 423 | 424 | --- 425 | 426 | class: title-slide, left 427 | 428 | .g.g-middle[ 429 | .g-7[ 430 | ![:scale 30%](images/scikit-learn-logo-notext.png) 431 | 1. [Introduction to Machine Learning](#introduction) 432 | 2. [Supervised Learning](#supervised) 433 | 3. [Preprocessing](#preprocessing) 434 | 4. [Pipelines](#pipelines) 435 | ] 436 | .g-5.center[ 437 |
438 | .larger[Thomas J. Fan]
439 | @thomasjpfan
440 | 441 | 442 | 443 | This workshop on Github: github.com/thomasjpfan/ml-workshop-intro 444 | ] 445 | ] 446 | --------------------------------------------------------------------------------