I'm trying to use Vetiver to deploy an isolation forest model (for anomaly detection) to an API endpoint.
All is going well by adapting the example here.
However, when deployed, the endpoint uses the model.predict()
method by default (which returns 1 for normal or -1 for anomaly).
I want the model to return a score between 0 and 1 as given by the model.score_samples()
method.
Does anybody know how I can configure the Vetiver endpoint such that it uses .score_samples()
rather than .predict()
for scoring?
Thanks