Open r3v1 opened 2 years ago
I see what you're doing and it makes sense. I'm wondering if we should just break out the quantile regression to a separate estimator. Does that make sense to do here?
FWIW R's grf does this and I followed this pattern when writing skgrf.
Looks like builds are broken due to this bug in setuptools. Looks like a fix is in progress. https://github.com/pypa/setuptools/issues/3002
I'm wondering if we should just break out the quantile regression to a separate estimator. Does that make sense to do here?
Well, I wouldn't know what would be better, I think you know better the global structure of the project.
When using
RangerForestRegressor
withquantiles=True
in a parameter optimization software (i.e.tune-sklearn
) in order to optimize probabilistic metrics like Continuous Ranked Probability Score (CRPS), it is required the model ot output the 2D tensor corresponding to thepredict_quantiles
method. However, when making CRPS a score metric with the sklearn API withmake_score
function, in a final step, it will call (always) the Ranger'spredict
method, so it is never going to predict quantiles in any way.Here is a brief example of what I am trying to explain:
I think the sklearn API is correct. To surpass this problem, I made some chages in skranger:
RangerForestRegressor
withquantiles: Union[bool, list, np.ndarray]
. Ifquantiles
receives any variable of that type, it will be in quantile mode.predict_quantile
by default when predicting.NOTE: Additional logic should be implemented if a non-quantile prediction is required and quantile mode is enabled.