module onnx_conv.scorers.register#

Inheritance diagram of mlprodict.onnx_conv.scorers.register

Short summary#

module mlprodict.onnx_conv.scorers.register

Registers new converters.

source on GitHub

Classes#

class

truncated documentation

CustomScorerTransform

Wraps a scoring function into a transformer. Function @see fn register_scorers must be called to register the converter …

Functions#

function

truncated documentation

custom_scorer_transform_converter

Selects the appropriate converter for a @see cl CustomScorerTransform.

custom_scorer_transform_parser

This function updates the inputs and the outputs for a @see cl CustomScorerTransform.

custom_scorer_transform_shape_calculator

Computes the output shapes for a @see cl CustomScorerTransform.

empty_shape_calculator

Does nothing.

register_scorers

Registers operators for @see cl CustomScorerTransform.

Properties#

property

truncated documentation

_repr_html_

HTML representation of estimator. This is redundant with the logic of _repr_mimebundle_. The latter should …

Methods#

method

truncated documentation

__init__

__repr__

Documentation#

@file @brief Registers new converters.

class mlprodict.onnx_conv.scorers.register.CustomScorerTransform(name, fct, kwargs)#

Bases: BaseEstimator, TransformerMixin

Wraps a scoring function into a transformer. Function @see fn register_scorers must be called to register the converter associated to this transform. It takes two inputs, expected values and predicted values and returns a score for each observation.

@param name function name @param fct python function @param kwargs parameters function

__init__(name, fct, kwargs)#

@param name function name @param fct python function @param kwargs parameters function

__repr__()#

Return repr(self).

_sklearn_auto_wrap_output_keys = {'transform'}#
mlprodict.onnx_conv.scorers.register.custom_scorer_transform_converter(scope, operator, container)#

Selects the appropriate converter for a @see cl CustomScorerTransform.

mlprodict.onnx_conv.scorers.register.custom_scorer_transform_parser(scope, model, inputs, custom_parsers=None)#

This function updates the inputs and the outputs for a @see cl CustomScorerTransform.

Parameters:
  • scope – Scope object

  • model – A scikit-learn object (e.g., OneHotEncoder or LogisticRegression)

  • inputs – A list of variables

  • custom_parsers – parsers determines which outputs is expected for which particular task, default parsers are defined for classifiers, regressors, pipeline but they can be rewritten, custom_parsers is a dictionary { type: fct_parser(scope, model, inputs, custom_parsers=None) }

Returns:

A list of output variables which will be passed to next stage

mlprodict.onnx_conv.scorers.register.custom_scorer_transform_shape_calculator(operator)#

Computes the output shapes for a @see cl CustomScorerTransform.

mlprodict.onnx_conv.scorers.register.empty_shape_calculator(operator)#

Does nothing.

mlprodict.onnx_conv.scorers.register.register_scorers()#

Registers operators for @see cl CustomScorerTransform.