Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support different types of prediction #2

Open
isabelizimm opened this issue Feb 9, 2022 · 3 comments
Open

Support different types of prediction #2

isabelizimm opened this issue Feb 9, 2022 · 3 comments
Labels
deploy enhancement New feature or request

Comments

@isabelizimm
Copy link
Contributor

Currently, vetiver supports the predict method when handling models. In other use cases, it maybe important to be able to use predict_proba or predict_log_proba.

@juliasilge
Copy link
Member

On the R side, we handle this by passing in an argument about the type of predictions. It would look something like this:

pr() %>% vetiver_pr_predict(v, type = "prob")
## or 
pr() %>% vetiver_pr_predict(v, type = "quantile")
## and so on

@isabelizimm isabelizimm added enhancement New feature or request deploy labels Mar 13, 2023
@farhadsalimi
Copy link

Hi there,

Has there been any progress on this?
I am particulalry interested in predict_proba, is there a work around that you can direct me to meanwhile?

Many thanks

@isabelizimm
Copy link
Contributor Author

Hi there 👋 -- there has not been worked on yet (for context: nowadays I am spending most of my time in this repository -> https://github.com/posit-dev/positron, but am still around to do maintenance and features as needed :D)

For predict_proba, there are a few current workarounds. The first would be would be able to add another endpoint with VetiverAPI.vetiver_post if you wanted to have both the /predict and /predict_proba options. In this case, you would create a function that returns the predict_proba values and then add it to the API. Another option is to create a custom handler for this prediction type, where the handler_predict would return the output of predict_proba.

Let me know if you run into any troubles or if you have any followup questions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy enhancement New feature or request
Projects
Development

No branches or pull requests

3 participants