def test_non_meta_estimators(): for name, Estimator in all_estimators(): estimator = Estimator() if name == 'kmodes': for check in _yield_all_checks(name, Estimator): # Skip these if hasattr(check, '__name__'): if check.__name__ not in ('check_clustering', 'check_dtype_object'): yield _named_check(check, name), name, estimator else: yield check, name, estimator elif name == 'kprototypes': for check in _yield_all_checks(name, Estimator): # Only do these if hasattr(check, '__name__') and check.__name__ in ( 'check_estimator_sparse_data', 'check_clusterer_compute_labels_predict', 'check_estimators_partial_fit_n_features'): yield _named_check(check, name), name, estimator
def test_all_estimators(): estimators = all_estimators() # Meta sanity-check to make sure that the estimator introspection runs # properly assert_greater(len(estimators), 0) for name, Estimator in estimators: # some can just not be sensibly default constructed yield (_named_check(check_parameters_default_constructible, name), name, Estimator)
def test_non_meta_estimators(): for name, Estimator in all_estimators(): if name == 'kmodes': relevant_checks = KMODES_INCLUDE_CHECKS elif name == 'kprototypes': relevant_checks = KPROTOTYPES_INCLUDE_CHECKS else: raise NotImplementedError estimator = Estimator() for check in _yield_all_checks(name, estimator): if hasattr(check, '__name__') and check.__name__ in relevant_checks: yield _named_check(check, name), name, estimator
def test_non_meta_estimators(): for name, Estimator in all_estimators(): estimator = Estimator() if name == 'kmodes': for check in _yield_all_checks(name, Estimator): # Skip these if hasattr(check, '__name__'): if check.__name__ not in ('check_clustering', 'check_dtype_object'): yield _named_check(check, name), name, estimator else: yield check, name, estimator elif name == 'kprototypes': for check in _yield_all_checks(name, Estimator): # Only do these if hasattr(check, '__name__') and check.__name__ in ( 'check_estimator_sparse_data', 'check_clusterer_compute_labels_predict', 'check_estimators_partial_fit_n_features' ): yield _named_check(check, name), name, estimator
def test_all_estimators(): for name, Estimator in all_estimators(): return (_named_check(check_parameters_default_constructible, name), name, Estimator())