module testing.script_testing
#
Short summary#
module mlprodict.testing.script_testing
Utilies to test script from scikit-learn documentation.
Classes#
class |
truncated documentation |
---|---|
Raised when a variable is missing. |
Functions#
function |
truncated documentation |
---|---|
Comments out all lines containing |
|
Extracts the name of the fitted models and the data used to train it. |
|
Tries onnx conversion. |
|
Checks that models fitted in an example from scikit-learn documentation can be converted into ONNX. |
Documentation#
Utilies to test script from scikit-learn documentation.
- exception mlprodict.testing.script_testing.MissingVariableError#
Bases:
RuntimeError
Raised when a variable is missing.
- mlprodict.testing.script_testing._clean_script(content)#
Comments out all lines containing
.show()
.
- mlprodict.testing.script_testing._enumerate_fit_info(fits)#
Extracts the name of the fitted models and the data used to train it.
- mlprodict.testing.script_testing._try_onnx(loc, model_name, args_name, **options)#
Tries onnx conversion.
- Parameters:
loc – available variables
model_name – model name among these variables
args_name – arguments name among these variables
options – additional options for the conversion
- Returns:
onnx model
- mlprodict.testing.script_testing.verify_script(file_or_name, try_onnx=True, existing_loc=None, **options)#
Checks that models fitted in an example from scikit-learn documentation can be converted into ONNX.
- Parameters:
file_or_name – file or string
try_onnx – try the onnx conversion
existing_loc – existing local variables
options – conversion options
- Returns:
list of converted models