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)
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})
def load(self) -> Interface: mdl.wrapper.bind_model(MockModel(), input_data=pd.DataFrame([[1, 0], [0, 1]], columns=model_params)) return model_interface(mdl)
def load(self) -> Interface: model.ensure_loaded() return model_interface(model)
def test_interface_types(pd_model: Model, data, prediction): interface = model_interface(pd_model) pred = interface.predict(data) assert (pred == prediction).all()
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()
def load(self) -> Interface: mdl.wrapper.bind_model(MockModel()) return model_interface(mdl)
def test_interface_types(pd_model: Model, data, prediction): interface = model_interface(pd_model) pred = interface.execute('predict', {'vector': data}) assert (pred == prediction).all()