mlr-org / mlr3

mlr3: Machine Learning in R - next generation
https://mlr3.mlr-org.com
GNU Lesser General Public License v3.0
927 stars 86 forks source link

phash method should not always be inherited #930

Closed sebffischer closed 1 year ago

sebffischer commented 1 year ago

We had a major bug that AutoTuner and GraphLearner inherited the phash (and hash) method of Learner. Maybe the phash and hash method of the Learner should check whether the learner has construction arguments and if it does, throw an error when the inherited method is called. Thereby we avoid incorrectly inherited phash methods in the future.

mllg commented 1 year ago

Having constructor arguments is not directly connected to a correct implementation of the phash in the derived class (and would be a bit too restrictive?).