Add new traits to to support better MLJ machine type checks and composite models #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add the following traits with specified fallbacks:
<>
fit_data_scitype = Unknown
- for the scitype ofdata
infit(model, verbosity, data...)
calls (and whencemachine(model, data...)
calls). For example, a supervised classification model, the value might be something like likeTuple{Table(Continuous),AbstractVector{Finite}}
. If the model additionally supported weights, the value might beFor current abstract
Model
subtypes, this trait would have a fallback inferred from existing traits, but this allows for models to have one or more custom fit signatures, and allows for a better fallback check for data bound to machines.<>
predict_scitype = Unknown
- a guaranteed upper bound for the scitype of the output ofpredict
method, as distinguished fromtarget_scitype
which is the scitype of the training "target". For supervised models these only agree in theDeterministic
case, not theProbablistic
case, which generally involvesDensity
orSampleable
scitypes. For example, a probabilistic classifier might get the valueAbstractVector{Density{<:Finite}}
. For existingModel
subtypes, this is to be inferred as far as possible from thetarget_scitype
andprediction_type
traits.<>
transform_scitype = Unknown
,inverse_transform_scitype=Unknown
- similar to abovepredict_scitype
.<>
abstract_type = Any
- this will generally be the direct supertype of the model. So, for example, a probabilistic classifier will get the valueProbabilistic
.