-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
I suggest the way to do this is that fit and predict should stay as they.
They are a consistent API with observations always a columns.
Further, ObservationDIms does not support a different obs_arrangement for different methods.
Only for different functions.
So can only declare it once for fit and predict, not once per model.
So we have another function e.g:
function smart_fit(template, outputs, inputs, weights=nothing; obsdim=nothing, kwargs...)
outputs = organise_obs(MatrixColsOfObs(), outputs; obsdim=obsdim)
inputs = organise_obs(MatrixColsOfObs(), inputs; obsdim=obsdim)
if weights === nothing
weights = uweights(size(outputs, 2))
end
return @mock fit(template, outputs, inputs, weights; kwargs...)
end
function smart_predict(model, inputs; obsdim=nothing, kwargs...)
new_inputs = organise_obs(MatrixColsOfObs(), inputs; obsdim=obsdim)
permute = xor(new_inputs isa PermutedDimsArray, inputs isa PermutedDimsArray)
outputs = @mock predict(model, new_inputs, weights; kwargs...)
if permute
outputs = PermutedDimsArray(outputs, (2, 1))
end
return outputs
endMetadata
Metadata
Assignees
Labels
No labels