• EnglishEspañol日本語한국어Português
  • ログイン今すぐ開始

この機械翻訳は、参考として提供されています。

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

問題を作成する

Wrap_mlmodel (Python エージェント API)

構文

newrelic.agent.wrap_mlmodel(model, name=None, version=None, feature_names=None, label_names=None, metadata=None)

機械学習モデルの手動計測を有効にします。

要件

Python エージェント バージョン 9.1.0以上。

説明

これにより、機械学習モデルの手動計測が可能になります。

パラメーター

パラメータ

説明

model

物体

必須。modelは、適合された機械学習モデルです。

name

ストリング

オプション。カスタムモデルの名前。

version

ストリング

オプション。カスタム モデルのリリース バージョン。

feature_names

文字列のリスト

オプション。機能名を表す文字列のリスト。

label_names

文字列のリスト

オプション。ラベル名を表す文字列のリスト。

metadata

ディクト

オプション。モデルに添付するメタデータ。

戻り値

なし。

機械学習モデルをラップする

カスタム機械学習モデルをインストルメント化する例:

def wrap_ml_example():
x_train = [[0, 0], [1, 1]]
y_train = [0, 1]
x_test = [[1.0, 2.0]]
model = CustomTestModel().fit(x_train, y_train)
wrap_mlmodel(
model,
name="MyCustomModel",
version="1.2.3",
feature=["feature0", "feature1"],
label=["label0"],
metadata={"metadata1": "value1", "metadata2": "value2"},
)
labels = model.predict(x_test)
return model
Copyright © 2024 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.