Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Amazon SageMaker Autopilot を試す / pyml-niigata-20200620-automl

Amazon SageMaker Autopilot を試す / pyml-niigata-20200620-automl

2020/06/20 Python機械学習勉強会 in 新潟 で発表した資料です。

kasacchiful

June 20, 2020
Tweet

More Decks by kasacchiful

Other Decks in Programming

Transcript

  1. Amazon SageMaker Autopilot • Amazon SageMaker ͷ AutoML ػೳ •

    τϨʔχϯά࣌ͷΞϧΰϦζϜɺύϥϝʔλ ௐ੔ΛࣗಈԽ͠ɺ࠷దͳϞσϧΛ࡞੒Ͱ͖Δ IUUQTBXTBNB[PODPNKQTBHFNBLFSBVUPQJMPU 
  2. ΍Δ͜ͱ • Amazon SageMaker AutopilotͷαϯϓϧΛಈ͔͢ • αϯϓϧίʔυ͸ҎԼͷϊʔτϒοΫ • https://github.com/awslabs/amazon-sagemaker-examples/blob/master/ autopilot/sagemaker_autopilot_direct_marketing.ipynb

    • ࢖༻σʔληοτ: UCI Machine Learning Repository: Bank Marketing Data Set • https://archive.ics.uci.edu/ml/datasets/bank+marketing • ϙϧτΨϧͷۚ༥ػؔͷμΠϨΫτϚʔέςΟϯάΩϟ ϯϖʔϯʹؔ࿈͠ɺΫϥΠΞϯτ͕ఆظ༬ۚΛαϒεΫ ϥΠϒ͢Δ͔Ͳ͏͔Λ༧ଌ͢Δɻ 
  3. AutoGluon • AutoML Toolkit for Deep Learning • https://github.com/awslabs/autogluon “AutoGluon

    automates machine learning tasks enabling you to easily achieve strong predictive performance in your applications.” • Gluon͸AWSͱMicrosoft͕ڞಉ։ൃ͍ͯ͠ΔɺσΟʔϓϥʔχϯ άϥΠϒϥϦ • TensorFlow/Keras 㱻 MXNet/Gluon ͳରԠ͔ͳ? • ී௨ͷPythonϥΠϒϥϦͳͷͰɺSageMakerͰͳͯ͘΋ಈ࡞͢Δ 
  4. AutoGluon Example  # First install package from terminal: pip

    install mxnet autogluon from autogluon import TabularPrediction as task train_data = task.Dataset(file_path='https:// autogluon.s3.amazonaws.com/datasets/Inc/train.csv') test_data = task.Dataset(file_path='https:// autogluon.s3.amazonaws.com/datasets/Inc/test.csv') predictor = task.fit(train_data=train_data, label='class') performance = predictor.evaluate(test_data) ग़యIUUQTHJUIVCDPNBXTMBCTBVUPHMVPO
  5. AutoGluon Example (Image Classification with FashionMNIST)  import autogluon as

    ag from autogluon import ImageClassification as task filename = ag.download('https://autogluon.s3.amazonaws.com/datasets/ shopee-iet.zip') ag.unzip(filename) dataset = task.Dataset('data/train') test_dataset = task.Dataset('data/test', train=False) if ag.get_gpu_count() == 0: dataset = task.Dataset(name='FashionMNIST') test_dataset = task.Dataset(name='FashionMNIST', train=False) ग़యIUUQTBVUPHMVPONYOFUJPUVUPSJBMTJNBHF@DMBTTJpDBUJPOCFHJOOFSIUNM
  6. AutoGluon Example (Image Classification with FashionMNIST)  # train classifier

    = task.fit(dataset, epochs=5, ngpus_per_trial=1, verbose=False) print('Top-1 val acc: %.3f' % classifier.results['best_reward']) # predict # skip this if training FashionMNIST on CPU. if ag.get_gpu_count() > 0: image = 'data/test/BabyShirt/BabyShirt_323.jpg' ind, prob, _ = classifier.predict(image, plot=True) print('The input picture is classified as [%s], with probability %.2f.' % (dataset.init().classes[ind.asscalar()], prob.asscalar())) image = 'data/test/womenchiffontop/womenchiffontop_184.jpg' ind, prob, _ = classifier.predict(image, plot=True) print('The input picture is classified as [%s], with probability %.2f.' % (dataset.init().classes[ind.asscalar()], prob.asscalar())) ग़యIUUQTBVUPHMVPONYOFUJPUVUPSJBMTJNBHF@DMBTTJpDBUJPOCFHJOOFSIUNM
  7. ࢀߟ Amazon SageMaker Autopilot ؔ࿈ • Amazon Sagemaker Autopilot |

    Amazon Sagemaker • https://aws.amazon.com/jp/sagemaker/autopilot/ • Amazon SageMaker Autopilot ͷ։࢝ํ๏ - Amazon SageMaker • https://docs.aws.amazon.com/ja_jp/sagemaker/latest/dg/autopilot-automate-model- development-get-started.html • Amazon SageMaker AutopilotΛ࢖ͬͯΈͨ | Developers.IO • https://dev.classmethod.jp/articles/try-amazon-sagemaker-autopilot/ • Amazon SageMaker Autopilot ͷαϯϓϧͰϞσϧΛ࡞੒ͯ͠Έͨ - Qiita • https://qiita.com/NomuK3/items/fb4c8bd2e4c7724457c3 • Amazon SageMaker Studio ͷಋೖͱ Autopilot ʹ͍ͭͯˌ̍ - Qiita • https://qiita.com/SatoshiGachiFujimoto/items/eecb66f5d57cb50324c7 • Amazon SageMaker Studio ͷಋೖͱ Autopilot ʹ͍ͭͯ ˌ̎ - Qiita • https://qiita.com/SatoshiGachiFujimoto/items/95c9e5877959bfe3b7ca 
  8. ࢀߟ AutoGluon ؔ࿈ • AutoGluon: AutoML Toolkit for Deep Learning

    ʔ AutoGluon Documentation 0.0.1 documentation • https://autogluon.mxnet.io/index.html • AutoGluonΛ࢖ͬͯΈͨ | Developers.IO • https://dev.classmethod.jp/articles/yoshim_autogluon_sagemaker/