Exemplo n.º 1
0
def test_given_hyperparameters_to_prophet_when_trainer_model_templates_called_then_hyperparameters_set_correctly(
        temp_model_path, hyperparameters):
    trainer = AutoTimeSeriesTrainer(path=temp_model_path, eval_metric="MAPE")
    models = trainer.construct_model_templates(
        hyperparameters=hyperparameters, )

    for model in models:
        for k, v in hyperparameters[model.name].items():
            assert model._user_params[k] == v
Exemplo n.º 2
0
def test_given_hyperparameters_and_custom_models_when_trainer_model_templates_called_then_hyperparameters_set_correctly(
        temp_model_path, hyperparameters):
    trainer = AutoTimeSeriesTrainer(path=temp_model_path, eval_metric="MAPE")
    models = trainer.construct_model_templates(
        hyperparameters=hyperparameters, )

    for model in models:
        if isinstance(model, GenericGluonTSModel):
            model_hyperparam = next(
                hyperparameters[m] for m in hyperparameters
                if isinstance(m, GenericGluonTSModelFactory))
        else:
            model_hyperparam = hyperparameters[model.name]

        for k, v in model_hyperparam.items():
            assert model._user_params[k] == v