sktime / skpro

A unified framework for tabular probabilistic regression, time-to-event prediction, and probability distributions in python
https://skpro.readthedocs.io/en/latest
BSD 3-Clause "New" or "Revised" License
249 stars 46 forks source link

[ENH] Add polars version of dummy proba regressor #447

Open julian-fong opened 3 months ago

julian-fong commented 3 months ago

Completes #440 and is a polars extension of #437

Adds polars version of dummy proba regressor - also to help test e2e input flow of polars tables

In this pull request:

julian-fong commented 3 months ago

tests in check_estimator should be failing... for _predict_* functions i.e quantile and proba

fkiraly commented 3 months ago

They are not failing because there are no tests covering the new code, i.e., feeding polars objects, is that not so?

julian-fong commented 3 months ago

running check_estimator locally does incur some failures (tests are being ran), but maybe I am doing something wrong?

{'test_clone[DummyPolarsProbaRegressor-0]': 'PASSED',
 'test_clone[DummyPolarsProbaRegressor-1]': 'PASSED',
 'test_constructor[DummyPolarsProbaRegressor]': 'PASSED',
 'test_create_test_instance[DummyPolarsProbaRegressor]': 'PASSED',
 'test_create_test_instances_and_names[DummyPolarsProbaRegressor]': 'PASSED',
 'test_get_params[DummyPolarsProbaRegressor-0]': 'PASSED',
 'test_get_params[DummyPolarsProbaRegressor-1]': 'PASSED',
 'test_inheritance[DummyPolarsProbaRegressor]': 'PASSED',
 'test_no_between_test_case_side_effects[DummyPolarsProbaRegressor-0-0]': 'PASSED',
 'test_no_between_test_case_side_effects[DummyPolarsProbaRegressor-0-1]': 'PASSED',
 'test_no_between_test_case_side_effects[DummyPolarsProbaRegressor-1-0]': 'PASSED',
 'test_no_between_test_case_side_effects[DummyPolarsProbaRegressor-1-1]': 'PASSED',
 'test_no_cross_test_side_effects_part1[DummyPolarsProbaRegressor-0]': 'PASSED',
 'test_no_cross_test_side_effects_part1[DummyPolarsProbaRegressor-1]': 'PASSED',
 'test_no_cross_test_side_effects_part2[DummyPolarsProbaRegressor-0]': 'PASSED',
 'test_no_cross_test_side_effects_part2[DummyPolarsProbaRegressor-1]': 'PASSED',
 'test_object_tags[DummyPolarsProbaRegressor]': 'PASSED',
 'test_repr[DummyPolarsProbaRegressor-0]': 'PASSED',
 'test_repr[DummyPolarsProbaRegressor-1]': 'PASSED',
 'test_set_params[DummyPolarsProbaRegressor-0]': 'PASSED',
 'test_set_params[DummyPolarsProbaRegressor-1]': 'PASSED',
 'test_set_params_sklearn[DummyPolarsProbaRegressor]': 'PASSED',
 'test_valid_object_class_tags[DummyPolarsProbaRegressor]': 'PASSED',
 'test_valid_object_tags[DummyPolarsProbaRegressor-0]': 'PASSED',
 'test_valid_object_tags[DummyPolarsProbaRegressor-1]': 'PASSED',
 'test_fit_does_not_overwrite_hyper_params[DummyPolarsProbaRegressor-0-ProbaRegressorBasic]': 'PASSED',
 'test_fit_does_not_overwrite_hyper_params[DummyPolarsProbaRegressor-0-ProbaRegressorXcolMixIxYnp]': 'PASSED',
 'test_fit_does_not_overwrite_hyper_params[DummyPolarsProbaRegressor-0-ProbaRegressorSurvival]': 'PASSED',
 'test_fit_does_not_overwrite_hyper_params[DummyPolarsProbaRegressor-1-ProbaRegressorBasic]': 'PASSED',
 'test_fit_does_not_overwrite_hyper_params[DummyPolarsProbaRegressor-1-ProbaRegressorXcolMixIxYnp]': 'PASSED',
 'test_fit_does_not_overwrite_hyper_params[DummyPolarsProbaRegressor-1-ProbaRegressorSurvival]': 'PASSED',
 'test_fit_returns_self[DummyPolarsProbaRegressor-0-ProbaRegressorBasic]': 'PASSED',
 'test_fit_returns_self[DummyPolarsProbaRegressor-0-ProbaRegressorXcolMixIxYnp]': 'PASSED',
 'test_fit_returns_self[DummyPolarsProbaRegressor-0-ProbaRegressorSurvival]': 'PASSED',
 'test_fit_returns_self[DummyPolarsProbaRegressor-1-ProbaRegressorBasic]': 'PASSED',
 'test_fit_returns_self[DummyPolarsProbaRegressor-1-ProbaRegressorXcolMixIxYnp]': 'PASSED',
 'test_fit_returns_self[DummyPolarsProbaRegressor-1-ProbaRegressorSurvival]': 'PASSED',
 'test_fit_updates_state[DummyPolarsProbaRegressor-0-ProbaRegressorBasic]': 'PASSED',
 'test_fit_updates_state[DummyPolarsProbaRegressor-0-ProbaRegressorXcolMixIxYnp]': 'PASSED',
 'test_fit_updates_state[DummyPolarsProbaRegressor-0-ProbaRegressorSurvival]': 'PASSED',
 'test_fit_updates_state[DummyPolarsProbaRegressor-1-ProbaRegressorBasic]': 'PASSED',
 'test_fit_updates_state[DummyPolarsProbaRegressor-1-ProbaRegressorXcolMixIxYnp]': 'PASSED',
 'test_fit_updates_state[DummyPolarsProbaRegressor-1-ProbaRegressorSurvival]': 'PASSED',
 'test_input_output_contract[DummyPolarsProbaRegressor-0]': AssertionError(),
 'test_input_output_contract[DummyPolarsProbaRegressor-1]': AssertionError(),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-0-alpha=0.05]': AttributeError("'DataFrame' object has no attribute 'index'"),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-0-alpha=[0.1]]': AttributeError("'DataFrame' object has no attribute 'index'"),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-0-alpha=[0.25, 0.75]]': AttributeError("'DataFrame' object has no attribute 'index'"),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-0-alpha=[0.3, 0.1, 0.9]]': AttributeError("'DataFrame' object has no attribute 'index'"),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-1-alpha=0.05]': AttributeError("'DataFrame' object has no attribute 'index'"),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-1-alpha=[0.1]]': AttributeError("'DataFrame' object has no attribute 'index'"),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-1-alpha=[0.25, 0.75]]': AttributeError("'DataFrame' object has no attribute 'index'"),
 'test_pred_quantiles_interval[DummyPolarsProbaRegressor-1-alpha=[0.3, 0.1, 0.9]]': AttributeError("'DataFrame' object has no attribute 'index'")}
fkiraly commented 3 months ago

that's strange. Could you kindly investigate?

fkiraly commented 3 months ago

oh, I think I got it - the estimator is in a private module. The test framework skips estimators that are private and not publicly exported.

julian-fong commented 3 months ago

@fkiraly How do we specify to ignore 'pandas dataframe' tests for estimators that do not have pandas specified x/y mtypes?

fkiraly commented 3 months ago

we should not skip these - it should still work with back/from conversion.