Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 1 addition & 20 deletions python/cuml/cuml/accel/tests/scikit-learn/xfail-list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,6 @@
- "sklearn.inspection.tests.test_partial_dependence::test_multiclass_multioutput[RandomForestClassifier]"
- "sklearn.inspection.tests.test_partial_dependence::test_partial_dependence_sample_weight_with_recursion"
- "sklearn.inspection.tests.test_partial_dependence::test_partial_dependence_unfitted[estimator0]"
- "sklearn.inspection.tests.test_partial_dependence::test_partial_dependence_unfitted[estimator1]"
- "sklearn.inspection.tests.test_partial_dependence::test_recursion_decision_tree_vs_forest_and_gbdt[0]"
- "sklearn.inspection.tests.test_permutation_importance::test_permutation_importance_correlated_feature_regression[ones-0.5-1]"
- "sklearn.inspection.tests.test_permutation_importance::test_permutation_importance_correlated_feature_regression[ones-0.5-2]"
Expand Down Expand Up @@ -702,22 +701,8 @@
- "sklearn.manifold.tests.test_t_sne::test_uniform_grid[barnes_hut]"
- "sklearn.manifold.tests.test_t_sne::test_uniform_grid[exact]"
- "sklearn.manifold.tests.test_t_sne::test_verbose"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[DetCurveDisplay-clf0]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[DetCurveDisplay-clf1]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[DetCurveDisplay-clf2]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[PrecisionRecallDisplay-clf0]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[PrecisionRecallDisplay-clf1]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[PrecisionRecallDisplay-clf2]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[RocCurveDisplay-clf0]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[RocCurveDisplay-clf1]"
- "sklearn.metrics._plot.tests.test_common_curve_display::test_display_curve_not_fitted_errors[RocCurveDisplay-clf2]"
- "sklearn.metrics._plot.tests.test_confusion_matrix_display::test_confusion_matrix_pipeline[clf]"
- "sklearn.metrics._plot.tests.test_precision_recall_display::test_precision_recall_display_pipeline[clf0]"
- "sklearn.metrics._plot.tests.test_precision_recall_display::test_precision_recall_display_pipeline[clf1]"
- "sklearn.metrics._plot.tests.test_predict_error_display::test_from_estimator_not_fitted"
- "sklearn.metrics._plot.tests.test_roc_curve_display::test_roc_curve_display_complex_pipeline[from_estimator-clf0]"
- "sklearn.metrics._plot.tests.test_roc_curve_display::test_roc_curve_display_complex_pipeline[from_estimator-clf1]"
- "sklearn.metrics._plot.tests.test_roc_curve_display::test_roc_curve_display_complex_pipeline[from_estimator-clf2]"
- "sklearn.metrics.tests.test_pairwise::test_euclidean_distances_extreme_values[1-float64-1e-08-0.99]"
- "sklearn.metrics.tests.test_pairwise::test_euclidean_distances_extreme_values[1000000-float64-1e-08-0.99]"
- "sklearn.metrics.tests.test_score_objects::test_get_scorer_multilabel_indicator"
Expand Down Expand Up @@ -962,7 +947,6 @@
- "sklearn.tests.test_common::test_estimators[Pipeline(steps=[('scaler',StandardScaler()),('final_estimator',LogisticRegression())])-check_estimators_nan_inf]"
- "sklearn.tests.test_common::test_estimators[Pipeline(steps=[('scaler',StandardScaler()),('final_estimator',LogisticRegression())])-check_estimators_overwrite_params]"
- "sklearn.tests.test_common::test_estimators[Pipeline(steps=[('scaler',StandardScaler()),('final_estimator',LogisticRegression())])-check_fit2d_1sample]"
- "sklearn.tests.test_common::test_estimators[Pipeline(steps=[('scaler',StandardScaler()),('final_estimator',LogisticRegression())])-check_fit_check_is_fitted]"
- "sklearn.tests.test_common::test_estimators[Pipeline(steps=[('scaler',StandardScaler()),('final_estimator',LogisticRegression())])-check_supervised_y_2d]"
- "sklearn.tests.test_common::test_estimators[Pipeline(steps=[('scaler',StandardScaler()),('final_estimator',LogisticRegression())])-check_supervised_y_no_nan]"
- "sklearn.tests.test_common::test_estimators[Pipeline(steps=[('scaler',StandardScaler()),('final_estimator',Ridge())])-check_dont_overwrite_parameters]"
Expand Down Expand Up @@ -1212,15 +1196,12 @@
- "sklearn.utils.tests.test_estimator_checks::test_check_estimator"
- "sklearn.utils.tests.test_estimator_checks::test_check_estimator_clones"
- "sklearn.utils.tests.test_estimator_checks::test_check_estimator_pairwise"
- "sklearn.utils.tests.test_estimator_html_repr::test_estimator_html_repr_fitted_icon[estimator0]"
- "sklearn.utils.tests.test_estimator_html_repr::test_estimator_html_repr_fitted_icon[estimator1]"
- "sklearn.utils.tests.test_estimator_html_repr::test_estimator_html_repr_fitted_icon[estimator2]"
- "sklearn.utils.tests.test_estimator_html_repr::test_show_arrow_pipeline"
- "sklearn.utils.tests.test_validation::test_has_fit_parameter"
- reason: Test is flaky with cuml.accel
strict: false
marker: cuml_accel_flaky
tests:
- "sklearn.utils.tests.test_estimator_html_repr::test_show_arrow_pipeline"
- "sklearn.cluster.tests.test_k_means::test_score_max_iter[42-KMeans]"
- "sklearn.decomposition.tests.test_truncated_svd::test_explained_variance_components_10_20[arpack-sparse]"
- "sklearn.decomposition.tests.test_truncated_svd::test_explained_variance_components_10_20[randomized-sparse]"
Expand Down
8 changes: 6 additions & 2 deletions python/cuml/cuml/internals/base.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ class Base(TagsMixin,
self._input_type = None
self._input_mem_type = None
self.target_dtype = None
self.n_features_in_ = None

nvtx_benchmark = os.getenv('NVTX_BENCHMARK')
if nvtx_benchmark and nvtx_benchmark.lower() == 'true':
Expand Down Expand Up @@ -479,7 +478,12 @@ class Base(TagsMixin,
if isinstance(X, int):
self.n_features_in_ = X
else:
self.n_features_in_ = X.shape[1]
shape = X.shape
# dataframes can have only one dimension
if len(shape) == 1:
self.n_features_in_ = 1
else:
self.n_features_in_ = shape[1]

def _more_tags(self):
# 'preserves_dtype' tag's Scikit definition currently only applies to
Expand Down
6 changes: 3 additions & 3 deletions python/cuml/cuml/tests/test_cuml_descr_decor.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_input(self):

# === Standard Functions ===
def fit(self, X, convert_dtype=True) -> "DummyTestEstimator":

self._set_base_attributes(output_type=X, n_features=X)
return self

def predict(self, X, convert_dtype=True) -> CumlArray:
Expand Down Expand Up @@ -228,11 +228,11 @@ def calc_n_features(shape):
# When cudf and shape[1] is used, a series is created which will
# remove the last shape
if input_type == "cudf" and shape[1] == 1:
return None
return 1

return shape[1]

return None
return 1

assert est._input_type == input_type
assert est.target_dtype is None
Expand Down
Loading