module asv_benchmark._create_asv_helper
#
Short summary#
module mlprodict.asv_benchmark._create_asv_helper
Functions to creates a benchmark based on asv for many regressors and classifiers.
Functions#
function |
truncated documentation |
---|---|
Adds additional imports for experimental models. |
|
Formats a dictionary as code. |
|
Returns created, location_model, prefix_import. |
|
Reads the testing pattern. |
|
Selects a benchmark type based on the problem kind. |
|
Returns the list of subfolders for a model. |
|
Modifies a template such as |
|
Finds in scikit-learn the missing pieces. |
|
Finds the corresponding modulee for an element of scikit-learn. |
Documentation#
Functions to creates a benchmark based on asv for many regressors and classifiers.
- mlprodict.asv_benchmark._create_asv_helper._additional_imports(model_name)#
Adds additional imports for experimental models.
- mlprodict.asv_benchmark._create_asv_helper._asv_class_name(model, scenario, optimisation, extra, dofit, conv_options, problem, shorten=True)#
- mlprodict.asv_benchmark._create_asv_helper._display_code_lines(code)#
- mlprodict.asv_benchmark._create_asv_helper._format_dict(opts, indent)#
Formats a dictionary as code.
- mlprodict.asv_benchmark._create_asv_helper._handle_init_files(model, flat, location, verbose, location_pyspy, fLOG)#
Returns created, location_model, prefix_import.
- mlprodict.asv_benchmark._create_asv_helper._read_patterns()#
Reads the testing pattern.
- mlprodict.asv_benchmark._create_asv_helper._select_pattern_problem(prob, patterns)#
Selects a benchmark type based on the problem kind.
- mlprodict.asv_benchmark._create_asv_helper._sklearn_subfolder(model)#
Returns the list of subfolders for a model.
- mlprodict.asv_benchmark._create_asv_helper.add_model_import_init(class_content, model, optimisation=None, extra=None, conv_options=None)#
Modifies a template such as
TemplateBenchmarkClassifier
with code associated to the model model.- Parameters:
class_content – template (as a string)
model – model class
optimisation – model optimisation
extra – addition parameter to the constructor
conv_options – options for the conversion to ONNX
@returm modified template
- mlprodict.asv_benchmark._create_asv_helper.find_missing_sklearn_imports(pieces)#
Finds in scikit-learn the missing pieces.
- Parameters:
pieces – list of names in scikit-learn
- Returns:
list of corresponding imports
- mlprodict.asv_benchmark._create_asv_helper.find_sklearn_module(piece)#
Finds the corresponding modulee for an element of scikit-learn.
- Parameters:
piece – name to import
- Returns:
module name
The implementation is not intelligence and should be improved. It is a kind of white list.