module grammar.grammar_sklearn.grammar.api_extension#

Inheritance diagram of mlprodict.grammar.grammar_sklearn.grammar.api_extension

Short summary#

module mlprodict.grammar.grammar_sklearn.grammar.api_extension

Implements decorators to extend the API.

source on GitHub

Classes#

class

truncated documentation

AutoAction

Extends the API to automatically look for exporters.

AutoType

Extends the API to automatically look for exporters.

Static Methods#

staticmethod

truncated documentation

cache

Caches the result of a function.

Methods#

method

truncated documentation

_reset_cache

A same node may appear at different places in the graph. It means the output is used twice. However, we don’t want …

export

Exports into any format. The method is looking for one method call ‘_export_<lang>’ and calls it if found. …

format_value

Exports into any format. The method is looking for one method call ‘_export_<lang>’ and calls it if found. …

Documentation#

Implements decorators to extend the API.

source on GitHub

class mlprodict.grammar.grammar_sklearn.grammar.api_extension.AutoAction#

Bases: object

Extends the API to automatically look for exporters.

source on GitHub

_reset_cache()#

A same node may appear at different places in the graph. It means the output is used twice. However, we don’t want to include the code to generate that same output twice. We cache it and keep some information about it.

source on GitHub

static cache(func)#

Caches the result of a function.

source on GitHub

export(lang='json', hook=None, result_name=None)#

Exports into any format. The method is looking for one method call ‘_export_<lang>’ and calls it if found.

Parameters:
  • lang – language

  • hook – tweaking parameters

  • result_name – the name of the result decided by the parent of this node

Returns:

depends on the language

source on GitHub

class mlprodict.grammar.grammar_sklearn.grammar.api_extension.AutoType#

Bases: object

Extends the API to automatically look for exporters.

source on GitHub

format_value(value, lang='json', hook=None)#

Exports into any format. The method is looking for one method call ‘_export_<lang>’ and calls it if found.

Parameters:
  • value – value to format

  • lang – language

  • hook – tweaking parameters

Returns:

depends on the language

source on GitHub