module onnx_conv.validate_scenarios#

Short summary#

module mlprodict.onnx_conv.validate_scenarios

Scenario for additional converters.

source on GitHub

Functions#

function

truncated documentation

build_custom_scenarios

Defines parameters values for some operators.

find_suitable_problem

Defines suitables problems for additional converters.

Documentation#

Scenario for additional converters.

source on GitHub

mlprodict.onnx_conv.validate_scenarios.build_custom_scenarios()#

Defines parameters values for some operators.

<<<

from mlprodict.onnx_conv.validate_scenarios import build_custom_scenarios
import pprint
pprint.pprint(build_custom_scenarios())

>>>

    {<class 'lightgbm.sklearn.LGBMClassifier'>: [('default',
                                                  {'n_estimators': 5},
                                                  {'conv_options': [{<class 'lightgbm.sklearn.LGBMClassifier'>: {'zipmap': False}}]})],
     <class 'xgboost.sklearn.XGBClassifier'>: [('default',
                                                {'n_estimators': 5},
                                                {'conv_options': [{<class 'xgboost.sklearn.XGBClassifier'>: {'zipmap': False}}]})],
     <class 'lightgbm.sklearn.LGBMRegressor'>: [('default', {'n_estimators': 100})],
     <class 'xgboost.sklearn.XGBRegressor'>: [('default', {'n_estimators': 100})]}

source on GitHub

mlprodict.onnx_conv.validate_scenarios.find_suitable_problem(model)#

Defines suitables problems for additional converters.

<<<

from mlprodict.onnx_conv.validate_scenarios import find_suitable_problem
from mlprodict.onnxrt.validate.validate_helper import sklearn_operators
from pyquickhelper.pandashelper import df2rst
from pandas import DataFrame
res = sklearn_operators(extended=True)
res = [_ for _ in res if _['package'] != 'sklearn']
rows = []
for model in res:
    name = model['name']
    row = dict(name=name)
    try:
        prob = find_suitable_problem(model['cl'])
        if prob is None:
            continue
        for p in prob:
            row[p] = 'X'
    except RuntimeError:
        pass
    rows.append(row)
df = DataFrame(rows).set_index('name')
df = df.sort_index()
print(df2rst(df, index=True))

>>>

name

b-cl

m-cl

~b-cl-64

b-reg

~b-reg-64

LGBMClassifier

X

X

X

LGBMRegressor

X

X

XGBClassifier

X

X

X

XGBRegressor

X

X

source on GitHub