pythonによる機械学習入門
株式会社システム研究計画所, オーム社、2016
https://www.amazon.co.jp/dp/4274219631
課題1 anacondaの導入
anacondaの導入の説明がはしょりすぎてるかも。
Windows(MS)にPython(Anaconda)を導入する(5つの罠)https://qiita.com/kaizen_nagoya/items/7bfd7ecdc4e8edcbd679
にも書いた。何気なくWindowsでanacondaを導入すると、コマンドプロンプトではpythonは起動しない。
じゃ、Path切る方を選択すればいいかというと、System Cのソフトとか、CADとか、Simulatorとか、pythonをコマンドとして使っている多くのソフトのうち何かで不具合が出るかも。
注意喚起または警告なしの記述はまずいかも。
課題2 ダウンロード 解凍_
課題3 描画
Macintoshだと、凡例が切れたり、本と配置が違う場合があった。
原因解明と対策はこれから。
今回、下記に示した図は、本ではなく、WEBに掲載のプログラムを、
macOS 10.13.3
$ python
Python 3.6.0 |Anaconda 4.3.0 (x86_64)| (default, Dec 23 2016, 13:19:00)
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)] on darwin
という環境で <(リダイレクト)で実行したものです。
課題4 章節、図表の表題の命名
「元データ」なんですか?これ。って思う人います。
図表は、本文を読んでいなくても、何と無くわかり、
あれ?って思うことが文章で説明してあるとよい。
必ずしも全部がわかる必要はない。
「元データ」では読む気がしない。
具体的なデータの種別を書くと、その分野に興味がない人が読まなくなるのを心配しているのかもしれない。
具体的なデータで説明すれば、個々のデータの固有性に言及できるかもしれない。
私なら後者を選ぶ。
「予測結果」って違和感。「予測例」ならまだしも。
ある論理の結末だから「結果」にしたいのだろう。その論理は一例。論理の正当性、妥当性を論書牛わわけではないんですだ「例」を推す。
課題5 図番号の振り方
図番号が飛んでいたり、図番号のない図があった。
第一部 導入編
ここからは実行結果の図です。
本そのままではない。
本そのままになる方法をこれから着手。
ご教示歓迎。
1.4.2 matplotlib
1.5.2 データの準備
図1ー10 元データ<なんのデータかを示した方が良くないですか> p.20
右側の凡例が切れている。(Macintosh)
1.5.3 分類問題
図1-11 分類問題用データ(クラス分けと学習/テストデータ分け)p.20
1.5.4 回帰問題
1.5.5 クラスタリング
第3章
書籍に画像がない。図番号なし。
第4章
4.2.2 線形回帰を試して見る
図の空白の大きさが違う(Macintosh)。
図4-4 バラつきのあるy=3x-2の予測結果<例>
図 4-4 -3から3までの図。空白等の大きさ違い(Macintosh)。
4.2.4 y= ax^2 + bを求める
4.2.5 重回帰を試してみる
図4-6 y=3x1-2x2+1 (左が縦y横x1)(右 縦y横x2)
本だと横長なのに、縦長になっている(Macintosh)。
図4-7 y=3x1-2x2+1の予測結果<例>
(左が縦y横x1)(右 縦y横x2)
4.3 機械学習における鬼門 過学習
図4-10バラつきのあるy=4x^3+3x^2-1
p.87
本だと上段にall, 下段にtrainとtest
図4-11 最小自乗法による学習結果
p.88
図 4-12最小自乗法によるテスト結果
図 4-13
図 4-14
図 4-15
第5章
図5-1 散布図の例<散布図:花弁(petal)の幅(width)と長さ(length)の例>
図5-2 k-meansの実行の様子<萼(がく:sepal)の幅(width)と花弁(petal)の長さ(length)>初期状態/クラスタ形成前
##図5-2 k-meansの実行の様子<萼(がく:sepal)の幅(width)と花弁(petal)の長さ(length)>1回目/最初のクラスタ
図5-2 k-meansの実行の様子<萼(がく:sepal)の幅(width)と花弁(petal)の長さ(length)>2回目
図5-2 k-meansの実行の様子<萼(がく:sepal)の幅(width)と花弁(petal)の長さ(length)>3回目/ほぼ変化なし
図5-3 花弁の長さと幅によるクラスタリング結果の散布図
図5-4 クラスタリングの結果<萼の幅と長さ>
図 5-4画面で縦に切れたので「小さく」表示したら文字がはみ出た(Macintosh)。
横長の図が正方形になっている。下の見出しが右に、左の見出しが下にある。
図5-6 k-meansとAgglomerativeClustering(ウォード法)<花弁の長さと幅>
図5-6 k-meansとAgglomerativeClustering(ウォード法)<花弁の長さと幅>
図5-7 k-meansとAffinityPropagationの結果<花弁の長さと幅>
Appendix
$ python < get_data.py
<stdin>:253: MatplotlibDeprecationWarning: pyplot.hold is deprecated.
Future behavior will be consistent with the long-time default:
plot commands add elements without first clearing the
Axes and/or Figure.
/Users/administrator/.pyenv/versions/anaconda3-4.3.0/lib/python3.6/site-packages/matplotlib/__init__.py:917: UserWarning: axes.hold is deprecated. Please remove it from your matplotlibrc and/or style files.
warnings.warn(self.msg_depr_set % key)
/Users/administrator/.pyenv/versions/anaconda3-4.3.0/lib/python3.6/site-packages/matplotlib/rcsetup.py:152: UserWarning: axes.hold is deprecated, will be removed in 3.0
warnings.warn("axes.hold is deprecated, will be removed in 3.0")
---
python linear_regression_analytic_solution.py
Traceback (most recent call last):
File "linear_regression_analytic_solution.py", line 75, in <module>
main()
File "linear_regression_analytic_solution.py", line 35, in main
dimension, nonlinear, num_of_samples, noise_amplitude
File "/Users/administrator/Downloads/examples-2/App_A/get_data.py", line 186, in get_all
train = perm_indices[:N/2] # 整数演算なので切り下げ
TypeError: slice indices must be integers or None or have an __index__ method
---
python linear_regression_iterative_solution.py
Traceback (most recent call last):
File "linear_regression_iterative_solution.py", line 144, in <module>
main()
File "linear_regression_iterative_solution.py", line 94, in main
return_coefficient_matrix=False
File "/Users/administrator/Downloads/examples-2/App_A/get_data.py", line 186, in get_all
train = perm_indices[:N/2] # 整数演算なので切り下げ
TypeError: slice indices must be integers or None or have an __index__ method
---
python neural_network.py
Traceback (most recent call last):
File "neural_network.py", line 236, in <module>
main()
File "neural_network.py", line 188, in main
return_coefficient_matrix=False
File "/Users/administrator/Downloads/examples-2/App_A/get_data.py", line 186, in get_all
train = perm_indices[:N/2] # 整数演算なので切り下げ
TypeError: slice indices must be integers or None or have an __index__ method
文書履歴
ver. 0.10 初稿 20180322
ver. 0.20 図の増強 20180330
ver. 0.21 図の見出し追加 20180402
ver. 0.22 書式訂正 20180801
<この記事は個人の過去の経験に基づく個人の感想です。現在所属する組織、業務とは関係がありません。>
最後までおよみいただきありがとうございました。
いいね 💚、フォローをお願いします。
Thank you very much for reading to the last sentence.
Please press the like icon 💚 and follow me for your happy life.