1
# -*- coding: utf-8 -*-
2 3
"""
3
@file
4
@brief Tiny helpers for scikit-learn exporters.
5
"""
6

7

8 3
def check_type(model, model_type):
9
    """
10
    Raises an exception if the model is not of the expected type.
11

12
    @param      model       *scikit-learn* model
13
    @param      model_type  expected type
14
    """
15 3
    if not isinstance(model, model_type):
16
        raise TypeError(  # pragma: no cover
17
            "Model type {0} is not of type {1}.".format(
18
                type(model), model_type))

Read our documentation on viewing source code .

Loading