def test_train_and_test(self, uncertainty):
        global dataset

        data_transformer = MainTransformer(config=ConfigReader.CONFIG)
        data_transformer.add_transformer(Transformers.WEATHER_TRANSFORMER)
        data_transformer.add_transformer(Transformers.POLLUTANT_TRANSFORMER)
        data_transformer.transform()
        dataset = data_transformer.get_dataset()

        complete_dataset = dataset.dropna(inplace=False)
        MainTransformer.periodic_f(complete_dataset)

        X_train_set, y_train_set, X_test, y_test, stats = MainTransformer.get_training_and_test_set(dataset,
                                                                                                    'Pollutant',
                                                                                                    'Uncertainty',
                                                                                                    size=0.8,
                                                                                                    normalize=True)

        print(np.array(X_train_set))
        print(y_train_set)

        # X_train_set, y_train_set, X_test, y_test, stats = MainTransformer.get_training_and_test_set(complete_dataset,
        #                                                                                             'Pollutant',
        #                                                                                             'Uncertainty',
        #                                                                                             size=0.8,
        #                                                                                             normalize=True)
        #
        # print(np.array(X_train_set))
        # print(X_train_set)
        # print(y_train_set)

        gp = SparseGaussianProcesses()
        gp.train(X_train_set, y_train_set, stats=stats)

        assert gp.stats['n_instances_trained'] == X_train_set.shape[0]
        assert gp.stats['dataset_stats'] == stats

        predictions = gp.predict(X_test, uncertainty=uncertainty)

        assert len(predictions) == X_test.shape[0]

        if uncertainty:
            values_without_uncertainty = list(filter(lambda x: len(x) != 2, predictions))
            assert len(values_without_uncertainty) == 0

        if not isinstance(uncertainty, bool):
            assert len(list(filter(lambda x: not isinstance(x, tuple), predictions))) == X_test.shape[0]
    def test_periodic_f_add_and_remove(self):
        periodic_f = ['TimeSin', 'TimeCos', 'DateSin', 'DateCos']

        copied_dataset = db_dataset.loc[:]
        initial_keys = set(copied_dataset.keys())

        keys = set()
        for func in periodic_f:
            if func in initial_keys:
                break
        else:
            MainTransformer.periodic_f(copied_dataset)
            keys = set(copied_dataset.keys())

        is_successful = False
        for func in periodic_f:
            if func not in keys:
                break
        else:
            is_successful = True
            assert is_successful

        if not is_successful:
            assert is_successful
            return is_successful

        MainTransformer.remove_periodic_f(copied_dataset)

        keys = set(copied_dataset.loc[:])
        for func in periodic_f:
            if func in keys:
                break
        else:
            assert initial_keys == keys
            return initial_keys == keys

        assert False
        return False