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

Consider options for more flexible ptype specification #55

Open
juliasilge opened this issue Oct 29, 2021 · 2 comments
Open

Consider options for more flexible ptype specification #55

juliasilge opened this issue Oct 29, 2021 · 2 comments
Labels
feature a feature request or enhancement

Comments

@juliasilge
Copy link
Member

The ptype concept here in vetiver is used as an input data prototype, for checking that the format of new data at prediction conforms to what the model had at training time.

It is already possible to totally turn off this checking, when appropriate to a certain use case.

In discussions with @t-kalinowski he explained to me how it will likely be important for keras, etc to be able to have more flexible, partially defined input data shapes/prototypes such as an array that is fixed in some dimensions but could be any length in another dimension. I don't currently have great ideas for this, something flexible between "no checking" and "very strict checking".

@juliasilge juliasilge added the feature a feature request or enhancement label Oct 29, 2021
@juliasilge
Copy link
Member Author

We may be able to use vctrs::new_partial() here.

@juliasilge
Copy link
Member Author

juliasilge commented Jan 25, 2023

I have been working on initial support for keras in #164 and here is where I plan to go initially:

  • Error if length(model$inputs) > 1 to exclude multi-input keras models for now. The handling of body in the POST request is going to get pretty complex for multiple inputs, so let's wait to see how folks use it and if they want support for the multi-input model.
  • Require folks to either set save_prototype = FALSE for no checking of new data or input some prototype_data (like for ranger), so like vetiver_model(keras_fit, "cars-keras", prototype_data = data.frame(x_train)[1,]). This still is "rectangular data" only. Let's see how important the higher dimensional case (like images or other non-rectangular data) is for folks and understand how they want this to behave.

I am happy to hear 👂 about what the most important use cases for folks are, so we can build out to more complex support of what keras is capable of.

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

No branches or pull requests

1 participant