def test_5000_classes(self):
        weights = ([0.0002] * 4750) + ([0.0001] * 250)
        X, Y = sklearn.datasets.make_classification(
            n_samples=10000,
            n_features=20,
            n_classes=5000,
            n_clusters_per_class=1,
            n_informative=15,
            n_redundant=5,
            n_repeated=0,
            weights=weights,
            flip_y=0,
            class_sep=1.0,
            hypercube=True,
            shift=None,
            scale=1.0,
            shuffle=True,
            random_state=1,
        )

        self.assertEqual(250, np.sum(np.bincount(Y) == 1))
        D = Dummy()
        D.info = {"metric": ACC_METRIC, "task": MULTICLASS_CLASSIFICATION, "is_sparse": False, "label_num": 1}
        D.data = {"X_train": X, "Y_train": Y, "X_valid": X, "X_test": X}
        D.feat_type = ["numerical"] * 5000

        configuration_space = get_configuration_space(
            D.info, include_estimators=["lda"], include_preprocessors=["no_preprocessing"]
        )
        configuration = configuration_space.sample_configuration()
        D_ = copy.deepcopy(D)
        evaluator = HoldoutEvaluator(D_, configuration)
        evaluator.fit()
Пример #2
0
    def test_5000_classes(self):
        weights = ([0.0002] * 4750) + ([0.0001] * 250)
        X, Y = sklearn.datasets.make_classification(n_samples=10000,
                                                    n_features=20,
                                                    n_classes=5000,
                                                    n_clusters_per_class=1,
                                                    n_informative=15,
                                                    n_redundant=5,
                                                    n_repeated=0,
                                                    weights=weights,
                                                    flip_y=0,
                                                    class_sep=1.0,
                                                    hypercube=True,
                                                    shift=None,
                                                    scale=1.0,
                                                    shuffle=True,
                                                    random_state=1)

        self.assertEqual(250, np.sum(np.bincount(Y) == 1))
        D = Dummy()
        D.info = {
            'metric': ACC_METRIC,
            'task': MULTICLASS_CLASSIFICATION,
            'is_sparse': False,
            'label_num': 1
        }
        D.data = {'X_train': X, 'Y_train': Y, 'X_valid': X, 'X_test': X}
        D.feat_type = ['numerical'] * 5000

        configuration_space = get_configuration_space(
            D.info,
            include_estimators=['lda'],
            include_preprocessors=['no_preprocessing'])
        configuration = configuration_space.sample_configuration()
        D_ = copy.deepcopy(D)
        evaluator = HoldoutEvaluator(D_, configuration)
        evaluator.fit()