Closed schalkdaniel closed 1 year ago
For now, a mixture is implemented, e.g. the response can be loaded with a constructor while the loss requires to call a method. I like the constructor option more, but if this is not possible for all classes, I would use a consistent member function.
Another option would be to have a constructor with n + 1
arguments when n
is the maximum number of arguments in one of the constructors. Something like:
Loss (json, bool, bool, bool)
Not very pretty but would work.
removed
The Rcpp modules do not allow to have multiple constructors with the same number of arguments. E.g. Rcpp only uses the first constructor when defining two constructors
Loss(double)
andLoss(json)
with one argument. This makes it difficult to load all classes from a constructor ...Workaround: Have a method
$loadFromJson()
which resets the internal loss pointer:Drawbacks: