-
Notifications
You must be signed in to change notification settings - Fork 156
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
Feature request: ability to convert scitype warnings into errors #908
Comments
Interesting request. I guess these are some possibilities:
Option 1 is breaking but if that's the best behaviour that doesn't bother me (we have new breaking release in the works which already tweaks the type checking behaviour; see here). I'm not so keen on 3 myself - I try to avoid "hidden knowledge", which this would probably be. Not big on 4 either. Thoughts? |
For the record, if the model declares |
IMO this should be mitigated by how frequent this is going to happen for a beginner user. And given it's quite common (e.g. people trying class stuff with continuous etc) if they get an error by default it will be really off-putting. In that sense I'd prefer 3, a bit like you could have a global toggle for verbosity or indeed for colouring |
@tlienart Thanks for that. I am finding, however, that at least 90% of the time the warning ultimately leads to an error downstream (fit or predict). Perhaps you have a different experience? |
you're far better placed to judge this; my impression from working with folks who were used to scikitlearn is that with scikitlearn users typically don't think about data types (they should but they don't) and sklearn often kind of does the right thing anyway. Maybe being strict is better here but then there must be significant documentation exposed by the code when errors show up about what to do (without having the users needing to read the entire scitypes docs, even if they should they won't want to do that whereas they might read a well crafted docstring). Just my impression though, I don't have as much experience as you guys with MLJ users |
@DilumAluthge Your thoughts? |
I definitely don't like option 4, because I do think that users should have the ability to choose between the warning and the error. Can you explain a little bit what option 3 would be? By "global option", do you mean e.g. an environment variable I think the main two options to consider are option 1 and option 2. In both of those cases, when the user wants to specify what behavior they want, they would do one of the two following:
And then, the only difference between option 1 and option 2 is what the default value of the
I think @tlienart has a good point about how new users might have a bad experience with option 1. So I think my recommendation would be to go with option 2. (But it would be good to get some more details on what the interface for option 3 would look like.) |
Okay, let's go with option 2: new kwarg, default is |
I would propose to combine 2 & 3 and, instead of using global DEFAULT_CHECK_LEVEL = 1
set_default_checklevel(i::Integer) = (global DEFAULT_CHECK_LEVEL = i) I'm not 100% sure if that works, though. Edit: We might also discuss the naming of the |
How about |
@davnn 's suggestion sounds reasonable, and now implemented at JuliaAI/MLJBase.jl#753. |
Maybe
Thanks a lot for investigating how to implement such package-wide options - interesting and nice to know that it works! |
@davnn Thanks for the feedback. I might imagine I think I'll stick with |
Sometimes, when I do
mach = MLJ.machine(model, X, y)
, it prints one or more warnings of the form:Is there a way to convert those warnings to errors that are thrown immediately?
The text was updated successfully, but these errors were encountered: