Add check_estimator tests to classifier and regressor. We can't test the survival forest because it conforms to the sksurv api rather than sklearn's.
In doing so we add validation to ensure check_estimator passes. We also add logic to ensure that passing sample_weight of ones is equivalent to passing None.
Changes:
Ensure self.respect_categorical_features is unchanged when fitting by introducing self.respect_categorical_features_
Change self.n_features_ to self.n_features_in_
Add validation to classification targets, ensuring regression targets can't be passed to classifier
Add sample weight validation to ensure that passing weights of ones results in identical output when passing None. We do this because ranger does additional RNG on weighted sampling when non-null weights are passed.
Use self._validate_data in lieu of check_X_y when possible
Use self._check_n_features in lieu of manually setting n features
Add
check_estimator
tests to classifier and regressor. We can't test the survival forest because it conforms to the sksurv api rather than sklearn's.In doing so we add validation to ensure
check_estimator
passes. We also add logic to ensure that passingsample_weight
of ones is equivalent to passingNone
.Changes:
self.respect_categorical_features
is unchanged when fitting by introducingself.respect_categorical_features_
self.n_features_
toself.n_features_in_
ones
results in identical output when passingNone
. We do this because ranger does additional RNG on weighted sampling when non-null weights are passed.self._validate_data
in lieu ofcheck_X_y
when possibleself._check_n_features
in lieu of manually setting n featureshttps://scikit-learn.org/stable/modules/generated/sklearn.utils.estimator_checks.check_estimator.html