<jupyter_start><jupyter_text>*This notebook is part of  course materials for CS 345: Machine Learning Foundations and Practice at Colorado State University.Original versions were created by <NAME>.The content is availabe [on GitHub](https://github.com/asabenhur/CS345).**The text is released under the [CC BY-SA license](https://creativecommons.org/licenses/by-sa/4.0/), and code is released under the [MIT license](https://opensource.org/licenses/MIT).*     CS345 Course introduction  What is machine learning**Machine learning:**  the construction and study of systems that learn from data. Machine learning is an interdisciplinary field that requires background in multiple areas:* Linear algebra for working with vectors and matrices* Statistics and probability for reasoning about uncertainty* Calculus for optimization* Programming for efficient implementation of the algorithms  Supervised learningExample problem:  handwritten digit recognition.Some examples from the [MNIST dataset](https://en.wikipedia.org/wiki/MNIST_database):  Course objectivesThe machine learning toolbox:* Formulating a problem as an ML problem* Understanding a variety of ML algorithms* Running and interpreting ML experiments* Understanding what makes ML work – theory and practice  PythonWhy Pytnon?* A concise and intuitive language* Simple, easy to learn syntax* Highly readable, compact code* Supports object oriented and functional programming* Strong support for integration with other languages (C,C++,Java)* Cross-platform compatibility* Free* Makes programming fun!**We assume you already know the basics of Python**.  The website has some resources you can use to come up to speed.  The author of the textbook we are using has a set of notebooks for learning Python:[A Whirlwind Tour of the Python Language](https://github.com/jakevdp/WhirlwindTourOfPython). Why Python for machine learningOver the past decade or so Python has emerged as one of the primary data science / machine learning languages.  In addition to the points mentioned above, here are a few additional aspects of Python that make it great for data science:* An interpreted language – allows for interactive data analysis* Libraries for plotting and vector/matrix computation* Many machine learning packages available:  scikit-learn, TensorFlow, PyTorch* Language of choice for many ML practitioners (other options: R)![image](https://scikit-learn.org/stable/_images/sphx_glr_plot_classifier_comparison_001.png) The tools we will cover in this course:* ``Numpy``:  highly efficient manipulation of vectors and matrices* ``Matplotlib``: data visualization  Python version and environmentUse version 3.X of Python.If setting up Python on your personal machine, we recommend the [anaconda](https://www.anaconda.com/distribution/) Python distribution which is a data-science oriented distribution that includes all the tools we will use in this course.  IPython and the Jupyter Notebook The Jupyter notebook is a browser-based interface to the ``IPython`` Python shell.In addition to executing Python/IPython statements, the notebook allows the user to include formatted text, static and dynamic visualizations, mathematical equations, and much more. **It is the standard way of sharing data science analyses.**To invoke the jupyter notebook use the command:```bashjupyter notebook```which brings up the Jupyter notebook browser.  To open a specific notebook:```bash jupyter notebook notebook_name.ipynb``` There are two primary types of cells in Jupyter:<jupyter_code># this is a code cell<jupyter_output><empty_output><jupyter_text>This is a **markdown** cell.  You can type *text* and good looking equations $$f(x) = \frac{1}{2\pi} e^{-2 x^2 / \sigma^2}$$<jupyter_code>print("Hello world!")
2 + 2<jupyter_output><empty_output><jupyter_text>You can run shell commands:<jupyter_code>!ls<jupyter_output><empty_output><jupyter_text>The `%` sign is used for *magic commands*, which are iPython shell commands.  For example, to find what other magic commands there are<jupyter_code>%lsmagic<jupyter_output><empty_output><jupyter_text>The `%timeit` magic is one that we will use quite regularly.  Let's learn what it's for:<jupyter_code>%timeit?<jupyter_output><empty_output><jupyter_text>Now try this:<jupyter_code>import antigravity<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0729504400185271, 'fraction_numerical': 0.005094951366373321, 'mean_word_length': 6.06873977086743, 'pattern_counts': {'":': 0, '<': 26, '<?xml version=': 0, '>': 26, 'https://': 7, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '581030', 'license': 'MIT', 'n_tokens_mistral': 1139, 'n_tokens_neox': 1084, 'n_words': 506, 'path': 'notebooks/module01_01_intro.ipynb', 'repo_name': 'lottieandrews/CS345', 'size': '4323'}