Exemplo n.º 1
0
def test_with_serde(pd_model: Model):
    interface = model_interface(pd_model)

    obj = {'values': [{'a': 1, 'b': 1}]}

    data_type = pd_model.input_meta
    data = deserialize(obj, data_type)

    interface.predict(data)
Exemplo n.º 2
0
def test_with_serde(pd_model: Model):
    interface = model_interface(pd_model)

    obj = {'values': [{'a': 1, 'b': 1}]}

    data_type, _ = pd_model.wrapper.method_signature('predict')
    data = deserialize(obj, data_type)

    interface.execute('predict', {'vector': data})
Exemplo n.º 3
0
 def load(self) -> Interface:
     mdl.wrapper.bind_model(MockModel(),
                            input_data=pd.DataFrame([[1, 0], [0, 1]],
                                                    columns=model_params))
     return model_interface(mdl)
Exemplo n.º 4
0
 def load(self) -> Interface:
     model.ensure_loaded()
     return model_interface(model)
Exemplo n.º 5
0
def test_interface_types(pd_model: Model, data, prediction):
    interface = model_interface(pd_model)
    pred = interface.predict(data)
    assert (pred == prediction).all()
Exemplo n.º 6
0
def test_interface_types(pd_model: Model, data, prediction):
    interface = model_interface(pd_model)
    assert interface.exposed_method_docs('predict') == pd_model.description
    pred = interface.execute('predict', {'vector': data})
    assert (pred == prediction).all()
Exemplo n.º 7
0
 def load(self) -> Interface:
     mdl.wrapper.bind_model(MockModel())
     return model_interface(mdl)
Exemplo n.º 8
0
def test_interface_types(pd_model: Model, data, prediction):
    interface = model_interface(pd_model)
    pred = interface.execute('predict', {'vector': data})
    assert (pred == prediction).all()