├── LICENSE.txt ├── README.md ├── environment.yml ├── tutorial.ipynb └── tutorial.pdf /LICENSE.txt: -------------------------------------------------------------------------------- 1 | License 2 | ======= 3 | 4 | All Python source code is made available under the BSD 3-clause license. You 5 | can freely use and modify the code, without warranty, so long as you provide 6 | attribution to the authors. 7 | 8 | Unless otherwise specified, all figures and Jupyter notebooks are available 9 | under the Creative Commons Attribution 4.0 License (CC-BY). 10 | 11 | 12 | BSD 3-Clause License 13 | -------------------- 14 | 15 | Copyright (c) 2021, The Tutorial Developers 16 | All rights reserved. 17 | 18 | Redistribution and use in source and binary forms, with or without 19 | modification, are permitted provided that the following conditions are met: 20 | 21 | 1. Redistributions of source code must retain the above copyright notice, this 22 | list of conditions and the following disclaimer. 23 | 24 | 2. Redistributions in binary form must reproduce the above copyright notice, 25 | this list of conditions and the following disclaimer in the documentation 26 | and/or other materials provided with the distribution. 27 | 28 | 3. Neither the name of the copyright holder nor the names of its 29 | contributors may be used to endorse or promote products derived from 30 | this software without specific prior written permission. 31 | 32 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 33 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 34 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 35 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 36 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 37 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 38 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 39 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 40 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 41 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 42 | 43 | 44 | Creative Commons Attribution 4.0 International 45 | ---------------------------------------------- 46 | 47 | Creative Commons Corporation ("Creative Commons") is not a law firm and 48 | does not provide legal services or legal advice. Distribution of 49 | Creative Commons public licenses does not create a lawyer-client or 50 | other relationship. Creative Commons makes its licenses and related 51 | information available on an "as-is" basis. Creative Commons gives no 52 | warranties regarding its licenses, any material licensed under their 53 | terms and conditions, or any related information. Creative Commons 54 | disclaims all liability for damages resulting from their use to the 55 | fullest extent possible. 56 | 57 | Using Creative Commons Public Licenses 58 | 59 | Creative Commons public licenses provide a standard set of terms and 60 | conditions that creators and other rights holders may use to share 61 | original works of authorship and other material subject to copyright 62 | and certain other rights specified in the public license below. The 63 | following considerations are for informational purposes only, are not 64 | exhaustive, and do not form part of our licenses. 65 | 66 | Considerations for licensors: Our public licenses are 67 | intended for use by those authorized to give the public 68 | permission to use material in ways otherwise restricted by 69 | copyright and certain other rights. Our licenses are 70 | irrevocable. Licensors should read and understand the terms 71 | and conditions of the license they choose before applying it. 72 | Licensors should also secure all rights necessary before 73 | applying our licenses so that the public can reuse the 74 | material as expected. Licensors should clearly mark any 75 | material not subject to the license. This includes other CC- 76 | licensed material, or material used under an exception or 77 | limitation to copyright. More considerations for licensors: 78 | wiki.creativecommons.org/Considerations_for_licensors 79 | 80 | Considerations for the public: By using one of our public 81 | licenses, a licensor grants the public permission to use the 82 | licensed material under specified terms and conditions. If 83 | the licensor's permission is not necessary for any reason--for 84 | example, because of any applicable exception or limitation to 85 | copyright--then that use is not regulated by the license. Our 86 | licenses grant only permissions under copyright and certain 87 | other rights that a licensor has authority to grant. Use of 88 | the licensed material may still be restricted for other 89 | reasons, including because others have copyright or other 90 | rights in the material. A licensor may make special requests, 91 | such as asking that all changes be marked or described. 92 | Although not required by our licenses, you are encouraged to 93 | respect those requests where reasonable. More_considerations 94 | for the public: 95 | wiki.creativecommons.org/Considerations_for_licensees 96 | 97 | ======================================================================= 98 | 99 | Creative Commons Attribution 4.0 International Public License 100 | 101 | By exercising the Licensed Rights (defined below), You accept and agree 102 | to be bound by the terms and conditions of this Creative Commons 103 | Attribution 4.0 International Public License ("Public License"). To the 104 | extent this Public License may be interpreted as a contract, You are 105 | granted the Licensed Rights in consideration of Your acceptance of 106 | these terms and conditions, and the Licensor grants You such rights in 107 | consideration of benefits the Licensor receives from making the 108 | Licensed Material available under these terms and conditions. 109 | 110 | 111 | Section 1 -- Definitions. 112 | 113 | a. Adapted Material means material subject to Copyright and Similar 114 | Rights that is derived from or based upon the Licensed Material 115 | and in which the Licensed Material is translated, altered, 116 | arranged, transformed, or otherwise modified in a manner requiring 117 | permission under the Copyright and Similar Rights held by the 118 | Licensor. For purposes of this Public License, where the Licensed 119 | Material is a musical work, performance, or sound recording, 120 | Adapted Material is always produced where the Licensed Material is 121 | synched in timed relation with a moving image. 122 | 123 | b. Adapter's License means the license You apply to Your Copyright 124 | and Similar Rights in Your contributions to Adapted Material in 125 | accordance with the terms and conditions of this Public License. 126 | 127 | c. Copyright and Similar Rights means copyright and/or similar rights 128 | closely related to copyright including, without limitation, 129 | performance, broadcast, sound recording, and Sui Generis Database 130 | Rights, without regard to how the rights are labeled or 131 | categorized. For purposes of this Public License, the rights 132 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 133 | Rights. 134 | 135 | d. Effective Technological Measures means those measures that, in the 136 | absence of proper authority, may not be circumvented under laws 137 | fulfilling obligations under Article 11 of the WIPO Copyright 138 | Treaty adopted on December 20, 1996, and/or similar international 139 | agreements. 140 | 141 | e. Exceptions and Limitations means fair use, fair dealing, and/or 142 | any other exception or limitation to Copyright and Similar Rights 143 | that applies to Your use of the Licensed Material. 144 | 145 | f. Licensed Material means the artistic or literary work, database, 146 | or other material to which the Licensor applied this Public 147 | License. 148 | 149 | g. Licensed Rights means the rights granted to You subject to the 150 | terms and conditions of this Public License, which are limited to 151 | all Copyright and Similar Rights that apply to Your use of the 152 | Licensed Material and that the Licensor has authority to license. 153 | 154 | h. Licensor means the individual(s) or entity(ies) granting rights 155 | under this Public License. 156 | 157 | i. Share means to provide material to the public by any means or 158 | process that requires permission under the Licensed Rights, such 159 | as reproduction, public display, public performance, distribution, 160 | dissemination, communication, or importation, and to make material 161 | available to the public including in ways that members of the 162 | public may access the material from a place and at a time 163 | individually chosen by them. 164 | 165 | j. Sui Generis Database Rights means rights other than copyright 166 | resulting from Directive 96/9/EC of the European Parliament and of 167 | the Council of 11 March 1996 on the legal protection of databases, 168 | as amended and/or succeeded, as well as other essentially 169 | equivalent rights anywhere in the world. 170 | 171 | k. You means the individual or entity exercising the Licensed Rights 172 | under this Public License. Your has a corresponding meaning. 173 | 174 | 175 | Section 2 -- Scope. 176 | 177 | a. License grant. 178 | 179 | 1. Subject to the terms and conditions of this Public License, 180 | the Licensor hereby grants You a worldwide, royalty-free, 181 | non-sublicensable, non-exclusive, irrevocable license to 182 | exercise the Licensed Rights in the Licensed Material to: 183 | 184 | a. reproduce and Share the Licensed Material, in whole or 185 | in part; and 186 | 187 | b. produce, reproduce, and Share Adapted Material. 188 | 189 | 2. Exceptions and Limitations. For the avoidance of doubt, where 190 | Exceptions and Limitations apply to Your use, this Public 191 | License does not apply, and You do not need to comply with 192 | its terms and conditions. 193 | 194 | 3. Term. The term of this Public License is specified in Section 195 | 6(a). 196 | 197 | 4. Media and formats; technical modifications allowed. The 198 | Licensor authorizes You to exercise the Licensed Rights in 199 | all media and formats whether now known or hereafter created, 200 | and to make technical modifications necessary to do so. The 201 | Licensor waives and/or agrees not to assert any right or 202 | authority to forbid You from making technical modifications 203 | necessary to exercise the Licensed Rights, including 204 | technical modifications necessary to circumvent Effective 205 | Technological Measures. For purposes of this Public License, 206 | simply making modifications authorized by this Section 2(a) 207 | (4) never produces Adapted Material. 208 | 209 | 5. Downstream recipients. 210 | 211 | a. Offer from the Licensor -- Licensed Material. Every 212 | recipient of the Licensed Material automatically 213 | receives an offer from the Licensor to exercise the 214 | Licensed Rights under the terms and conditions of this 215 | Public License. 216 | 217 | b. No downstream restrictions. You may not offer or impose 218 | any additional or different terms or conditions on, or 219 | apply any Effective Technological Measures to, the 220 | Licensed Material if doing so restricts exercise of the 221 | Licensed Rights by any recipient of the Licensed 222 | Material. 223 | 224 | 6. No endorsement. Nothing in this Public License constitutes or 225 | may be construed as permission to assert or imply that You 226 | are, or that Your use of the Licensed Material is, connected 227 | with, or sponsored, endorsed, or granted official status by, 228 | the Licensor or others designated to receive attribution as 229 | provided in Section 3(a)(1)(A)(i). 230 | 231 | b. Other rights. 232 | 233 | 1. Moral rights, such as the right of integrity, are not 234 | licensed under this Public License, nor are publicity, 235 | privacy, and/or other similar personality rights; however, to 236 | the extent possible, the Licensor waives and/or agrees not to 237 | assert any such rights held by the Licensor to the limited 238 | extent necessary to allow You to exercise the Licensed 239 | Rights, but not otherwise. 240 | 241 | 2. Patent and trademark rights are not licensed under this 242 | Public License. 243 | 244 | 3. To the extent possible, the Licensor waives any right to 245 | collect royalties from You for the exercise of the Licensed 246 | Rights, whether directly or through a collecting society 247 | under any voluntary or waivable statutory or compulsory 248 | licensing scheme. In all other cases the Licensor expressly 249 | reserves any right to collect such royalties. 250 | 251 | 252 | Section 3 -- License Conditions. 253 | 254 | Your exercise of the Licensed Rights is expressly made subject to the 255 | following conditions. 256 | 257 | a. Attribution. 258 | 259 | 1. If You Share the Licensed Material (including in modified 260 | form), You must: 261 | 262 | a. retain the following if it is supplied by the Licensor 263 | with the Licensed Material: 264 | 265 | i. identification of the creator(s) of the Licensed 266 | Material and any others designated to receive 267 | attribution, in any reasonable manner requested by 268 | the Licensor (including by pseudonym if 269 | designated); 270 | 271 | ii. a copyright notice; 272 | 273 | iii. a notice that refers to this Public License; 274 | 275 | iv. a notice that refers to the disclaimer of 276 | warranties; 277 | 278 | v. a URI or hyperlink to the Licensed Material to the 279 | extent reasonably practicable; 280 | 281 | b. indicate if You modified the Licensed Material and 282 | retain an indication of any previous modifications; and 283 | 284 | c. indicate the Licensed Material is licensed under this 285 | Public License, and include the text of, or the URI or 286 | hyperlink to, this Public License. 287 | 288 | 2. You may satisfy the conditions in Section 3(a)(1) in any 289 | reasonable manner based on the medium, means, and context in 290 | which You Share the Licensed Material. For example, it may be 291 | reasonable to satisfy the conditions by providing a URI or 292 | hyperlink to a resource that includes the required 293 | information. 294 | 295 | 3. If requested by the Licensor, You must remove any of the 296 | information required by Section 3(a)(1)(A) to the extent 297 | reasonably practicable. 298 | 299 | 4. If You Share Adapted Material You produce, the Adapter's 300 | License You apply must not prevent recipients of the Adapted 301 | Material from complying with this Public License. 302 | 303 | 304 | Section 4 -- Sui Generis Database Rights. 305 | 306 | Where the Licensed Rights include Sui Generis Database Rights that 307 | apply to Your use of the Licensed Material: 308 | 309 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 310 | to extract, reuse, reproduce, and Share all or a substantial 311 | portion of the contents of the database; 312 | 313 | b. if You include all or a substantial portion of the database 314 | contents in a database in which You have Sui Generis Database 315 | Rights, then the database in which You have Sui Generis Database 316 | Rights (but not its individual contents) is Adapted Material; and 317 | 318 | c. You must comply with the conditions in Section 3(a) if You Share 319 | all or a substantial portion of the contents of the database. 320 | 321 | For the avoidance of doubt, this Section 4 supplements and does not 322 | replace Your obligations under this Public License where the Licensed 323 | Rights include other Copyright and Similar Rights. 324 | 325 | 326 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 327 | 328 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 329 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 330 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 331 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 332 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 333 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 334 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 335 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 336 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 337 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 338 | 339 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 340 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 341 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 342 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 343 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 344 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 345 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 346 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 347 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 348 | 349 | c. The disclaimer of warranties and limitation of liability provided 350 | above shall be interpreted in a manner that, to the extent 351 | possible, most closely approximates an absolute disclaimer and 352 | waiver of all liability. 353 | 354 | 355 | Section 6 -- Term and Termination. 356 | 357 | a. This Public License applies for the term of the Copyright and 358 | Similar Rights licensed here. However, if You fail to comply with 359 | this Public License, then Your rights under this Public License 360 | terminate automatically. 361 | 362 | b. Where Your right to use the Licensed Material has terminated under 363 | Section 6(a), it reinstates: 364 | 365 | 1. automatically as of the date the violation is cured, provided 366 | it is cured within 30 days of Your discovery of the 367 | violation; or 368 | 369 | 2. upon express reinstatement by the Licensor. 370 | 371 | For the avoidance of doubt, this Section 6(b) does not affect any 372 | right the Licensor may have to seek remedies for Your violations 373 | of this Public License. 374 | 375 | c. For the avoidance of doubt, the Licensor may also offer the 376 | Licensed Material under separate terms or conditions or stop 377 | distributing the Licensed Material at any time; however, doing so 378 | will not terminate this Public License. 379 | 380 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 381 | License. 382 | 383 | 384 | Section 7 -- Other Terms and Conditions. 385 | 386 | a. The Licensor shall not be bound by any additional or different 387 | terms or conditions communicated by You unless expressly agreed. 388 | 389 | b. Any arrangements, understandings, or agreements regarding the 390 | Licensed Material not stated herein are separate from and 391 | independent of the terms and conditions of this Public License. 392 | 393 | 394 | Section 8 -- Interpretation. 395 | 396 | a. For the avoidance of doubt, this Public License does not, and 397 | shall not be interpreted to, reduce, limit, restrict, or impose 398 | conditions on any use of the Licensed Material that could lawfully 399 | be made without permission under this Public License. 400 | 401 | b. To the extent possible, if any provision of this Public License is 402 | deemed unenforceable, it shall be automatically reformed to the 403 | minimum extent necessary to make it enforceable. If the provision 404 | cannot be reformed, it shall be severed from this Public License 405 | without affecting the enforceability of the remaining terms and 406 | conditions. 407 | 408 | c. No term or condition of this Public License will be waived and no 409 | failure to comply consented to unless expressly agreed to by the 410 | Licensor. 411 | 412 | d. Nothing in this Public License constitutes or may be interpreted 413 | as a limitation upon, or waiver of, any privileges and immunities 414 | that apply to the Licensor or You, including from the legal 415 | processes of any jurisdiction or authority. 416 | 417 | 418 | ======================================================================= 419 | 420 | Creative Commons is not a party to its public 421 | licenses. Notwithstanding, Creative Commons may elect to apply one of 422 | its public licenses to material it publishes and in those instances 423 | will be considered the “Licensor.” The text of the Creative Commons 424 | public licenses is dedicated to the public domain under the CC0 Public 425 | Domain Dedication. Except for the limited purpose of indicating that 426 | material is shared under a Creative Commons public license or as 427 | otherwise permitted by the Creative Commons policies published at 428 | creativecommons.org/policies, Creative Commons does not authorize the 429 | use of the trademark "Creative Commons" or any other trademark or logo 430 | of Creative Commons without its prior written consent including, 431 | without limitation, in connection with any unauthorized modifications 432 | to any of its public licenses or any other arrangements, 433 | understandings, or agreements concerning use of licensed material. For 434 | the avoidance of doubt, this paragraph does not form part of the 435 | public licenses. 436 | 437 | Creative Commons may be contacted at creativecommons.org. 438 | ``` 439 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # A quick introduction to machine learning 2 | 3 | **Author:** [Leonardo Uieda](https://www.leouieda.com/) 4 | 5 | This is a very brief hands-on introduction to machine learning. 6 | It will cover some of the common nomenclature, principles, and applications. 7 | 8 | [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/leouieda/ml-intro/HEAD?labpath=tutorial.ipynb) 9 | 10 | ## 📓 • Jupyter Notebook 11 | 12 | The tutorial is in the form of a Jupyter notebook (`tutorial.ipynb`). 13 | Here are some options for using it: 14 | 15 | * [Download the notebook](https://github.com/leouieda/ml-intro/archive/refs/heads/main.zip) and run it on your machine (**preferred**). 16 | * [Run it online on Binder](https://mybinder.org/v2/gh/leouieda/ml-intro/HEAD?labpath=tutorial.ipynb) which lets you try out the code and experiment but will **not save your progress**. 17 | * [View it online on nbviewer](https://nbviewer.org/github/leouieda/ml-intro/blob/main/tutorial.ipynb) to read the text and look at the code but not run it. 18 | 19 | ## 🧑🏿‍💻 • Learner profile 20 | 21 | * Is currently in their final year of a STEM undergraduate degree or early years of a postgraduate degree. 22 | * Has studies the basics of statistics, Python programming, and linear algebra. 23 | * Is interested in using machine learning in their projects or as a future career. 24 | 25 | ## 🧑‍🏫 • For instructors 26 | 27 | The tutorial is designed to be taught as a 1-2 hour session with **live-coding**. 28 | To do so, create a copy of the notebook and delete all or most of the code cells 29 | (it's OK to leave some in to allow more time in the tutorial). 30 | 31 | Type in the code as you explain what you're doing. 32 | This will help you control your pacing and avoid going too fast. 33 | It also opens up the opportunity for you to make mistakes and teach students 34 | how to identify and solve them. 35 | 36 | Ideally, have them follow along on their own computers, typing in the code with you. 37 | Make sure you also share a copy of the pre-filled notebook with students so that 38 | they can choose to not type and listen at the same time. 39 | 40 | ## ⚖️ • License 41 | 42 | The original material for this tutorial can be found at [leouieda/ml-intro](https://github.com/leouieda/ml-intro). 43 | Comments, corrections, and additions are welcome. 44 | 45 | All Python source code is made available under the BSD 3-clause license. You 46 | can freely use and modify the code, without warranty, so long as you provide 47 | attribution to the authors. 48 | 49 | Unless otherwise specified, all figures and Jupyter notebooks are available 50 | under the [Creative Commons Attribution 4.0 License (CC-BY)](https://creativecommons.org/licenses/by/4.0/). 51 | 52 | The full text of these licenses is provided in the [`LICENSE.txt`](LICENSE.txt) 53 | file. -------------------------------------------------------------------------------- /environment.yml: -------------------------------------------------------------------------------- 1 | name: ml-intro 2 | channels: 3 | - conda-forge 4 | - defaults 5 | dependencies: 6 | - python==3.9 7 | - pip 8 | - numpy 9 | - pandas 10 | - matplotlib 11 | - scikit-learn 12 | - seaborn 13 | - jupyter 14 | - jupyterlab 15 | -------------------------------------------------------------------------------- /tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/leouieda/ml-intro/a6a9d072133729f3cc7f0c2cfe5b445e122ab9b6/tutorial.pdf --------------------------------------------------------------------------------