kats/models/globalmodel/ensemble.py [423:477]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            raise ValueError(msg)

    def evaluate(
        self,
        test_train_TSs: Union[
            TimeSeriesData, List[TimeSeriesData], Dict[Any, TimeSeriesData]
        ],
        test_valid_TSs: Union[
            TimeSeriesData, List[TimeSeriesData], Dict[Any, TimeSeriesData]
        ],
    ) -> pd.DataFrame:
        """Evaluate the GMEnsemble object performance.

        A wrapper function to evaluate model performance on a given time series data set.

        Args:
            test_train_TSs: A list or a dictionary of :class:`kats.consts.TimeSeriesData` objects for warming-ups.
            test_valid_TSs: A list or a dictionary of :class:`kats.consts.TimeSeriesData` objects for evaluation.

        Returns:
            A `pandas.DataFrame` object representing the evaluation results.
        """

        if type(test_train_TSs) != type(test_valid_TSs):
            msg = (
                "The data type of test_train_TSs and test_valid_TSs should be the same."
            )
            logging.error(msg)
            raise ValueError(msg)

        if isinstance(test_train_TSs, TimeSeriesData):
            test_train_TSs = [test_train_TSs]
            # pyre-fixme[9]
            test_valid_TSs = [test_valid_TSs]

        if len(test_train_TSs) != len(test_valid_TSs):
            msg = "test_train_TSs and test_valid_TSs should be of the same length."
            logging.error(msg)
            raise ValueError(msg)
        keys = (
            test_train_TSs.keys()
            if isinstance(test_train_TSs, dict)
            else range(len(test_train_TSs))
        )
        if len(keys) == 0:
            msg = "The input collection of time series should not be empty."
            logging.error(msg)
            raise ValueError(msg)

        steps = np.max([len(test_valid_TSs[t]) for t in keys])

        fcst = self.predict(test_train_TSs, steps=steps, raw=True)
        logging.info(
            f"Successfully generate forecasts for all test time series with length {steps}."
        )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



kats/models/globalmodel/model.py [837:889]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            raise ValueError(msg)

    def evaluate(
        self,
        test_train_TSs: Union[
            TimeSeriesData, List[TimeSeriesData], Dict[Any, TimeSeriesData]
        ],
        test_valid_TSs: Union[
            TimeSeriesData, List[TimeSeriesData], Dict[Any, TimeSeriesData]
        ],
    ) -> pd.DataFrame:
        """Evaluate the global model performance on a dataset.

        Args:
            test_train_TSs: A list or a dictionary of :class:`kats.consts.TimeSeriesData` objects for warming-ups.
            test_valid_TSs: A list or a dictionary of :class:`kats.consts.TimeSeriesData` objects for evaluation.

        Returns:
            A `pandas.DataFrame` object representing the evaluation results.
        """

        if type(test_train_TSs) != type(test_valid_TSs):
            msg = (
                "The data type of test_train_TSs and test_valid_TSs should be the same."
            )
            logging.error(msg)
            raise ValueError(msg)

        if isinstance(test_train_TSs, TimeSeriesData):
            test_train_TSs = [test_train_TSs]
            # pyre-fixme [9]
            test_valid_TSs = [test_valid_TSs]

        if len(test_train_TSs) != len(test_valid_TSs):
            msg = "test_train_TSs and test_valid_TSs should be of the same length."
            logging.error(msg)
            raise ValueError(msg)
        keys = (
            test_train_TSs.keys()
            if isinstance(test_train_TSs, dict)
            else range(len(test_train_TSs))
        )
        if len(keys) == 0:
            msg = "The input collection of time series should not be empty."
            logging.error(msg)
            raise ValueError(msg)

        steps = np.max([len(test_valid_TSs[t]) for t in keys])

        fcst = self.predict(test_train_TSs, steps=steps, raw=True)
        logging.info(
            f"Successfully generate forecasts for all test time series with length {steps}."
        )
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



