module grammar_sklearn.grammar.api_extension
¶
Short summary¶
module mlprodict.grammar_sklearn.grammar.api_extension
Implements decorators to extend the API.
Classes¶
class |
truncated documentation |
---|---|
Extends the API to automatically look for exporters. |
|
Extends the API to automatically look for exporters. |
Static Methods¶
staticmethod |
truncated documentation |
---|---|
Caches the result of a function. |
Methods¶
method |
truncated documentation |
---|---|
A same node may appear at different places in the graph. It means the output is used twice. However, we don’t want … |
|
Exports into any format. The method is looking for one method call ‘_export_<lang>’ and calls it if found. … |
|
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.
- class mlprodict.grammar_sklearn.grammar.api_extension.AutoAction¶
Bases:
object
Extends the API to automatically look for exporters.
- _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.
- static cache(func)¶
Caches the result of a function.
- 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
- class mlprodict.grammar_sklearn.grammar.api_extension.AutoType¶
Bases:
object
Extends the API to automatically look for exporters.
- 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