Sebastian Raschka, 2015
Python Machine Learning - Code Examples
## Chapter 1 - Giving Computers the Ability to Learn from Data
- Building intelligent machines to transform data into knowledge
- The three different types of machine learning
- Making predictions about the future with supervised learning
- Classification for predicting class labels
- Regression for predicting continuous outcomes
- Solving interactive problems with reinforcement learning
- Discovering hidden structures with unsupervised learning
- Finding subgroups with clustering
- Dimensionality reduction for data compression
- An introduction to the basic terminology and notations
- A roadmap for building machine learning systems
- Preprocessing – getting data into shape
- Training and selecting a predictive model
- Evaluating models and predicting unseen data instances
- Using Python for machine learning
- Installing Python packages
- Summary
---
**Chapter 1 does not contain any code examples.**
---
## Installing Python packages
Python is available for all three major operating systems — Microsoft Windows, Mac OS X, and Linux — and the installer, as well as the documentation, can be downloaded from the official Python website: https://www.python.org.
This book is written for Python version `>= 3.4.3`, and it is recommended
you use the most recent version of Python 3 that is currently available,
although most of the code examples may also be compatible with Python `>= 2.7.10`. If you decide to use Python 2.7 to execute the code examples, please make sure that you know about the major differences between the two Python versions. A good summary about the differences between Python 3.4 and 2.7 can be found at https://wiki.python.org/moin/Python2orPython3.
**Note**
You can check your current default version of Python by executing
$ python -V
In my case, it returns
Python 3.5.1 :: Continuum Analytics, Inc.
#### Pip
The additional packages that we will be using throughout this book can be installed via the `pip` installer program, which has been part of the Python standard library since Python 3.3. More information about pip can be found at https://docs.python.org/3/installing/index.html.
After we have successfully installed Python, we can execute pip from the command line terminal to install additional Python packages:
pip install SomePackage
Already installed packages can be updated via the `--upgrade` flag:
pip install SomePackage --upgrade
#### Anaconda
A highly recommended alternative Python distribution for scientific computing
is Anaconda by Continuum Analytics. Anaconda is a free—including commercial use—enterprise-ready Python distribution that bundles all the essential Python packages for data science, math, and engineering in one user-friendly cross-platform distribution. The Anaconda installer can be downloaded at http://continuum.io/downloads#py34, and an Anaconda quick start-guide is available at https://store.continuum.io/static/img/Anaconda-Quickstart.pdf.
After successfully installing Anaconda, we can install new Python packages using the following command:
conda install SomePackage
Existing packages can be updated using the following command:
conda update SomePackage
Throughout this book, we will mainly use NumPy's multi-dimensional arrays to store and manipulate data. Occasionally, we will make use of pandas, which is a library built on top of NumPy that provides additional higher level data manipulation tools that make working with tabular data even more convenient. To augment our learning experience and visualize quantitative data, which is often extremely useful to intuitively make sense of it, we will use the very customizable matplotlib library.
#### Core packages
The version numbers of the major Python packages that were used for writing this book are listed below. Please make sure that the version numbers of your installed packages are equal to, or greater than, those version numbers to ensure the code examples run correctly:
- [NumPy](http://www.numpy.org) 1.9.1
- [SciPy](http://www.scipy.org) 0.14.0
- [scikit-learn](http://scikit-learn.org/stable/) 0.15.2
- [matplotlib](http://matplotlib.org) 1.4.0
- [pandas](http://pandas.pydata.org) 0.15.2
## Python/Jupyter Notebook
Some readers weere wondering about the `.ipynb` of the code files -- these files are IPython notebooks. I chose IPython notebooks over plain Python `.py` scripts, because I think that they are just great for data analysis projects! IPython notebooks allow us to have everything in one place: Our code, the results from executing the code, plots of our data, and documentation that supports the handy Markdown and powerful LaTeX syntax!
![](./images/ipynb_ex1.png)
**Side Note:**
"IPython Notebook" recently became the "[Jupyter Notebook](<http://jupyter.org>)"; Jupyter is an umbrella project that aims to support other languages in addition to Python including Julia, R, and many more. Don't worry, though, for a Python user, there's only a difference in terminology (we say "Jupyter Notebook" now instead of "IPython Notebook").
The Jupyter notebook can be installed as usually via pip.
$ pip install jupyter notebook
Alternatively, we can use the Conda installer if we have Anaconda or Miniconda installed:
$ conda install jupyter notebook
To open a Jupyter notebook, we `cd` to the directory that contains your code examples, e.g,.
$ cd ~/code/python-machine-learning-book
and launch `jupyter notebook` by executing
$ jupyter notebook
Jupyter will start in our default browser (typically running at [http://localhost:8888/](http://localhost:8888/)). Now, we can simply select the notebook you wish to open from the Jupyter menu.
![](./images/ipynb_ex2.png)
For more information about the Jupyter notebook, I recommend the [Jupyter Beginner Guide](http://jupyter-notebook-beginner-guide.readthedocs.org/en/latest/what_is_jupyter.html).
没有合适的资源?快使用搜索试试~ 我知道了~
Python 和数据科学学习笔记.zip
共1165个文件
png:715个
txt:78个
doctree:67个
需积分: 5 0 下载量 104 浏览量
2024-02-21
12:53:33
上传
评论
收藏 133.88MB ZIP 举报
温馨提示
Python 和数据科学学习笔记
资源推荐
资源详情
资源评论
收起资源包目录
Python 和数据科学学习笔记.zip (1165个子文件)
make.bat 7KB
.buildinfo 230B
.buildinfo 230B
theme.css 101KB
theme.css 101KB
basic.css 9KB
basic.css 9KB
pygments.css 4KB
pygments.css 4KB
badge_only.css 3KB
badge_only.css 3KB
style.css 54B
style.css 54B
style.css 53B
style.css 25B
movie_data_small.csv 133KB
wdbc.data 121KB
wdbc.data 121KB
housing.data 47KB
housing.data 47KB
wine.data 11KB
wine.data 11KB
iris.data 4KB
iris.data 4KB
ch05.doctree 162KB
ch12.doctree 124KB
01_pandas.doctree 124KB
ch04.doctree 123KB
ch08.doctree 114KB
ch13.doctree 111KB
ch10.doctree 105KB
ch06.doctree 104KB
03_numpy-checkpoint.doctree 101KB
03_numpy.doctree 101KB
03_numpy.doctree 101KB
ch07.doctree 98KB
03_numpy.doctree 85KB
ch03_dub.doctree 82KB
ch03.doctree 82KB
ch02.doctree 81KB
softmax-regression.doctree 74KB
ch02_dup.doctree 72KB
ch11.doctree 72KB
ch09.doctree 65KB
04_matplotlib.doctree 62KB
Ex01.doctree 49KB
01_linux.doctree 45KB
01_linux.doctree 42KB
scikit-model-to-json.doctree 41KB
ch01.doctree 34KB
svm_iris_pipeline_and_gridsearch.doctree 29KB
02_jupyter.doctree 29KB
logistic_regression.doctree 26KB
02_jupyter.doctree 25KB
01_books.doctree 25KB
nested_cross_validation.doctree 25KB
reading_mnist.doctree 25KB
01_books.doctree 23KB
MatLab_ex.doctree 22KB
Vectorization.doctree 16KB
rst_eazy.doctree 13KB
rest_eazy.doctree 13KB
01_pandas.doctree 10KB
example.doctree 7KB
01_book.doctree 4KB
01_book.doctree 4KB
index.doctree 4KB
index.doctree 4KB
index.doctree 4KB
index.doctree 4KB
index.doctree 4KB
index.doctree 4KB
index.doctree 4KB
index.doctree 3KB
index.doctree 3KB
01_scipy.doctree 3KB
02_resource.doctree 3KB
02_resource.doctree 3KB
02_ipython.doctree 2KB
02_stats.doctree 2KB
04_matplotlib.doctree 2KB
04_statsmodel.doctree 2KB
05_sklearn.doctree 2KB
05_seaborn.doctree 2KB
03_scipy.doctree 2KB
02_resource.doctree 2KB
02_stats.doctree 2KB
04_statsmodel.doctree 2KB
05_sklearn.doctree 2KB
05_seaborn.doctree 2KB
03_scipy.doctree 2KB
fontawesome-webfont.eot 55KB
fontawesome-webfont.eot 55KB
ajax-loader.gif 673B
ajax-loader.gif 673B
train-images-idx3-ubyte.gz 9.45MB
t10k-images-idx3-ubyte.gz 1.57MB
train-labels-idx1-ubyte.gz 28KB
t10k-labels-idx1-ubyte.gz 4KB
ch05.html 168KB
共 1165 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12
资源评论
Kwan的解忧杂货铺
- 粉丝: 2w+
- 资源: 3699
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功