IT Guy

IT、AI / Machine Learning、IoT、Project Management、プログラミング、ITIL等々

Machine Learning勉強用podcast

www.shopify.com

紹介されているpodcast

  1. http://ocdevel.com/podcasts/machine-learning
  2. https://dataskeptic.com/
  3. https://twimlai.com/
  4. https://www.oreilly.com/topics/oreilly-data-show-podcast
  5. https://www.thetalkingmachines.com/
  6. https://www.datacamp.com/community/podcast
  7. http://lineardigressions.com/
  8. https://concerning.ai/
  9. http://datastori.es/
  10. http://www.learningmachines101.com/about-learning-machines-101/

Machine Learning (機械学習) 英語 - 英日対訳

基本中の基本

  • AI (Artificial Intelligence) : 人工知能
  • Machine Learning : 機械学習
  • Deep Learning : 深層学習・ディープラーニング

機械学習

機械学習の方法

  • Supervised Learning : 教師あり学習
  • Unsupervised Learning : 教師なし学習
  • Reinforcement Learning : 強化学習

機械学習の手法

  • Classification : 分類
    • Binary classification : 二項(2クラス)分類 +Multiclass classification : 多項(多クラス)分類
  • Regression : 回帰
  • Lazy Learning : 遅延学習 <=> Eager Learning
  • Logistics Regression : ロジスティック回帰
  • Linear SVM (Support Vector Machine) : 線形SVM
  • Non-Linear SVM (Support Vector Machine) : 非線形SVM
  • Decision Tree : 決定木
  • Random Forest : ランダムフォレスト
  • k-NN(Nearest Neighbors) : k近傍法

Deep Learning

  • Neural Network : ニューラルネットワーク
  • Deep Neural Network : ディープニューラルネットワーク
  • Weight Parameter : 重みパラメータ
  • CNN (Convolutional Neural Network) : 畳み込みニューラルネットワーク

本 - Pythonで動かして学ぶ!あたらしい深層学習の教科書 機械学習の基本から深層学習まで

Pythonで動かして学ぶ! あたらしい深層学習の教科書 機械学習の基本から深層学習まで (AI & TECHNOLOGY)

Pythonで動かして学ぶ! あたらしい深層学習の教科書 機械学習の基本から深層学習まで (AI & TECHNOLOGY)

目次

  • 第1章から第3章 : 機械学習の基本
  • 第4章から第6章 : Pythonの基礎知識
  • 第7章から第9章 : NumPyやPandasの基礎知識
  • 第10章から第13章 : 可視化の基礎知識
  • 第14章から第15章 : データの扱い方の基本
  • 第16章から第18章 : 教師あり学習やハイパーパラメータとチューニング
  • 第19章から第22章 : 深層学習について基本か応用

サンプル実行環境構築 (自分の環境)

洋書 - Machine Learning with Python Cookbook

Machine Learning with Python Cookbook

Machine Learning with Python Cookbook: Practical Solutions from Preprocessing to Deep Learning

Machine Learning with Python Cookbook: Practical Solutions from Preprocessing to Deep Learning

評価

約200個のわかりやすいサンプルコードが収録。真面目に勉強するには非常によい!

Table of Contents

1. Vectors, Matrices and Arrays [numpy]
  • 基本 : np.array(), scipy.sparse.csr_matrix(matrix), matrix.shape, matrix.size, matrix.ndim, np.vectorize(lamdba function), np.max(matrix), np.min(matrix), np.mean(matrix), np.var(matrix), np.std(matrix)
  • 高度な関数・メソッド : matrix.reshape(m, n), matrix.T, matrix.flatten(), np.linalg.matrix_rank(matrix), np.linalg.det(matrix), matrix.diagnal(), matrix.trace(), np.linalg.eig(matrix), np.dot(vector_a, vector_b), np.add(matrix_a, matrix_b), np.subtract(matrix_a, matrix_b), np.dot(matrix_a, matrix_b), np.linalg.inv(matrix)
  • Random : np.random.seed(n), np.random.random(n), np.random.logistic(...), np.random.uniform(...)
2. Loading Data [scikit-learn, pandas]
  • "toy" datasets : load_boston, load_iris, load_digits, data, target
  • make_regression, make_classification, make_blobs
  • pandas.read_csv(url), pandas.read_json(url), pandas.read_sql_query(...)
3. Data Wrangling [pandas]
  • 基本 : pd.read_csv(url), pd.DataFrame(), dataframe['Col1'] = [val1, val2], dataframe.shape, dataframe.describe()
  • Search : dataframe.iloc[1:4], dataframe.loc["Allen"], dataframe[(dataframe['Sex'] == 'female')]
  • Replace / Delete / Merge... : dataframe.replace(1, "One"), dataframe.drop_duplicates(), pd.concat(...), pd.merge(...)
4. Handling Numerical Data [pandas, scikit-learn]
5. Handling Categorical Data [pandas, scikit-learn]
6. Handling Text [NLTK, scikit-learn]
  • Python標準string : string.strip() for string in text_data, string.replace(".", "") for string in strip_whitespace, string.upper()
  • Regular Expression : re.sub
  • scraping HTML : BeautifulSoup
  • NLTK(Natural Language Toolkit)
7. Handling Dates and Times [pandas]
8. Handling Images [OpenCV, matplotlib]
  • OpenCV : cv2.imread("images/plane.jpg"), cv2.imwrite("images/plane_new.jpg", image), cv2.resize(image, (256, 256)), image_cropped = image[:,:128], cv2.blur(image, (5,5))
9. Dimensionality Reduction Using Feature Extraction [scikit-learn]
10. Dimensionality Reduction Using Feature Selection [scikit-learn]
11. Model Evaluation [scikit-learn]
12. Model Selection [scikit-learn]
13. Linear Regression [scikit-learn]
14. Trees and Forests [scikit-learn]
15. K-Nearest Neighbors [scikit-learn]
16. Logistic Regression [scikit-learn]
17. Support Vector Machines [scikit-learn]
18. Naive Bayes [scikit-learn]
19. Clustering [scikit-learn]
20. Neural Networks [keras]
21. Saving and Loading Trained Models [scikit-learn, keras]

サンプル環境構築 (自分の環境)

  • OS : Windows 10
  • Python : Python 3.6.7 64 bit (Anacondaは容量が多きぎるので、使っていない。標準pythonとpipのみで問題ない!)
    • 2018/12時点でtensorflowは3.7は未対応であるため、3.6.xをインストール
    • Pythonを入れなおす時、Uninstall後も下記のところを自分で綺麗に消さないと相当苦労する。
      • C:\Users\sejahn\AppData\Local\Programs\Python
      • C:\Users\sejahn\AppData\Local\pip
      • RegeditでPythonが入っているところ
    • PIP : Python 3.6.x同梱のPIP。「python -m pip install --upgrade pip」でpip upgradeした。
  • Library : 下記pip freeze結果(pip install時バージョンは指定しなくても大丈夫だった)
cycler==0.10.0
kiwisolver==1.0.1
matplotlib==3.0.2
numpy==1.15.4
pandas==0.23.4
pyparsing==2.3.0
python-dateutil==2.7.5
pytz==2018.7
scikit-learn==0.20.1
scipy==1.1.0
six==1.11.0
sklearn==0.0
  • Editor : なんでもいいだろうけど、sublime text

Python Machine Learning用パッケージ・フレームワーク

Data analysisのための4つのメインパッケージ (SciPy.orgが提供)

https://scipy.org/

NumPy

SciPy

Pandas

Matplotlib

f:id:blog-guy:20181205221037p:plain

Deep Learning

Keras

  • Home - Keras Documentation
  • TensorFlow(by Google)、CNTK(by Microsoft)、TheanoのHigh-level APIを提供。この単体で動くものではない。別の言い方だと、Kerasのbackend enginesとして、TensorFlow、CNTK、Theanoがあり、Kerasのデフォルトのbackend engineはTensorflow。

Tensorflow

Link

Pythonウェブフレームワーク比較 (2018/12時点)

Link

Scoreによる順番

  1. Django 2.1 : 9.2
  2. Weppy 1.2.11 : 9.1
  3. Web2py 2.16.1 : 8.9
  4. Bottle 0.12 : 8.6
  5. CubicWeb 3.26.4 : 8.6
  6. Zope2 2.13.24 : 8.6
  7. Web.py 0.39 : 8.5
  8. CherryPy 17.0.0 : 8.4
  9. Flask 1.0.2 : 8.4
  10. Pyramid 1.9.2 : 8.4
  11. Wheezy.web 0.1.485 : 8.4
  12. Tornado 4.3 : 8.3
  13. Falcon 1.4.1 : 8.0

その他Link