predict
dict, pd.DataFrame, pd.Series], **kw) predict(endpoint, data: Union[
Make a prediction from model endpoint
Parameters
endpoint :
-
URI path to endpoint
data : Union[dict, pd.DataFrame, pd.Series]
-
New data for making predictions, such as a data frame.
Returns
: dict
-
Endpoint_name and list of endpoint_fx output
Examples
from vetiver import vetiver_endpoint, mock, predict
= mock.get_mock_data()
X, y = vetiver_endpoint(url='http://127.0.0.1:8000/predict')
endpoint predict(endpoint, X)
Notes
To authorize a request to Posit Connect, pass in a dictionary of headers that includes your API key. For example:
= { 'Authorization': f'Key {api_key}' }
h = predict(data = data, endpoint = endpoint, headers=h) response