""" Pipeline Tests Description: Pipeline tests ensures that the functionalities of the feature processing pipelines work as expected to avoid feeding models incorrect data. """ from sklearn.svm import LinearSVR from sklearn.tree import DecisionTreeRegressor from sklearn.ensemble import BaggingRegressor, AdaBoostRegressor from sklearn.linear_model import LinearRegression from sklearn.pipeline import Pipeline import pandas as pd import numpy as np import os import pytest from absl import logging from forecasting_toolkit.models.pipelines.inference.pre_release import ( gbt_regressor_inference_pipeline ) @pytest.fixture() def test_params(): return {"store_id": 286, "country_code_id": 1, "model_path": "./default_model.joblib"} def test_gbt_regressor_inference_pipeline(test_params): """ test gbt model by loading it to make sure all is well""" logging.set_verbosity(logging.DEBUG) lst_forecasts = gbt_regressor_inference_pipeline(**test_params) # make sure we got a list back assert isinstance(lst_forecasts, list) # make sure we have forecasts assert len(lst_forecasts) > 0