class_docstr: FugueBackend for Distributed Computation.
  [Source code](https://github.com/Nixtla/statsforecast/blob/main/statsforecast/distributed/fugue.py).
  
  This class uses [Fugue](https://github.com/fugue-project/fugue) backend capable of distributing
  computation on Spark, Dask and Ray without any rewrites.
  
  Parameters
  ----------
  engine : fugue.ExecutionEngine
      A selection between Spark, Dask, and Ray.
  conf : fugue.Config
      Engine configuration.
  **transform_kwargs
      Additional kwargs for Fugue's transform method.
  
  Notes
  -----
  A short introduction to Fugue, with examples on how to scale pandas code to Spark, Dask or Ray
   is available [here](https://fugue-tutorials.readthedocs.io/tutorials/quick_look/ten_minutes.html).
class_docstr_tok: ["FugueBackend","for","Distributed","Computation",".","[","Source","code","]","(","https",":","\/\/github.com\/Nixtla\/statsforecast\/blob\/main\/statsforecast\/distributed\/fugue.py",")",".","This","class","uses","[","Fugue","]","(","https",":","\/\/github.com\/fugue-project\/fugue",")","backend","capable","of","distributing","computation","on","Spark",",","Dask","and","Ray","without","any","rewrites",".","Parameters","--","--","--","--","--","engine",":","fugue.ExecutionEngine","A","selection","between","Spark",",","Dask",",","and","Ray",".","conf",":","fugue.Config","Engine","configuration",".","*","*","transform_kwargs","Additional","kwargs","for","Fugue","'s","transform","method",".","Notes","--","--","-","A","short","introduction","to","Fugue",",","with","examples","on","how","to","scale","pandas","code","to","Spark",",","Dask","or","Ray","is","available","[","here","]","(","https",":","\/\/fugue-tutorials.readthedocs.io\/tutorials\/quick_look\/ten_minutes.html",")","."]
docstr: Temporal Cross-Validation with core.StatsForecast and FugueBackend.
  
  This method uses Fugue's transform function, in combination with
  `core.StatsForecast`'s cross-validation to efficiently fit a list of StatsForecast
  models through multiple training windows, in either chained or rolled manner.
  
  `StatsForecast.models`' speed along with Fugue's distributed computation allow to
  overcome this evaluation technique high computational costs. Temporal cross-validation
  provides better model's generalization measurements by increasing the test's length
  and diversity.
  
  Parameters
  ----------
  {df}
  {freq}
  {models}
  {fallback_model}
  {h}
  {n_windows}
  {step_size}
  {test_size}
  {input_size}
  {level}
  {refit}
  {fitted}
  {prediction_intervals}
  {id_col}
  {time_col}
  {target_col}
  
  Returns
  -------
  pandas.DataFrame
      DataFrame, with `models` columns for point predictions and probabilistic predictions for all fitted `models`.
  
  References
  ----------
  The [core.StatsForecast's cross validation](https://nixtla.github.io/statsforecast/core.html#statsforecast.cross_validation)
  method documentation.
  [Rob J. Hyndman and George Athanasopoulos (2018). "Forecasting principles and practice, Temporal Cross-Validation"](https://otexts.com/fpp3/tscv.html).
docstr_tok: ["Temporal","Cross-Validation","with","core.StatsForecast","and","FugueBackend",".","This","method","uses","Fugue","'s","transform","function",",","in","combination","with","`","core.StatsForecast","`","'s","cross-validation","to","efficiently","fit","a","list","of","StatsForecast","models","through","multiple","training","windows",",","in","either","chained","or","rolled","manner",".","`","StatsForecast.models","`","'","speed","along","with","Fugue","'s","distributed","computation","allow","to","overcome","this","evaluation","technique","high","computational","costs",".","Temporal","cross-validation","provides","better","model","'s","generalization","measurements","by","increasing","the","test","'s","length","and","diversity",".","Parameters","--","--","--","--","--","{","df","}","{","freq","}","{","models","}","{","fallback_model","}","{","h","}","{","n_windows","}","{","step_size","}","{","test_size","}","{","input_size","}","{","level","}","{","refit","}","{","fitted","}","{","prediction_intervals","}","{","id_col","}","{","time_col","}","{","target_col","}","Returns","--","--","--","-","pandas.DataFrame","DataFrame",",","with","`","models","`","columns","for","point","predictions","and","probabilistic","predictions","for","all","fitted","`","models","`",".","References","--","--","--","--","--","The","[","core.StatsForecast","'s","cross","validation","]","(","https",":","\/\/nixtla.github.io\/statsforecast\/core.html","#","statsforecast.cross_validation",")","method","documentation",".","[","Rob","J.","Hyndman","and","George","Athanasopoulos","(","2018",")",".","``","Forecasting","principles","and","practice",",","Temporal","Cross-Validation","''","]","(","https",":","\/\/otexts.com\/fpp3\/tscv.html",")","."]
code: def cross_validation(
      self,
      *,
      df: AnyDataFrame,
      freq: Union[str, int],
      models: List[Any],
      fallback_model: Optional[Any],
      h: int,
      n_windows: int,
      step_size: int,
      test_size: int,
      input_size: int,
      level: Optional[List[int]],
      refit: bool,
      fitted: bool,
      prediction_intervals: Optional[ConformalIntervals],
      id_col: str,
      time_col: str,
      target_col: str,
  ) -> Any:
      """Temporal Cross-Validation with core.StatsForecast and FugueBackend.
  
      This method uses Fugue's transform function, in combination with
      `core.StatsForecast`'s cross-validation to efficiently fit a list of StatsForecast
      models through multiple training windows, in either chained or rolled manner.
  
      `StatsForecast.models`' speed along with Fugue's distributed computation allow to
      overcome this evaluation technique high computational costs. Temporal cross-validation
      provides better model's generalization measurements by increasing the test's length
      and diversity.
  
      Parameters
      ----------
      {df}
      {freq}
      {models}
      {fallback_model}
      {h}
      {n_windows}
      {step_size}
      {test_size}
      {input_size}
      {level}
      {refit}
      {fitted}
      {prediction_intervals}
      {id_col}
      {time_col}
      {target_col}
  
      Returns
      -------
      pandas.DataFrame
          DataFrame, with `models` columns for point predictions and probabilistic predictions for all fitted `models`.
  
      References
      ----------
      The [core.StatsForecast's cross validation](https://nixtla.github.io/statsforecast/core.html#statsforecast.cross_validation)
      method documentation.
      [Rob J. Hyndman and George Athanasopoulos (2018). "Forecasting principles and practice, Temporal Cross-Validation"](https://otexts.com/fpp3/tscv.html).
      """
      schema = self._get_output_schema(
          df=df,
          models=models,
          level=level,
          mode="cv",
          id_col=id_col,
          time_col=time_col,
          target_col=target_col,
      )
      return transform(
          df,
          self._cv,
          params=dict(
              models=models,
              freq=freq,
              fallback_model=fallback_model,
              h=h,
              n_windows=n_windows,
              step_size=step_size,
              test_size=test_size,
              input_size=input_size,
              level=level,
              refit=refit,
              fitted=fitted,
              prediction_intervals=prediction_intervals,
              id_col=id_col,
              time_col=time_col,
              target_col=target_col,
          ),
          schema=schema,
          partition={"by": id_col},
          engine=self._engine,
          engine_conf=self._conf,
          **self._transform_kwargs,
      )
  
imports: import inspect
  from typing import Any, Dict, Iterable, List, Optional, Tuple, Union
  import cloudpickle
  import fugue.api
  import numpy
  import pandas
  from fugue import transform, DataFrame, FugueWorkflow, ExecutionEngine, AnyDataFrame
  from fugue.collections.yielded import Yielded
  from fugue.constants import FUGUE_CONF_WORKFLOW_EXCEPTION_INJECT
  from triad import Schema
  from statsforecast.core import _StatsForecast, ParallelBackend, _id_as_idx, _param_descriptions, make_backend
  from ..utils import ConformalIntervals
label_desc: Use image node_id 14 for calling the FugueBackend obj's underlying member method code with example usage: obj.cross_validation() and returns: transform