smartcore
smartcore copied to clipboard
Use Default::default instead of new in traits
I'm submitting a
- [x] improvement.
Current Behaviour:
Currently, traits in https://github.com/smartcorelib/smartcore/blob/development/src/api.rs#L24 requires implementation of fn new() -> Self;
, I think that instead we should rely on Default::default,
Do you want to work on this issue?
Yes
Any thoughts?
I had to implement the new() method as it looked like the best way of passing the estimators to cross_validate
and cross_validate_predict
. If you find a better way would be happy to go for it.
gotcha, I think that we can use generics to define the type that we need to use instead of passing a blank parameter that is not used