module testing.model_verification
#
Short summary#
module mlprodict.testing.model_verification
Complex but recurring testing functions.
Functions#
function |
truncated documentation |
---|---|
Checks that two floats or two arrays are almost equal. |
|
Checks that a trained model can be exported in a specific list of formats and produces the same outputs if the representation … |
|
Returns |
Documentation#
Complex but recurring testing functions.
- mlprodict.testing.model_verification.check_is_almost_equal(xv, exp, precision=1e-05, message=None)#
Checks that two floats or two arrays are almost equal.
- Parameters:
xv – float or vector
exp – expected value
precision – precision
message – additional message
- mlprodict.testing.model_verification.check_model_representation(model, X, y=None, convs=None, output_names=None, only_float=True, verbose=False, suffix='', fLOG=None)#
Checks that a trained model can be exported in a specific list of formats and produces the same outputs if the representation can be used to predict.
- Parameters:
model – model (a class or an instance of a model but not trained)
X – features
y – targets
convs – list of format to check, all possible by default
['json', 'c']
output_names – list of output columns (can be None, a default value is infered based on scikit-learn output then)
verbose – print some information
suffix – add this to disambiguate module
fLOG – logging function
- Returns:
function to call to run the prediction
- mlprodict.testing.model_verification.iris_data()#
Returns
(X, y)
for iris data.