Machine Learning for Python APIリファレンスを参照してください。 例えば、confusion_matrixについて参照するには、help(oml.metrics.confusion_matrix)を実⾏します。 Documentation: OML4Py Metrics import oml import pandas as pd from oml.metrics import confusion_matrix y_true = [1, 0, 1, 0, 1, 1, 0, 1, 1, 0] --実際の値 y_pred = [1, 1, 1, 0, 0, 1, 1, 0, 0, 0] --予測値 sample_weight = [1, 2, 1, 1, 1, 1, 1, 3, 1, 1] –-各サンプルの重み pdf = pd.DataFrame({'y_true': y_true 'y_pred': y_pred, 'sample_weight': sample_weight}) --モデル評価のために実際の値、予 測値、サンプルの重みを含んだデータフレーム df = oml.create(pdf, ‘test_class’) --モデル評価に使⽤するために、OMLで使⽤されるデータフレーム confusion_matrix(df, 'y_true', 'y_pred', sample_weight='sample_weight') --混同⾏列の計算 Copyright © 2025, Oracle and/or its affiliates 29