Reference

Top-level package for ebm2onnx.

ebm2onnx.get_dtype_from_pandas(df)[source]

Infers the features names and types from a pandas dataframe

Example

>>>import ebm2onnx >>> >>>dtype = ebm2onnx.get_dtype_from_pandas(my_df)

Parameters:

df – A pandas dataframe

Returns:

A dict that can be used as the type argument of the to_onnx function.

ebm2onnx.to_onnx(model, dtype, name='ebm', predict_proba=False, explain=False, target_opset=None, prediction_name='prediction', probabilities_name='probabilities', explain_name='scores')[source]

Converts an EBM model to ONNX.

The returned model contains one to three output. The first output is always the prediction, and is named “prediction”. If predict_proba is set to True, then another output named “probabilities” is added. If explain is set to True, then another output named “scores” is added.

Parameters:
  • model – The EBM model, trained with interpretml

  • dtype – A dict containing the type of each input feature. Types are expressed as strings, the following values are supported: float, double, int, str.

  • name – [Optional] The name of the model

  • predict_proba – [Optional] For classification models, output prediction probabilities instead of class

  • explain – [Optional] Adds an additional output with the score per feature per class

  • target_opset – [Optional] The target onnx opset version to use

Returns:

An ONNX model.