Skip to content

Commit 4c13f0b

Browse files
Merge pull request #36 from paultheastronomer/master
Added content
2 parents 08fc365 + e9acad9 commit 4c13f0b

25 files changed

Lines changed: 7335 additions & 2 deletions

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ We are looking for contributors who are willing to share their teaching material
2020
## Contributors to the github repository
2121

2222
- <a href="https://www.paulanthonywilson.com/" target="_blank">Dr. Paul A. Wilson</a>, <a href="http://www.astro4dev.org/" target="_blank">OAD, SA</a>
23-
- <a href="vanessa.saao.ac.za" target="_blank">Dr. Vanessa McBride</a>, <a href="http://www.astro4dev.org/" target="_blank">OAD, SA</a>
23+
- <a href="http://vanessa.saao.ac.za" target="_blank">Dr. Vanessa McBride</a>, <a href="http://www.astro4dev.org/" target="_blank">OAD, SA</a>
2424
- <a href="https://github.com/ArunAniyan" target="_blank">Dr. Arun Aniyan</a>, <a href="http://www.ska.ac.za/" target="_blank">SKA South Africa</a>
2525
- <a href="http://webusers.astro.umn.edu/%7Ebrown/" target="_blank">Dr. Shea Brown</a>, <a href="https://uiowa.edu/" target="_blank">University of Iowa, USA</a>
2626
- <a href="https://github.com/sfebruary" target="_blank">Dr. Sean February</a>, <a href="https://www.chpc.ac.za/" target="_blank">CHPC, SA</a>
2727
- <a href="https://github.com/pylablanche" target="_blank">Dr. Pierre-Yves Lablanche</a>, <a href="https://www.aims.ac.za/" target="_blank">AIMS, SA</a>
2828
- <a href="https://github.com/scienceguyrob" target="_blank">Dr. Rob Lyon</a>, <a href="http://www.jodrellbank.manchester.ac.uk/people/staff/profile/?ea=robert.lyon" target="_blank">University of Manchester, UK</a>
29-
- <a href="https://github.com/scienceguyrob" target="_blank">Dr. Anna Scaife</a>, <a href="http://www.manchester.ac.uk/research/anna.scaife/" target="_blank">University of Manchester, UK</a>
29+
- <a href="http://www.manchester.ac.uk/research/anna.scaife/" target="_blank">Dr. Anna Scaife</a>, <a href="http://www.manchester.ac.uk/research/anna.scaife/" target="_blank">University of Manchester, UK</a>
3030

3131

3232

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Scikit-learn Tutorial
2+
3+
This tutorial was written by *Jake VanderPlas* and reproduced with his permission. The original repository can be found [here](https://github.com/jakevdp/sklearn_tutorial).
4+
5+
*Author contact details:*
6+
7+
- email: <jakevdp@uw.edu>
8+
- twitter: [@jakevdp](https://twitter.com/jakevdp)
9+
- github: [jakevdp](http://github.com/jakevdp)
10+
11+
This repository contains notebooks and other files associated with my
12+
[Scikit-learn](http://scikit-learn.org) tutorial.
13+
14+
## Installation Notes
15+
This tutorial requires the following packages:
16+
17+
- Python version 2.6-2.7 or 3.3+
18+
- `numpy` version 1.5 or later: http://www.numpy.org/
19+
- `scipy` version 0.10 or later: http://www.scipy.org/
20+
- `matplotlib` version 1.3 or later: http://matplotlib.org/
21+
- `scikit-learn` version 0.14 or later: http://scikit-learn.org
22+
- `ipython` version 2.0 or later, with notebook support: http://ipython.org
23+
- `seaborn` version 0.5 or later
24+
25+
The easiest way to get these is to use the [conda](https://store.continuum.io/) environment manager.
26+
I suggest downloading and installing [miniconda](http://conda.pydata.org/miniconda.html).
27+
28+
Once this is installed, the following command will install all required packages in your Python environment:
29+
```
30+
$ conda install numpy scipy matplotlib scikit-learn ipython-notebook seaborn
31+
```
32+
33+
Alternatively, you can download and install the (very large) Anaconda software distribution, found at https://store.continuum.io/.
34+
35+
## Downloading the Tutorial Materials
36+
I would highly recommend using git, not only for this tutorial, but for the
37+
general betterment of your life. Once git is installed, you can clone the
38+
material in this tutorial by using the git address shown above:
39+
40+
git clone git://github.com/jakevdp/sklearn_tutorial.git
41+
42+
If you can't or don't want to install git, there is a link above to download
43+
the contents of this repository as a zip file. I may make minor changes to
44+
the repository in the days before the tutorial, however, so cloning the
45+
repository is a much better option.
46+
47+
48+
## Notebook Listing
49+
You can [view the tutorial materials](http://nbviewer.ipython.org/github/jakevdp/sklearn_tutorial/blob/master/notebooks/Index.ipynb) using the excellent nbviewer service.
50+
51+
Note, however, that you cannot modify or run the contents within nbviewer.
52+
To modify them, first download the tutorial repository, change to the notebooks directory, and run ``ipython notebook``.
53+
You should see the list in the ipython notebook launch page in your web browser.
54+
For more information on the IPython notebook, see http://ipython.org/notebook.html
55+
56+
Note also that some of the code in these notebooks will not work outside the
57+
directory structure of this tutorial, so it is important to clone the full
58+
repository if possible.
Lines changed: 183 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,183 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"<small><i>This notebook was put together by [Jake Vanderplas](http://www.vanderplas.com). Source and license info is on [GitHub](https://github.com/jakevdp/sklearn_tutorial/).</i></small>"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"# An Introduction to scikit-learn: Machine Learning in Python"
15+
]
16+
},
17+
{
18+
"cell_type": "markdown",
19+
"metadata": {},
20+
"source": [
21+
"## Goals of this Tutorial"
22+
]
23+
},
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {},
27+
"source": [
28+
"- **Introduce the basics of Machine Learning**, and some skills useful in practice.\n",
29+
"- **Introduce the syntax of scikit-learn**, so that you can make use of the rich toolset available."
30+
]
31+
},
32+
{
33+
"cell_type": "markdown",
34+
"metadata": {},
35+
"source": [
36+
"## Schedule:"
37+
]
38+
},
39+
{
40+
"cell_type": "markdown",
41+
"metadata": {},
42+
"source": [
43+
"**Preliminaries: Setup & introduction** (15 min)\n",
44+
"* Making sure your computer is set-up\n",
45+
"\n",
46+
"**Basic Principles of Machine Learning and the Scikit-learn Interface** (45 min)\n",
47+
"* What is Machine Learning?\n",
48+
"* Machine learning data layout\n",
49+
"* Supervised Learning\n",
50+
" - Classification\n",
51+
" - Regression\n",
52+
" - Measuring performance\n",
53+
"* Unsupervised Learning\n",
54+
" - Clustering\n",
55+
" - Dimensionality Reduction\n",
56+
" - Density Estimation\n",
57+
"* Evaluation of Learning Models\n",
58+
"* Choosing the right algorithm for your dataset\n",
59+
"\n",
60+
"**Supervised learning in-depth** (1 hr)\n",
61+
"* Support Vector Machines\n",
62+
"* Decision Trees and Random Forests\n",
63+
"\n",
64+
"**Unsupervised learning in-depth** (1 hr)\n",
65+
"* Principal Component Analysis\n",
66+
"* K-means Clustering\n",
67+
"* Gaussian Mixture Models\n",
68+
"\n",
69+
"**Model Validation** (1 hr)\n",
70+
"* Validation and Cross-validation"
71+
]
72+
},
73+
{
74+
"cell_type": "markdown",
75+
"metadata": {},
76+
"source": [
77+
"## Preliminaries"
78+
]
79+
},
80+
{
81+
"cell_type": "markdown",
82+
"metadata": {},
83+
"source": [
84+
"This tutorial requires the following packages:\n",
85+
"\n",
86+
"- Python version 2.7 or 3.4+\n",
87+
"- `numpy` version 1.8 or later: http://www.numpy.org/\n",
88+
"- `scipy` version 0.15 or later: http://www.scipy.org/\n",
89+
"- `matplotlib` version 1.3 or later: http://matplotlib.org/\n",
90+
"- `scikit-learn` version 0.15 or later: http://scikit-learn.org\n",
91+
"- `ipython`/`jupyter` version 3.0 or later, with notebook support: http://ipython.org\n",
92+
"- `seaborn`: version 0.5 or later, used mainly for plot styling\n",
93+
"\n",
94+
"The easiest way to get these is to use the [conda](http://store.continuum.io/) environment manager.\n",
95+
"I suggest downloading and installing [miniconda](http://conda.pydata.org/miniconda.html).\n",
96+
"\n",
97+
"The following command will install all required packages:\n",
98+
"```\n",
99+
"$ conda install numpy scipy matplotlib scikit-learn ipython-notebook\n",
100+
"```\n",
101+
"\n",
102+
"Alternatively, you can download and install the (very large) Anaconda software distribution, found at https://store.continuum.io/."
103+
]
104+
},
105+
{
106+
"cell_type": "markdown",
107+
"metadata": {},
108+
"source": [
109+
"### Checking your installation\n",
110+
"\n",
111+
"You can run the following code to check the versions of the packages on your system:\n",
112+
"\n",
113+
"(in IPython notebook, press `shift` and `return` together to execute the contents of a cell)"
114+
]
115+
},
116+
{
117+
"cell_type": "code",
118+
"execution_count": null,
119+
"metadata": {
120+
"collapsed": false
121+
},
122+
"outputs": [],
123+
"source": [
124+
"from __future__ import print_function\n",
125+
"\n",
126+
"import IPython\n",
127+
"print('IPython:', IPython.__version__)\n",
128+
"\n",
129+
"import numpy\n",
130+
"print('numpy:', numpy.__version__)\n",
131+
"\n",
132+
"import scipy\n",
133+
"print('scipy:', scipy.__version__)\n",
134+
"\n",
135+
"import matplotlib\n",
136+
"print('matplotlib:', matplotlib.__version__)\n",
137+
"\n",
138+
"import sklearn\n",
139+
"print('scikit-learn:', sklearn.__version__)\n",
140+
"\n",
141+
"import seaborn\n",
142+
"print('seaborn', seaborn.__version__)"
143+
]
144+
},
145+
{
146+
"cell_type": "markdown",
147+
"metadata": {},
148+
"source": [
149+
"## Useful Resources"
150+
]
151+
},
152+
{
153+
"cell_type": "markdown",
154+
"metadata": {},
155+
"source": [
156+
"- **scikit-learn:** http://scikit-learn.org (see especially the narrative documentation)\n",
157+
"- **matplotlib:** http://matplotlib.org (see especially the gallery section)\n",
158+
"- **IPython:** http://ipython.org (also check out http://nbviewer.ipython.org)"
159+
]
160+
}
161+
],
162+
"metadata": {
163+
"kernelspec": {
164+
"display_name": "Python 3",
165+
"language": "",
166+
"name": "python3"
167+
},
168+
"language_info": {
169+
"codemirror_mode": {
170+
"name": "ipython",
171+
"version": 3
172+
},
173+
"file_extension": ".py",
174+
"mimetype": "text/x-python",
175+
"name": "python",
176+
"nbconvert_exporter": "python",
177+
"pygments_lexer": "ipython3",
178+
"version": "3.5.1"
179+
}
180+
},
181+
"nbformat": 4,
182+
"nbformat_minor": 0
183+
}

Teaching Materials/Machine Learning/Supervised Learning/Courses/sklearn_tutorial/notebooks/02.1-Machine-Learning-Intro.ipynb

Lines changed: 635 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)