-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
gilbut
committed
May 13, 2019
0 parents
commit ad5cf3e
Showing
89 changed files
with
130,631 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
*checkpoint | ||
*tfevents* | ||
*.data-00000-of-00001 | ||
*.index | ||
*.meta | ||
*.local | ||
train-images-idx3-ubyte | ||
train-labels-idx1-ubyte | ||
t10k-labels-idx1-ubyte | ||
t10k-images-idx3-ubyte | ||
code/ch14/checkpoint | ||
code/ch12/mnist_scaled.npz | ||
docs/equations/*.aux | ||
docs/equations/*.log | ||
docs/equations/*.out | ||
docs/equations/*.synctex.gz | ||
code/ch08/aclImdb/ | ||
|
||
.ipynb_checkpoints | ||
.DS_Store | ||
code/datasets/movie/aclImdb_v1.tar.gz | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*,cover | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
## 파이썬 패키지 설치 | ||
|
||
파이썬은 주요한 세 개의 운영체제 마이크로소프트 윈도, macOS, 리눅스를 모두 지원합니다. 설치 파일과 문서를 파이썬 공식 웹 사이트(https://www.python.org)에서 다운로드할 수 있습니다. | ||
|
||
이 책은 파이썬 3.7 버전에 맞추어 작성되었습니다. 가능하면 최신 버전의 파이썬을 사용하는 것이 좋습니다. 하지만 아마도 파이썬 3의 이전 버전과 2.7.10 이상에서 실행할 수 있습니다. 파이썬 2.7을 사용하려면 파이썬 3과의 차이점에 대해 알고 있어야 합니다. 파이썬 3과 2.7 버전의 차이점을 다음 사이트에서 참고하세요. https://wiki.python.org/moin/Python2orPython3. | ||
|
||
**노트** | ||
|
||
현재 파이썬 버전을 확인하려면 다음 명령을 입력하세요. | ||
|
||
$ python -V | ||
|
||
|
||
#### pip | ||
|
||
이 책에서 사용하는 패키지는 `pip` 프로그램을 사용해 설치할 수 있습니다. 이 프로그램은 파이썬 3.3부터 표준 라이브러리에 포함되어 있습니다. pip에 관한 더 자세한 내용은 다음 사이트를 참고하세요. https://docs.python.org/3/installing/index.html. | ||
|
||
파이썬을 설치한 후에 터미널에서 pip를 실행하여 파이썬 패키지를 설치할 수 있습니다: | ||
|
||
pip install SomePackage | ||
|
||
|
||
(`SomePackage` 부분에 원하는 패키지 이름을 넣으세요. numpy, pandas, matplotlib, scikit-learn 등). | ||
|
||
설치된 패키지를 업데이트하려면 `--upgrade` 옵션을 사용합니다: | ||
|
||
pip install SomePackage --upgrade | ||
|
||
|
||
#### 아나콘다 | ||
|
||
과학 컴퓨팅을 위한 파이썬 배포판으로 많이 추천하는 것은 아나콘다입니다. 아나콘다는 무료이고 상용 제품이나 기업용으로 사용할 수 있습니다. 데이터 과학, 수학, 공학에 필요한 필수 파이썬 패키지를 다양한 플랫폼에 맞추어 기본으로 제공합니다. 아나콘다 설치파일은 https://www.anaconda.com/distribution/ 에서 다운받을 수 있습니다. 아나콘다 설치와 간단한 사용 방법은 부록 A를 참고하세요. | ||
|
||
아나콘다를 설치한 후에 다음 명령으로 파이썬 패키지를 추가로 설치할 수 있습니다: | ||
|
||
conda install SomePackage | ||
|
||
설치된 패키지는 다음 명령으로 업데이트합니다: | ||
|
||
conda update SomePackage | ||
|
||
이 책에서는 데이터를 저장하고 조작하기 위해 주로 넘파이(numpy) 다차원 배열을 사용합니다. 이따금 넘파이를 기반으로 구축된 판다스(pandas)를 사용하겠습니다. 판다스는 데이터를 조작하는데 유용한 많은 도구를 제공하기 때문에 테이블 형식의 데이터를 다룰 때 편리합니다. 데이터를 시각화하고 직관적인 이해를 돕기위해 맷플롭립(matplotlib) 라이브러리를 사용합니다. | ||
|
||
#### 핵심 패키지 | ||
|
||
이 책에서 사용하는 주요 파이썬 패키지의 버전은 다음과 같습니다. 코드가 올바르게 실행되려면 여러분이 사용하는 버전이 동일하거나 더 높아야 합니다: | ||
|
||
- [NumPy](http://www.numpy.org) >= 1.16.3 | ||
- [SciPy](http://www.scipy.org) >= 1.2.1 | ||
- [scikit-learn](http://scikit-learn.org/stable/) >= 0.20.3 | ||
- [matplotlib](http://matplotlib.org) >= 3.0.3 | ||
- [pandas](http://pandas.pydata.org) >= 0.24.2 | ||
|
||
## 주피터 노트북 | ||
|
||
`.ipynb` 확장자를 가진 파일은 주피터 노트북 파일입니다. 이 책은 일반적인 파이썬 스크립트(`.py`)대신 주피터 노트북을 사용합니다. 주피터 노트북은 데이터 분석 프로젝트에서 아주 잘 맞습니다. 코드와 실행 결과, 그래프, 수식을 포함한 막다운(Markdown) 문서를 모두 한 파일에 저장할 수 있습니다! | ||
|
||
`pip` 명령으로 주피터 노트북을 설치할 수 있습니다: | ||
|
||
$ pip install jupyter notebook | ||
|
||
또는 아나콘다를 설치했다면 `conda` 명령으로 설치할 수 있습니다: | ||
|
||
$ conda install jupyter notebook | ||
|
||
먼저 노트북 파일이 있는 디렉토리로 이동합니다. | ||
|
||
$ cd ~/code/python-machine-learning-book | ||
|
||
그다음 `jupyter notebook` 명령을 실행합니다. | ||
|
||
$ jupyter notebook | ||
|
||
주피터는 기본 브라우저를 실행하여 [http://localhost:8888/](http://localhost:8888/) 주소에 접속합니다. | ||
|
||
![](./images/jupyter-1.png) | ||
|
||
원하는 노트북 파일을 찾아 더블 클릭하세요. | ||
|
||
![](./images/jupyter-2.png) | ||
|
||
더 자세한 내용은 [주피터 노트북 가이드](https://jupyter-notebook-beginner-guide.readthedocs.io/) 문서를 참고하세요. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2017 SEBASTIAN RASCHKA ([email protected]) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
## [머신 러닝 교과서 with 파이썬, 사이킷런, 텐서플로](길벗출판사, 2019) | ||
|
||
![Python 3.7](https://img.shields.io/badge/Python-3.7-blue.svg) | ||
![License](https://img.shields.io/badge/Code%20License-MIT-blue.svg) | ||
|
||
|
||
이 책은 세바스찬 라시카(Sebastian Raschka)와 바히드 미자리리(Vahid Mirjalili)이 쓴 아마존 베스트 셀러 "[Python Machine Learning](https://www.amazon.com/Python-Machine-Learning-scikit-learn-TensorFlow-ebook/dp/B0742K7HYF/)"의 번역서입니다. | ||
|
||
번역서에 관한 궁금한 점이나 오류가 있다면 깃허브에 이슈를 남겨 주시거나 [블로그](https://bit.ly/2Hn88ZM)를 통해 알려 주세요. | ||
|
||
## 참고 사항 | ||
• 책의 모든 예제 코드는 파이썬 3.7, 사이킷런 0.2x, 텐서플로 2.0을 기준으로 합니다. | ||
• 우분투와 윈도에서 파이썬 3.7, 사이킷런 0.2x, 텐서플로 2.0으로 테스트했습니다. | ||
• 책의 예제 코드는 주피터 노트북으로 제공됩니다. | ||
• 각 장의 코드는 ch02, ch03처럼 하위 폴더로 구분되어 있습니다. | ||
• 각 장에서 필요한 예제 데이터셋도 코드와 함께 폴더에 담겨 있습니다. | ||
|
||
## 목차와 주피터 노트북 | ||
|
||
**설치와 설정에 대한 도움말은 [INSTALL.md 파일](INSTALL.md)을 참고하세요.** | ||
|
||
`open_dir` 링크를 클릭하면 [code/](code/) 서브디렉토리 아래에 있는 각 장의 폴더로 이동합니다. 또는 `ipynb` 링크를 클릭해서 바로 주피터 노트북을 열어 볼 수 있습니다. `nbviewer`는 주피터의 노트북 뷰어로 볼 수 있는 링크입니다. `colab`은 구글 코랩(Colab)에서 노트북을 실행할 수 있는 링크입니다. | ||
|
||
2. 간단한 분류 알고리즘 훈련 [[open dir](./code/ch02)] [[ipynb](./code/ch02/ch02.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch02/ch02.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch02/ch02.ipynb)] | ||
3. 사이킷런을 타고 떠나는 머신 러닝 분류 모델 투어 [[open dir](./code/ch03)] [[ipynb](./code/ch03/ch03.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch03/ch03.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch03/ch03.ipynb)] | ||
4. 좋은 훈련 세트 만들기: 데이터 전처리 [[open dir](./code/ch04)] [[ipynb](./code/ch04/ch04.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch04/ch04.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch04/ch04.ipynb)] | ||
5. 차원 축소를 사용한 데이터 압축 [[open dir](./code/ch05)] [[ipynb](./code/ch05/ch05.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch05/ch05.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch05/ch05.ipynb)] | ||
6. 모델 평가와 하이퍼파라미터 튜닝의 모범 사례 [[open dir](./code/ch06)] [[ipynb](./code/ch06/ch06.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch06/ch06.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch06/ch06.ipynb)] | ||
7. 다양한 모델을 결합한 앙상블 학습 [[open dir](./code/ch07)] [[ipynb](./code/ch07/ch07.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch07/ch07.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch07/ch07.ipynb)] | ||
8. 감성 분석에 머신 러닝 적용하기 [[open dir](./code/ch08)] [[ipynb](./code/ch08/ch08.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch08/ch08.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch08/ch08.ipynb)] | ||
9. 웹 애플리케이션에 머신 러닝 모델 내장하기 [[open dir](./code/ch09)] [[ipynb](./code/ch09/ch09.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch09/ch09.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch09/ch09.ipynb)] | ||
10. 회귀 분석으로 연속적 타깃 변수 예측하기 [[open dir](./code/ch10)] [[ipynb](./code/ch10/ch10.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch10/ch10.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch10/ch10.ipynb)] | ||
11. 레이블되지 않은 데이터 다루기: 군집 분석 [[open dir](./code/ch11)] [[ipynb](./code/ch11/ch11.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch11/ch11.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch11/ch11.ipynb)] | ||
12. 다층 인공 신경망을 밑바닥부터 구현 [[open dir](./code/ch12)] [[ipynb](./code/ch12/ch12.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch12/ch12.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch12/ch12.ipynb)] | ||
13. 텐서플로를 사용하여 신경망 훈련 [[open dir](./code/ch13)] [[ipynb](./code/ch13/ch13.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch13/ch13.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch13/ch13.ipynb)] | ||
14. 텐서플로의 구조 자세히 알아보기 [[open dir](./code/ch14)] [[ipynb](./code/ch14/ch14.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch14/ch14.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch14/ch14.ipynb)] | ||
15. 심층 합성곱 신경망으로 이미지 분류 [[open dir](./code/ch15)] [[ipynb](./code/ch15/ch15.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch15/ch15.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch15/ch15.ipynb)] | ||
16. 순환 신경망으로 시퀀스 데이터 모델링 [[open dir](./code/ch16)] [[ipynb](./code/ch16/ch16.ipynb)] [[nbviewer](https://nbviewer.jupyter.org/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch16/ch16.ipynb)] [[colab](https://colab.research.google.com/github/rickiepark/python-machine-learning-book-2nd-edition/blob/master/code/ch16/ch16.ipynb)] | ||
|
||
#### 9장 디렉터리 설명 | ||
|
||
9장의 플라스크 웹 애플리케이션은 다음과 같습니다: | ||
|
||
- `1st_flask_app_1/`: 간단한 플라스크 웹 애플리케이션 | ||
- `1st_flask_app_2/`: `1st_flask_app_1`에서 폼 검증과 렌더링을 확장한 버전 | ||
- `movieclassifier/`: 웹 애플리케이션에 내장한 영화 리뷰 분류기 | ||
- `movieclassifier_with_update/`: `movieclassifier`와 동일하지만 sqlite 데이터베이스에서 업데이트하는 버전 | ||
|
||
웹 애플리케이션을 실행하려면 각 디렉토리로 이동한 후에 메인 애플리케이션 스크립트를 실행합니다. | ||
|
||
cd ./1st_flask_app_1 | ||
python3 app.py | ||
|
||
터미널에서 다음과 같은 출력을 볼 수 있습니다. | ||
|
||
* Running on http://127.0.0.1:5000/ | ||
* Restarting with reloader | ||
|
||
그다음 웹 브라우저를 열고 터미널에 출려된 주소로 접속하면 웹 애플리케이션을 사용할 수 있습니다. | ||
|
||
|
||
**책에 포함된 라이브 데모는 다음 주소에서 확인할 수 있습니다: http://haesun.pythonanywhere.com/**. | ||
|
||
|
||
### 소스 코드의 실시간 업데이트는 역자분의 깃허브와 블로그를 참고해주세요. | ||
|
||
깃허브 : https://github.com/rickiepark/python-machine-learning-book-2nd-edition | ||
블로그 : https://tensorflow.blog/ |
Oops, something went wrong.