updated intro

This commit is contained in:
mhjensen
2019-06-10 22:48:38 -04:00
parent 3fdabd3871
commit eb4a233c9d
47 changed files with 1830 additions and 3411 deletions
+69 -61
View File
@@ -10,9 +10,9 @@
"<!-- Author: --> \n",
"**Morten Hjorth-Jensen**, Department of Physics, University of Oslo and Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University\n",
"\n",
"Date: **May 28, 2018**\n",
"Date: **Jun 10, 2019**\n",
"\n",
"Copyright 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license\n",
"Copyright 1999-2019, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license\n",
"\n",
"\n",
"\n",
@@ -20,14 +20,24 @@
"\n",
"## Introduction\n",
"\n",
"Statistics, data science and machine learning form important fields of\n",
"research in modern science. They describe how to learn and make\n",
"predictions from data, as well as allowing us to extract important\n",
"correlations about physical process and the underlying laws of motion\n",
"in large data sets. The latter, big data sets, appear frequently in\n",
"essentially all disciplines, from the traditional Science, Technology,\n",
"Mathematics and Engineering fields to Life Science, Law, education\n",
"research, the Humanities and the Social Sciences. \n",
"During the last two decades there has been a swift and amazing\n",
"development of Machine Learning techniques and algorithms that impact\n",
"many areas in not only Science and Technology but also the Humanities,\n",
"Social Sciences, Medicine, Law, indeed, almost all possible\n",
"disciplines. The applications are incredibly many, from self-driving\n",
"cars to solving high-dimensional differential equations or complicated\n",
"quantum mechanical many-body problems. Machine Learning is perceived\n",
"by many as one of the main disruptive techniques nowadays. \n",
"\n",
"Statistics, Data science and Machine Learning form important\n",
"fields of research in modern science. They describe how to learn and\n",
"make predictions from data, as well as allowing us to extract\n",
"important correlations about physical process and the underlying laws\n",
"of motion in large data sets. The latter, big data sets, appear\n",
"frequently in essentially all disciplines, from the traditional\n",
"Science, Technology, Mathematics and Engineering fields to Life\n",
"Science, Law, education research, the Humanities and the Social\n",
"Sciences.\n",
"\n",
"It has become more\n",
"and more common to see research projects on big data in for example\n",
@@ -87,7 +97,7 @@
"<!-- !split -->\n",
"## Learning outcomes\n",
"\n",
"These setsof lectures aim at giving you an overview of central aspects of\n",
"These sets of lectures aim at giving you an overview of central aspects of\n",
"statistical data analysis as well as some of the central algorithms\n",
"used in machine learning. We will introduce a variety of central\n",
"algorithms and methods essential for studies of data analysis and\n",
@@ -95,17 +105,17 @@
"\n",
"Hands-on projects and experimenting with data and algorithms plays a central role in\n",
"these lectures, and our hope is, through the various\n",
"projects and exercies, to expose you to fundamental\n",
"projects and exercises, to expose you to fundamental\n",
"research problems in these fields, with the aim to reproduce state of\n",
"the art scientific results. You will learn to develop and\n",
"structure large codes for studying these systems, get acquainted with\n",
"structure codes for studying these systems, get acquainted with\n",
"computing facilities and learn to handle large scientific projects. A\n",
"good scientific and ethical conduct is emphasized throughout the\n",
"course. More specifically, you will\n",
"\n",
"1. learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;\n",
"1. Learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;\n",
"\n",
"2. be capable of extending the acquired knowledge to other systems and cases;\n",
"2. Be capable of extending the acquired knowledge to other systems and cases;\n",
"\n",
"3. Have an understanding of central algorithms used in data analysis and machine learning;\n",
"\n",
@@ -117,24 +127,24 @@
"\n",
"7. Work on numerical projects to illustrate the theory. The projects play a central role and you are expected to know modern programming languages like Python or C++, in addition to a basic knowledge of linear algebra (typically taught during the first one or two years of undergraduate studies).\n",
"\n",
"There are several topics we will cover here, spanning from a\n",
"statistical data analysis and its basic concepts such expectation\n",
"There are several topics we will cover here, spanning from \n",
"statistical data analysis and its basic concepts such as expectation\n",
"values, variance, covariance, correlation functions and errors, via\n",
"well-known probability distribution functions like uniform\n",
"well-known probability distribution functions like the uniform\n",
"distribution, the binomial distribution, the Poisson distribution and\n",
"simple and multivariate normal distributions to central elements of\n",
"Bayesian statistics and modeling. We will also remind the reader about\n",
"central elements from linear algebra and standard methods based on\n",
"linear algebra used to fit functions such Cubic splines and gradient\n",
"methods for data optimization and the Singular-value decomposition and\n",
"linear algebra used to optimize (minimize) functions (the family of gradient descent methods)\n",
"and the Singular-value decomposition and\n",
"least square methods for parameterizing data.\n",
"\n",
"We will also cover Monte Carlo methods, Markov chains, well-known\n",
"algorithms for sampling stochastic events like the Metropolis-Hastings\n",
"and Gibbs sampling methods. An important aspect of all our\n",
"calculations is a proper estimation of errors. Here we will also\n",
"discuss famous resampling techniques like the blocking, bootstrapping\n",
"and jackknife methods.\n",
"discuss famous resampling techniques like the blocking, the bootstrapping\n",
"and the jackknife methods and the infamous bias-variance tradeoff. \n",
"\n",
"The second part of the material covers several algorithms used in\n",
"machine learning.\n",
@@ -169,8 +179,12 @@
"The methods we cover have three main topics in common, irrespective of\n",
"whether we deal with supervised or unsupervised learning. The first\n",
"ingredient is normally our data set (which can be subdivided into\n",
"training and test data), the second item is a model which is normally a\n",
"function of some parameters. The model reflects our knowledge of the system (or lack thereof). As an example, if we know that our data show a behavior similar to what would be predicted by a polynomial, fitting our data to a polynomial of some degree would then determin our model. \n",
"training and test data), the second item is a model which is normally\n",
"a function of some parameters. The model reflects our knowledge of\n",
"the system (or lack thereof). As an example, if we know that our data\n",
"show a behavior similar to what would be predicted by a polynomial,\n",
"fitting our data to a polynomial of some degree would then determin\n",
"our model.\n",
"\n",
"The last ingredient is a so-called **cost**\n",
"function which allows us to present an estimate on how good our model\n",
@@ -181,39 +195,32 @@
"analysis, stochastic processes etc. We will discuss the following\n",
"machine learning algorithms\n",
"\n",
"1. Linear regression and its variants, in essence polynomial regression\n",
"1. Linear regression and its variants\n",
"\n",
"2. Decision tree algorithms, from simpler to more complex ones\n",
"2. Decision tree algorithms, from single trees to random forests\n",
"\n",
"3. Nearest neighbors models\n",
"3. Bayesian statistics and regression\n",
"\n",
"4. Bayesian statistics and regression\n",
"4. Support vector machines and finally various variants of\n",
"\n",
"5. Support vector machines and finally various variants of\n",
"5. Artifical neural networks and deep learning, including convolutional neural networks and Bayesian neural networks\n",
"\n",
"6. Artifical neural networks and deep learning\n",
"\n",
"7. Networks for unsupervised learning using for example reduced Boltzmann machines.\n",
"6. Networks for unsupervised learning using for example reduced Boltzmann machines.\n",
"\n",
"## Choice of programming language\n",
"\n",
"Python plays nowadays a central role in the development of machine\n",
"learning techniques and tools for data analysis. In particular, seen\n",
"the wealth of machine learning and data analysis packages written in\n",
"the wealth of machine learning and data analysis libraries written in\n",
"Python, easy to use libraries with immediate visualization(and not the\n",
"least impressive galleries of existing example), the popularity of the\n",
"least impressive galleries of existing examples), the popularity of the\n",
"Jupyter notebook framework with the possibility to run **R** codes or\n",
"compiled programs written in C++, and much more made our choice of\n",
"programming language for this series of lectures of easy. However,\n",
"since the focus here is not only on using existing Python tools such\n",
"as **scikit-learn** or **tensorflow**, but also on developing your own\n",
"programming language for this series of lectures easy. However,\n",
"since the focus here is not only on using existing Python libraries such\n",
"as **Scikit-Learn** or **Tensorflow**, but also on developing your own\n",
"algorithms and codes, we will as far as possible present many of these\n",
"algorithms eithers a Python codes or C++ codes. Finally, we will, as\n",
"far as possible keep parallel versions of the data analysis and\n",
"machine larning programming aspects in **R** as\n",
"well. [R](https://www.r-project.org/) is a language and environment\n",
"for statistical computing and graphics which is widely used in\n",
"statistics and mathematics applications.\n",
"algorithms either as a Python codes or C++ or Fortran (or other languages) codes. \n",
"\n",
"The reason we also focus on compiled languages like C++ (or\n",
"Fortran), is that Python is still notoriously slow when we do not\n",
@@ -221,7 +228,7 @@
"[Lapack](http://www.netlib.org/lapack/) or other numerical libraries\n",
"written in compiled languages (many of these libraries are written in\n",
"Fortran). Although a project like [Numba](https://numba.pydata.org/)\n",
"holds great promise for speeding up the unrolling of lengthy loops, C+\n",
"holds great promise for speeding up the unrolling of lengthy loops, C++\n",
"and Fortran are presently still the performance winners. Numba gives\n",
"you potentially the power to speed up your applications with high\n",
"performance functions written directly in Python. In particular,\n",
@@ -242,14 +249,14 @@
"be analyzed. Most of the applications we will discuss deal with\n",
"small data sets (less than a terabyte of information) and can easily\n",
"be analyzed and tested on standard off the shelf laptops you find in general \n",
"grocery stores.\n",
"stores.\n",
"\n",
"## Data handling, machine learning and ethical aspects\n",
"\n",
"In most of the cases we will study, we will either generate the data\n",
"to analyze ourselves (both for supervised learning and unsupervised\n",
"learning) or we will recur again and again to data present in say\n",
"**scikit-learn** or **tensorflow**. Many of the examples we end up\n",
"**Scikit-Learn** or **Tensorflow**. Many of the examples we end up\n",
"dealing with are from a privacy and data protection point of view,\n",
"rather inoccuous and boring results of numerical\n",
"calculations. However, this does not hinder us from developing a sound\n",
@@ -264,7 +271,7 @@
"and data sets we have used, freely and easily accessible to a wider\n",
"community. This helps us almost automagically in making our science\n",
"reproducible. The large open-source development communities involved\n",
"in say [Scikit-learn](http://scikit-learn.org/stable/),\n",
"in say [Scikit-Learn](http://scikit-learn.org/stable/),\n",
"[Tensorflow](https://www.tensorflow.org/),\n",
"[PyTorch](http://pytorch.org/) and [Keras](https://keras.io/), are\n",
"all excellent examples of this. The codes can be tested and improved\n",
@@ -273,23 +280,23 @@
"easier today to gain traction and acceptance for making your science\n",
"reproducible. From a societal stand, this is an important element\n",
"since many of the developers are employees of large public institutions like\n",
"universities and research labs. Our taxpayer do deserve to get\n",
"universities and research labs. Our fellow taxpayers do deserve to get\n",
"something back for their bucks.\n",
"\n",
"However, this more mechanical aspect of the ethics of science (in\n",
"particular the reproducibility of scientific results) is something\n",
"which is obvious and everybody should do as part of the dialectics of\n",
"which is obvious and everybody should do so as part of the dialectics of\n",
"science. The fact that many scientists are not willing to share their codes or \n",
"data is detrimental to the scientific discourse.\n",
"\n",
"Before we proceed, we should add a disclaimer. Even though\n",
"we may dream of computers developing some kind of higher learning\n",
"capabilities, at the end (even if the artificial intelligence\n",
"community keeps touting our ears full of fancy futuristic avenues), it is we\n",
"community keeps touting our ears full of fancy futuristic avenues), it is we, yes you reading these lines,\n",
"who end up constructing and instructing, via various algorithms, the\n",
"computers. Self-driving cars for example, rely on sofisticated\n",
"machine learning approaches. Self-driving cars for example, rely on sofisticated\n",
"programs which take into account all possible situations a car can\n",
"encounter. In addition, extensive usage of training datas from GPS\n",
"encounter. In addition, extensive usage of training data from GPS\n",
"information, maps etc, are typically fed into the software for\n",
"self-driving cars. Adding to this various sensors and cameras that\n",
"feed information to the programs, there are zillions of ethical issues\n",
@@ -299,8 +306,8 @@
"learning algorithms discussed here enter into the codes, at a certain\n",
"stage we have to make choices. Yes, we , the lads and lasses who wrote\n",
"a program for a specific brand of a self-driving car. As an example,\n",
"a most carmakers have as their utmost priority the security of the\n",
"driver and the accompanying passengers. A famous carmaker, which is\n",
"all carmakers have as their utmost priority the security of the\n",
"driver and the accompanying passengers. A famous European carmaker, which is\n",
"one of the leaders in the market of self-driving cars, had **if**\n",
"statements of the following type: suppose there are two obstacles in\n",
"front of you and you cannot avoid to collide with one of them. One of\n",
@@ -310,9 +317,9 @@
"the likelihood of surving a collision with our future citizens, is\n",
"much higher.\n",
"\n",
"This brings us leads then to serious ethical aspects. Why should we\n",
"This leads to serious ethical aspects. Why should we\n",
"opt for such an option? Who decides and who is entitled to make such\n",
"choices? Keep in mind that many of the algorithms you will about in\n",
"choices? Keep in mind that many of the algorithms you will encounter in\n",
"this series of lectures or hear about later, are indeed based on\n",
"simple programming instructions. And you are very likely to be one of\n",
"the people who may end up writing such a code. Thus, developing a\n",
@@ -324,15 +331,16 @@
"not weighting some data in a particular way, perhaps because you dearly want a\n",
"specific conclusion which may support your political views?\n",
"\n",
"We do not have the answers here, but we want you think over these\n",
"topics in a more overarching way. A statistical data analysis with\n",
"its dry numbers and graphs meant to guide the eye, do not necessarily\n",
"We do not have the answers here, nor will we venture into a deeper\n",
"discussions of these aspects, but we want you think over these topics\n",
"in a more overarching way. A statistical data analysis with its dry\n",
"numbers and graphs meant to guide the eye, does not necessarily\n",
"reflect the truth, whatever that is. As a scientist, and after a\n",
"university education, you are supposedly a better citizen, with an\n",
"improved critical view and understanding of the scientific method, and\n",
"perhaps some deeper understandings of the ethics of science at\n",
"perhaps some deeper understanding of the ethics of science at\n",
"large. Use these insights. Be a critical citizen. You owe it to our\n",
"societies.\n",
"society.\n",
"\n",
"\n",
"\n",