Navigation | Overlay |
---|---|
t Navigate files | h Toggle hits |
y Change url to tip of branch | m Toggle misses |
b / v Jump to prev/next hit line | p Toggle partial |
z / x Jump to prev/next missed or partial line | 1..9 Toggle flags |
shift + o Open current page in GitHub | a Toggle all on |
/ or ? Show keyboard shortcuts dialog | c Toggle context lines or commits |
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 .