module tools.filename_helper#

Short summary#

module mlprodict.tools.filename_helper

A couple of tools related to filenames.

source on GitHub

Functions#

function

truncated documentation

extract_information_from_filename

Returns a dictionary with information extracted from a filename. An example is better:

make_readable_title

Creates a readable title based on the test information.

Documentation#

A couple of tools related to filenames.

source on GitHub

mlprodict.tools.filename_helper.extract_information_from_filename(name)#

Returns a dictionary with information extracted from a filename. An example is better:

<<<

from mlprodict.tools.filename_helper import extract_information_from_filename

candidates = [
    'bench_DecisionTreeClassifier_default_b_cl_1_4_12_float_.py',
    'bench_DecisionTreeClassifier_default_b_cl_64_10_20_12_double_.py',
    'bench_DecisionTreeClassifier_default_b_cl_64_100_4_12_float_.py',
    'bench_AdaBoostClassifier_default_b_cl_1000_50_12_float__fct.svg',
    'bench_AdaBoostClassifier_default_m_cl_1_4_12_float__line.svg',
    'bench_LogisticRegression_liblinear_b_cl_solverliblinear_1_4_12_float_nozipmap_fct.svg',
]

for name in candidates:
    d = extract_information_from_filename(name)
    print(d)

>>>

    {'model': 'DecisionTreeClassifier', 'scenario': 'default', 'problem': 'b_cl', 'N': 1, 'nf': 4, 'opset': 12, 'opt': 'float'}
    {'model': 'DecisionTreeClassifier', 'scenario': 'default', 'problem': 'b_cl', 'double': True, 'N': 10, 'nf': 20, 'opset': 12, 'opt': 'double'}
    {'model': 'DecisionTreeClassifier', 'scenario': 'default', 'problem': 'b_cl', 'double': True, 'N': 100, 'nf': 4, 'opset': 12, 'opt': 'float'}
    {'model': 'AdaBoostClassifier', 'scenario': 'default', 'problem': 'b_cl', 'N': 1000, 'nf': 50, 'opset': 12, 'opt': 'float', 'profile': 'fct'}
    {'model': 'AdaBoostClassifier', 'scenario': 'default', 'problem': 'm_cl', 'N': 1, 'nf': 4, 'opset': 12, 'opt': 'float', 'profile': 'line'}
    {'model': 'LogisticRegression', 'scenario': 'liblinear', 'problem': 'b_cl', 'opt': 'solverliblinear_float_nozipmap', 'N': 1, 'nf': 4, 'opset': 12, 'profile': 'fct'}

source on GitHub

mlprodict.tools.filename_helper.make_readable_title(infos)#

Creates a readable title based on the test information.

source on GitHub