6
7

More than 5 years have passed since last update.

「scikit-learnとTensorFlowによる実践機械学習」でハマった時の解決策

Last updated at Posted at 2018-09-22

2.3.2 データをダウンロードする
2.3.3 データの構造をざっと見てみる の話です

「p.44」コードそのままそっくり書いたはずなのに・・・エラーでる問題

問題1:ダウンロードのURLが違う

DOWNLOAD_ROOT = "https://raw.githubusercontent.com/ageron/handson-ml/master/"
この部分、たたいて見ると404が出ます。

下記のようにすると繋がるようになりました。
DOWNLOAD_ROOT = "https://cdn.rawgit.com/killakalle/ageron_handson-ml/3201b89b/"

他の部分は、?raw=trueとつけてあげると、良いようです。
HOUSING_URL = DOWNLOAD_ROOT + "datasets/housing/housing.tgz"
HOUSING_URL = DOWNLOAD_ROOT + "datasets/housing/housing.tgz?raw=true"

csv_path=os.path.join(housing_path, "housing.csv")
csv_path=os.path.join(housing_path, "housing.csv?raw=true")

問題2:SSLCertVerificationError

問題1をパスしても、SSL認証エラーが出てしまいます。
パスはあっているから繋がってもおかしくないのに・・

これは、ローカルにあるpythonの設定が、SSL認証に対応していないのが原因のようです。
下記パスにあるファイルをダブルクリックして実行して見ると、。
/Applications/Python 3.7/Install Certificates.command

スクリーンショット 2018-09-22 19.27.54.png

ちゃんと実行できるようになりました。

スクリーンショット 2018-09-22 19.33.01.png

6
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7