Giter Site home page Giter Site logo

tre-xanh / automl Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 171 KB

Use MLflow to make a pipeline of data preprocessing, machine learning, and predicting. Can do mlflow serving using docker in docker (dind).

Python 78.74% Shell 5.17% Makefile 8.97% Dockerfile 7.11%
mlflow h2o-automl dind docker-in-docker

automl's Introduction

marp paginate
true
true

MLflowでらくらく前処理・機械学習・予測API一連化

MLflow で実験のパラメータ、メトリックや学習済みモデルの記録については、情報が豊富に見つかりますが、しかし前処理と学習・予測を一連の処理としてパイプライン化する、分かりやすい簡単なサンプルが見つからなかったので、作ってみました。

よって、このサンプルでは、前処理と学習・予測のパイプライン化に重点を置きます。 また、予測サービス(REST)を簡単に立ち上げられることについても少し触れます。


bg contain


概要

なお、 Python や各種ライブラリのバージョンによっては mlflow serving で予測するときと、 mlflowの保存済みモデルで予測するときとで、予測結果(確率)に差異が見られるので注意が必要です。


環境変数

cp -i .env_sample .env

開発環境の準備

.devcontainer/DockerfileMamba/Conda環境作成


データ前処理

試しに Age, Fareの Min-Maxスケーリング 序に、列名を日本語化して日本語の列名への対応をみる。

make preproc

AutoML で自動学習

H2OAutoML で学習

make train_h2o

AutoGluon で学習

make train_autogluon

予測APIサービスの起動

デフォルトで5000番ポートが使われます。

make serve_model

または、 予測API用コンテナを作れます。

make serve

上記サービスに対するテスト

make test_h2o

または

make test_autogluon

同じテストデータに対して、APIを使って予測させる場合と、 モデルを直接ロードして予測させる場合とを比較して、 同じ予測結果になることを確認します


参考)APIのJSON形式

Request

{ "columns": [ "x1", "x2", "x3" ],
  "data": [
               [ 3,    2,    5 ],
               [ 1,    4,    8 ] ] }

Response(分類問題)

分類の確率

[ 0.7, 0.6 ]

automl's People

Contributors

vochicong avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.