479 lines
19 KiB
HTML
479 lines
19 KiB
HTML
\
|
|
<!DOCTYPE html>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
<meta name="generator" content="DocOnce: https://github.com/hplgit/doconce/" />
|
|
<meta name="description" content="Data Analysis and Machine Learning: Representing data">
|
|
|
|
<title>Data Analysis and Machine Learning: Representing data</title>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- reveal.js: http://lab.hakim.se/reveal-js/ -->
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
|
|
|
<meta name="apple-mobile-web-app-capable" content="yes" />
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui">
|
|
|
|
<link rel="stylesheet" href="reveal.js/css/reveal.css">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/beige.css" id="theme">
|
|
<!--
|
|
<link rel="stylesheet" href="reveal.js/css/reveal.css">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/beige.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/beigesmall.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/solarized.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/serif.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/night.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/moon.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/simple.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/sky.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/darkgray.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/default.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/cbc.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/simula.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/black.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/white.css" id="theme">
|
|
<link rel="stylesheet" href="reveal.js/css/theme/league.css" id="theme">
|
|
-->
|
|
|
|
<!-- For syntax highlighting -->
|
|
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
|
|
|
|
<!-- Printing and PDF exports -->
|
|
<script>
|
|
var link = document.createElement( 'link' );
|
|
link.rel = 'stylesheet';
|
|
link.type = 'text/css';
|
|
link.href = window.location.search.match( /print-pdf/gi ) ? 'css/print/pdf.css' : 'css/print/paper.css';
|
|
document.getElementsByTagName( 'head' )[0].appendChild( link );
|
|
</script>
|
|
|
|
<style type="text/css">
|
|
hr { border: 0; width: 80%; border-bottom: 1px solid #aaa}
|
|
p.caption { width: 80%; font-size: 60%; font-style: italic; text-align: left; }
|
|
hr.figure { border: 0; width: 80%; border-bottom: 1px solid #aaa}
|
|
.reveal .alert-text-small { font-size: 80%; }
|
|
.reveal .alert-text-large { font-size: 130%; }
|
|
.reveal .alert-text-normal { font-size: 90%; }
|
|
.reveal .alert {
|
|
padding:8px 35px 8px 14px; margin-bottom:18px;
|
|
text-shadow:0 1px 0 rgba(255,255,255,0.5);
|
|
border:5px solid #bababa;
|
|
-webkit-border-radius: 14px; -moz-border-radius: 14px;
|
|
border-radius:14px;
|
|
background-position: 10px 10px;
|
|
background-repeat: no-repeat;
|
|
background-size: 38px;
|
|
padding-left: 30px; /* 55px; if icon */
|
|
}
|
|
.reveal .alert-block {padding-top:14px; padding-bottom:14px}
|
|
.reveal .alert-block > p, .alert-block > ul {margin-bottom:1em}
|
|
/*.reveal .alert li {margin-top: 1em}*/
|
|
.reveal .alert-block p+p {margin-top:5px}
|
|
/*.reveal .alert-notice { background-image: url(http://hplgit.github.io/doconce/bundled/html_images/small_gray_notice.png); }
|
|
.reveal .alert-summary { background-image:url(http://hplgit.github.io/doconce/bundled/html_images/small_gray_summary.png); }
|
|
.reveal .alert-warning { background-image: url(http://hplgit.github.io/doconce/bundled/html_images/small_gray_warning.png); }
|
|
.reveal .alert-question {background-image:url(http://hplgit.github.io/doconce/bundled/html_images/small_gray_question.png); } */
|
|
|
|
</style>
|
|
|
|
|
|
|
|
<!-- Styles for table layout of slides -->
|
|
<style type="text/css">
|
|
td.padding {
|
|
padding-top:20px;
|
|
padding-bottom:20px;
|
|
padding-right:50px;
|
|
padding-left:50px;
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
<div class="reveal">
|
|
|
|
<!-- Any section element inside the <div class="slides"> container
|
|
is displayed as a slide -->
|
|
|
|
<div class="slides">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<section>
|
|
<!-- ------------------- main content ---------------------- -->
|
|
|
|
|
|
|
|
<center><h1 style="text-align: center;">Data Analysis and Machine Learning: Representing data</h1></center> <!-- document title -->
|
|
|
|
<p>
|
|
<!-- author(s): Morten Hjorth-Jensen -->
|
|
|
|
<center>
|
|
<b>Morten Hjorth-Jensen</b> [1, 2]
|
|
</center>
|
|
|
|
<p> <br>
|
|
<!-- institution(s) -->
|
|
|
|
<center>[1] <b>Department of Physics, University of Oslo</b></center>
|
|
<center>[2] <b>Department of Physics and Astronomy and National Superconducting Cyclotron Laboratory, Michigan State University</b></center>
|
|
<br>
|
|
<p> <br>
|
|
<center><h4>May 22, 2018</h4></center> <!-- date -->
|
|
<br>
|
|
<p>
|
|
|
|
<center style="font-size:80%">
|
|
<!-- copyright --> © 1999-2018, Morten Hjorth-Jensen. Released under CC Attribution-NonCommercial 4.0 license
|
|
</center>
|
|
</section>
|
|
|
|
|
|
<section>
|
|
<h2 id="___sec0">Introduction </h2>
|
|
|
|
<p>
|
|
Statistics, data science and machine learning form important fields of
|
|
research in modern science. They describe how to learn and make
|
|
predictions from data, as well as allowing us to extract important
|
|
correlations about physical process and the underlying laws of motion
|
|
in large data sets. The latter, big data sets, appear
|
|
frequently in essentially all disciplines, from the traditional Science,
|
|
Technology, Mathematics and Engineering fields to Life Science, Law, education research,
|
|
the Humanities and
|
|
the Social Sciences. It has become more and more common to see
|
|
research projects on big data in for example the Social
|
|
Sciences where extracting patterns from complicated survey data is one of many research directions.
|
|
Having a solid grasp of data analysis and machine learning
|
|
is thus becoming central to scientific computing in many
|
|
fields, and competences and skills within the fields of machine learning
|
|
and scientific computing are nowadays strongly requested by many
|
|
potential employers. The latter cannot be overstated, familiarity with
|
|
machine learning has almost become a prerequisite for many of the most
|
|
exciting employment opportunities, whether they are in bioinformatics,
|
|
life science, physics or finance, in the private or the public
|
|
sector. This author has had several students or met students who have
|
|
been hired recently based on their skills and competences in
|
|
scientific computing and data science, often with marginal knowledge
|
|
of machine learning.
|
|
|
|
<p>
|
|
Machine learning is a subfield of computer science, and is closely
|
|
related to computational statistics. It evolved from the study of
|
|
pattern recognition in artificial intelligence (AI) research, and has
|
|
made contributions to AI tasks like computer vision, natural language
|
|
processing and speech recognition.
|
|
Machine learning represents the
|
|
science of giving computers the ability to learn without being
|
|
explicitly programmed. The idea is that there exist generic
|
|
algorithms which can be used to find patterns in a broad class of data
|
|
sets without having to write code specifically for each problem. The
|
|
algorithm will build its own logic based on the data.
|
|
|
|
<p>
|
|
Machine learning is an extremely rich field, in spite of its young age. The
|
|
increases we have seen during the last three decades in computational
|
|
capabilities have been followed by developments of methods and
|
|
techniques for analyzing and handling large date sets, relying heavily
|
|
on statistics, computer science and mathematics. The field is rather
|
|
new and developing rapidly. Popular software packages written in
|
|
Python for machine learning like <a href="http://scikit-learn.org/stable/" target="_blank">Scikit-learn</a>, <a href="https://www.tensorflow.org/" target="_blank">Tensorflow</a>,
|
|
<a href="http://pytorch.org/" target="_blank">PyTorch</a> and <a href="https://keras.io/" target="_blank">Keras</a>, all freely available at their respective GitHub sites,
|
|
encompass communities of developers in the thousands or more. And the number
|
|
of code developers and contributors keeps increasing. Not all the
|
|
algorithms and methods can be given a rigorous mathematical
|
|
justification, opening up thereby large rooms for experimenting
|
|
and trial and error and thereby exciting new developments.
|
|
However, a solid command of linear algebra, multivariate theory,
|
|
probability theory, statistical data analysis,
|
|
understanding errors and Monte Carlo methods are central elements in a proper understanding of many of
|
|
algorithms and methods we will discuss.
|
|
</section>
|
|
|
|
|
|
<section>
|
|
<h2 id="___sec1">Learning outcomes </h2>
|
|
|
|
<p>
|
|
These lectures aim at giving you an overview of central aspects of
|
|
statistical data analysis as well as some of the central algorithms
|
|
used in machine learning. We will introduce a variety of central
|
|
algorithms and methods essential for studies of data analysis and
|
|
machine learning.
|
|
|
|
<p>
|
|
Hands-on projects and experimenting with data and algorithms plays a central role in
|
|
these lectures, and our hope is, through the various
|
|
projects and exercies, to expose you to fundamental
|
|
research problems in these fields, with the aim to reproduce state of
|
|
the art scientific results. You will learn to develop and
|
|
structure large codes for studying these systems, get acquainted with
|
|
computing facilities and learn to handle large scientific projects. A
|
|
good scientific and ethical conduct is emphasized throughout the
|
|
course. More specifically, you will
|
|
|
|
<ol>
|
|
<p><li> learn about basic data analysis, Bayesian statistics, Monte Carlo methods, data optimization and machine learning;</li>
|
|
<p><li> be capable of extending the acquired knowledge to other systems and cases;</li>
|
|
<p><li> Have an understanding of central algorithms used in data analysis and machine learning;</li>
|
|
<p><li> Gain knowledge of central aspects of Monte Carlo methods, Markov chains, Gibbs samplers and their possible applications, from numerical integration to simulation of stock markets;</li>
|
|
<p><li> Understand methods for regression and classification;</li>
|
|
<p><li> Learn about neural network, genetic algorithms and Boltzmann machines;</li>
|
|
<p><li> 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).</li>
|
|
</ol>
|
|
<p>
|
|
|
|
There are several topics we will cover here, spanning from a
|
|
statistical data analysis and its basic concepts such expectation
|
|
values, variance, covariance, correlation functions and errors, via
|
|
well-known probability distribution functions like uniform
|
|
distribution, the binomial distribution, the Poisson distribution and
|
|
simple and multivariate normal distributions to central elements of
|
|
Bayesian statistics and modeling. We will also remind the reader about
|
|
central elements from linear algebra and standard methods based on
|
|
linear algebra used to fit functions such Cubic splines and gradient
|
|
methods for data optimization and the Singular-value decomposition and
|
|
least square methods for parameterizing data.
|
|
|
|
<p>
|
|
We will also cover Monte Carlo methods, Markov chains, well-known
|
|
algorithms for sampling stochastic events like the Metropolis-Hastings
|
|
and Gibbs sampling methods. An important aspect of all our
|
|
calculations is a proper estimation of errors. Here we will also
|
|
discuss famous resampling techniques like the blocking, bootstrapping
|
|
and jackknife methods.
|
|
|
|
<p>
|
|
The second part of the material covers several algorithms used in
|
|
machine learning.
|
|
</section>
|
|
|
|
|
|
<section>
|
|
<h2 id="___sec2">Types of Machine Learning </h2>
|
|
|
|
<p>
|
|
The approaches to machine learning are many, but are often split into two main categories.
|
|
In <em>supervised learning</em> we know the answer to a problem,
|
|
and let the computer deduce the logic behind it. On the other hand, <em>unsupervised learning</em>
|
|
is a method for finding patterns and relationship in data sets without any prior knowledge of the system.
|
|
Some authours also operate with a third category, namely <em>reinforcement learning</em>. This is a paradigm
|
|
of learning inspired by behavioral psychology, where learning is achieved by trial-and-error,
|
|
solely from rewards and punishment.
|
|
|
|
<p>
|
|
Another way to categorize machine learning tasks is to consider the desired output of a system.
|
|
Some of the most common tasks are:
|
|
|
|
<ul>
|
|
|
|
<p><li> Classification: Outputs are divided into two or more classes. The goal is to produce a model that assigns inputs into one of these classes. An example is to identify digits based on pictures of hand-written ones. Classification is typically supervised learning.</li>
|
|
|
|
<p><li> Regression: Finding a functional relationship between an input data set and a reference data set. The goal is to construct a function that maps input data to continuous output values.</li>
|
|
|
|
<p><li> Clustering: Data are divided into groups with certain common traits, without knowing the different groups beforehand. It is thus a form of unsupervised learning.</li>
|
|
</ul>
|
|
<p>
|
|
|
|
The methods we cover have three main topics in common, irrespective of
|
|
whether we deal with supervised or unsupervised learning. The first
|
|
ingredient is normally our data set, the second is a model which is
|
|
normally a function of some parameters. The last ingredient is a
|
|
so-called <b>cost</b> function which allows us to present an estimate on
|
|
how good our model is in reproducing the data it is supposed to train.
|
|
|
|
<p>
|
|
Here we will build our machine learning approach on elements of the
|
|
statistical foundation discussed above, with elements from data
|
|
analysis, stochastic processes etc. We will discuss the following
|
|
machine learning algorithms
|
|
|
|
<ol>
|
|
<p><li> Linear regression and its variants, in essence polynomial regression</li>
|
|
<p><li> Decision tree algorithms, from simpler to more complex ones</li>
|
|
<p><li> Nearest neighbors models</li>
|
|
<p><li> Bayesian statistics and regression</li>
|
|
<p><li> Support vector machines and finally various variants of</li>
|
|
<p><li> Artifical neural networks and deep learning</li>
|
|
</ol>
|
|
</section>
|
|
|
|
|
|
<section>
|
|
<h2 id="___sec3">Why this text? </h2>
|
|
</section>
|
|
|
|
|
|
<section>
|
|
<h2 id="___sec4">Choice of programming language </h2>
|
|
</section>
|
|
|
|
|
|
<section>
|
|
<h2 id="___sec5">Data handling, machine learning and ethical aspects </h2>
|
|
</section>
|
|
|
|
|
|
<section>
|
|
<h2 id="___sec6">Acknowledgements </h2>
|
|
</section>
|
|
|
|
|
|
|
|
</div> <!-- class="slides" -->
|
|
</div> <!-- class="reveal" -->
|
|
|
|
<script src="reveal.js/lib/js/head.min.js"></script>
|
|
<script src="reveal.js/js/reveal.js"></script>
|
|
|
|
<script>
|
|
// Full list of configuration options available here:
|
|
// https://github.com/hakimel/reveal.js#configuration
|
|
Reveal.initialize({
|
|
|
|
// Display navigation controls in the bottom right corner
|
|
controls: true,
|
|
|
|
// Display progress bar (below the horiz. slider)
|
|
progress: true,
|
|
|
|
// Display the page number of the current slide
|
|
slideNumber: true,
|
|
|
|
// Push each slide change to the browser history
|
|
history: false,
|
|
|
|
// Enable keyboard shortcuts for navigation
|
|
keyboard: true,
|
|
|
|
// Enable the slide overview mode
|
|
overview: true,
|
|
|
|
// Vertical centering of slides
|
|
//center: true,
|
|
center: false,
|
|
|
|
// Enables touch navigation on devices with touch input
|
|
touch: true,
|
|
|
|
// Loop the presentation
|
|
loop: false,
|
|
|
|
// Change the presentation direction to be RTL
|
|
rtl: false,
|
|
|
|
// Turns fragments on and off globally
|
|
fragments: true,
|
|
|
|
// Flags if the presentation is running in an embedded mode,
|
|
// i.e. contained within a limited portion of the screen
|
|
embedded: false,
|
|
|
|
// Number of milliseconds between automatically proceeding to the
|
|
// next slide, disabled when set to 0, this value can be overwritten
|
|
// by using a data-autoslide attribute on your slides
|
|
autoSlide: 0,
|
|
|
|
// Stop auto-sliding after user input
|
|
autoSlideStoppable: true,
|
|
|
|
// Enable slide navigation via mouse wheel
|
|
mouseWheel: false,
|
|
|
|
// Hides the address bar on mobile devices
|
|
hideAddressBar: true,
|
|
|
|
// Opens links in an iframe preview overlay
|
|
previewLinks: false,
|
|
|
|
// Transition style
|
|
transition: 'default', // default/cube/page/concave/zoom/linear/fade/none
|
|
|
|
// Transition speed
|
|
transitionSpeed: 'default', // default/fast/slow
|
|
|
|
// Transition style for full page slide backgrounds
|
|
backgroundTransition: 'default', // default/none/slide/concave/convex/zoom
|
|
|
|
// Number of slides away from the current that are visible
|
|
viewDistance: 3,
|
|
|
|
// Parallax background image
|
|
//parallaxBackgroundImage: '', // e.g. "'https://s3.amazonaws.com/hakim-static/reveal-js/reveal-parallax-1.jpg'"
|
|
|
|
// Parallax background size
|
|
//parallaxBackgroundSize: '' // CSS syntax, e.g. "2100px 900px"
|
|
|
|
theme: Reveal.getQueryHash().theme, // available themes are in reveal.js/css/theme
|
|
transition: Reveal.getQueryHash().transition || 'default', // default/cube/page/concave/zoom/linear/none
|
|
|
|
});
|
|
|
|
Reveal.initialize({
|
|
dependencies: [
|
|
// Cross-browser shim that fully implements classList - https://github.com/eligrey/classList.js/
|
|
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
|
|
|
|
// Interpret Markdown in <section> elements
|
|
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
|
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
|
|
|
|
// Syntax highlight for <code> elements
|
|
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
|
|
|
|
// Zoom in and out with Alt+click
|
|
{ src: 'reveal.js/plugin/zoom-js/zoom.js', async: true, condition: function() { return !!document.body.classList; } },
|
|
|
|
// Speaker notes
|
|
{ src: 'reveal.js/plugin/notes/notes.js', async: true, condition: function() { return !!document.body.classList; } },
|
|
|
|
// Remote control your reveal.js presentation using a touch device
|
|
//{ src: 'reveal.js/plugin/remotes/remotes.js', async: true, condition: function() { return !!document.body.classList; } },
|
|
|
|
// MathJax
|
|
//{ src: 'reveal.js/plugin/math/math.js', async: true }
|
|
]
|
|
});
|
|
|
|
Reveal.initialize({
|
|
|
|
// The "normal" size of the presentation, aspect ratio will be preserved
|
|
// when the presentation is scaled to fit different resolutions. Can be
|
|
// specified using percentage units.
|
|
width: 1170, // original: 960,
|
|
height: 700,
|
|
|
|
// Factor of the display size that should remain empty around the content
|
|
margin: 0.1,
|
|
|
|
// Bounds for smallest/largest possible scale to apply to content
|
|
minScale: 0.2,
|
|
maxScale: 1.0
|
|
|
|
});
|
|
</script>
|
|
|
|
<!-- begin footer logo
|
|
<div style="position: absolute; bottom: 0px; left: 0; margin-left: 0px">
|
|
<img src="somelogo.png">
|
|
</div>
|
|
end footer logo -->
|
|
|
|
|
|
|
|
</body>
|
|
</html>
|