banner
andrewji8

Being towards death

Heed not to the tree-rustling and leaf-lashing rain, Why not stroll along, whistle and sing under its rein. Lighter and better suited than horses are straw sandals and a bamboo staff, Who's afraid? A palm-leaf plaited cape provides enough to misty weather in life sustain. A thorny spring breeze sobers up the spirit, I feel a slight chill, The setting sun over the mountain offers greetings still. Looking back over the bleak passage survived, The return in time Shall not be affected by windswept rain or shine.
telegram
twitter
github

Autogluon、素晴らしいPythonライブラリ

今日は皆さんと超強力な Python ライブラリ、autogluon を共有します。

https://github.com/autogluon/autogluon
AutoGluon は、機械学習のための AutoML ツールキットであり、エンドツーエンドの機械学習タスクを自動化し、わずか数行のコードで強力な予測性能を実現することができます。
AutoGluon は「機械学習タスクを自動化する」ことで、アプリケーション内で簡単に強力な予測性能を実現できます。
初めての体験
AutoGluon のインストール
pip を使用して直接インストールすることができます。

pip install autogluon

データセットのロード
TabularDataset を使用してデータセットをロードすることができます。

from autogluon.tabular import TabularDataset, TabularPredictor
train_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/Inc/train.csv')
test_data = TabularDataset('https://autogluon.s3.amazonaws.com/datasets/Inc/test.csv')

モデルの構築
このモデルを使用するには、「評価指標、従属変数、および結果を保存するディレクトリ」を初期化する必要があります。

以下の例では、評価指標として f1 を使用しています。従属変数は「class」であり、モデルは「output_models」フォルダに配置されます。

evaluation_metric= "f1"
data_label= "class"
save_path= "output_models"
predictor = TabularPredictor(label='class').fit(train_data, time_limit=120)  # 120秒でモデルをフィットさせる
leaderboard = predictor.leaderboard(test_data)
#予測器の作成
predictor = TabularPredictor(label=data_label,path=save_path,eval_metric=evaluation_metric) 
predictor=predictor.fit(train_data)
predictor.leaderboard(silent=True)

以下の図は、「すべてのモデルの試行状況とそれらのモデルでのスコア」を示しています。

image
次に、特徴の重要性を見てみましょう。

X = train_data 
Predictor.feature_importance(X)

image

すべての構築済みモデルは、「output_models」という出力フォルダに保存されています。

image

読み込み中...
文章は、創作者によって署名され、ブロックチェーンに安全に保存されています。