class_docstr: NeuralProphet forecaster.
  
  A simple yet powerful forecaster that models:
  Trend, seasonality, events, holidays, auto-regression, lagged covariates, and future-known regressors.
  Can be regularized and configured to model nonlinear relationships.
  
  Parameters
  ----------
      COMMENT
      Trend Config
      COMMENT
      growth : {'off' or 'linear'}, default 'linear'
          Set use of trend growth type.
  
          Options:
              * ``off``: no trend.
              * (default) ``linear``: fits a piece-wise linear trend with ``n_changepoints + 1`` segments
              * ``discontinuous``: For advanced users only - not a conventional trend,
              allows arbitrary jumps at each trend changepoint
  
      changepoints : {list of str, list of np.datetimes or np.array of np.datetimes}, optional
          Manually set dates at which to include potential changepoints.
  
          Note
          ----
          Does not accept ``np.array`` of ``np.str``. If not specified, potential changepoints are selected
          automatically.
  
      n_changepoints : int
          Number of potential trend changepoints to include.
  
          Note
          ----
          Changepoints are selected uniformly from the first ``changepoint_range`` proportion of the history.
          Ignored if manual ``changepoints`` list is supplied.
      changepoints_range : float
          Proportion of history in which trend changepoints will be estimated.
  
          e.g. set to 0.8 to allow changepoints only in the first 80% of training data.
          Ignored if  manual ``changepoints`` list is supplied.
      trend_reg : float, optional
          Parameter modulating the flexibility of the automatic changepoint selection.
  
          Note
          ----
          Large values (~1-100) will limit the variability of changepoints.
          Small values (~0.001-1.0) will allow changepoints to change faster.
          default: 0 will fully fit a trend to each segment.
  
      trend_reg_threshold : bool, optional
          Allowance for trend to change without regularization.
  
          Options
              * ``True``: Automatically set to a value that leads to a smooth trend.
              * (default) ``False``: All changes in changepoints are regularized
  
      trend_global_local : str, default 'global'
          Modelling strategy of the trend when multiple time series are present.
  
          Options:
              * ``global``: All the elements are modelled with the same trend.
              * ``local``: Each element is modelled with a different trend.
  
          Note
          ----
          When only one time series is input, this parameter should not be provided.
          Internally it will be set to ``global``, meaning that all the elements(only one in this case)
          are modelled with the same trend.
  
      COMMENT
      Seasonality Config
      COMMENT
      yearly_seasonality : bool, int
          Fit yearly seasonality.
  
          Options
              * ``True`` or ``False``
              * ``auto``: set automatically
              * ``value``: number of Fourier/linear terms to generate
      weekly_seasonality : bool, int
          Fit monthly seasonality.
  
          Options
              * ``True`` or ``False``
              * ``auto``: set automatically
              * ``value``: number of Fourier/linear terms to generate
      daily_seasonality : bool, int
          Fit daily seasonality.
  
          Options
              * ``True`` or ``False``
              * ``auto``: set automatically
              * ``value``: number of Fourier/linear terms to generate
      seasonality_mode : str
          Specifies mode of seasonality
  
          Options
              * (default) ``additive``
              * ``multiplicative``
      seasonality_reg : float, optional
          Parameter modulating the strength of the seasonality model.
  
          Note
          ----
          Smaller values (~0.1-1) allow the model to fit larger seasonal fluctuations,
          larger values (~1-100) dampen the seasonality.
          default: None, no regularization
      season_global_local : str, default 'global'
          Modelling strategy of the seasonality when multiple time series are present.
          Options:
              * ``global``: All the elements are modelled with the same seasonality.
              * ``local``: Each element is modelled with a different seasonality.
          Note
          ----
          When only one time series is input, this parameter should not be provided.
          Internally it will be set to ``global``, meaning that all the elements(only one in this case)
          are modelled with the same seasonality.
  
      COMMENT
      AR Config
      COMMENT
      n_lags : int
          Previous time series steps to include in auto-regression. Aka AR-order
      ar_reg : float, optional
          how much sparsity to induce in the AR-coefficients
  
          Note
          ----
          Large values (~1-100) will limit the number of nonzero coefficients dramatically.
          Small values (~0.001-1.0) will allow more non-zero coefficients.
          default: 0 no regularization of coefficients.
      ar_layers : list of int, optional
          array of hidden layer dimensions of the AR-Net. Specifies number of hidden layers (number of entries)
          and layer dimension (list entry).
  
      COMMENT
      Model Config
      COMMENT
      n_forecasts : int
          Number of steps ahead of prediction time step to forecast.
      lagged_reg_layers : list of int, optional
          array of hidden layer dimensions of the Covar-Net. Specifies number of hidden layers (number of entries)
          and layer dimension (list entry).
  
      COMMENT
      Train Config
      COMMENT
      learning_rate : float
          Maximum learning rate setting for 1cycle policy scheduler.
  
          Note
          ----
          Default ``None``: Automatically sets the ``learning_rate`` based on a learning rate range test.
          For manual user input, (try values ~0.001-10).
      epochs : int
          Number of epochs (complete iterations over dataset) to train model.
  
          Note
          ----
          Default ``None``: Automatically sets the number of epochs based on dataset size.
          For best results also leave batch_size to None. For manual values, try ~5-500.
      batch_size : int
          Number of samples per mini-batch.
  
          If not provided, ``batch_size`` is approximated based on dataset size.
          For manual values, try ~8-1024.
          For best results also leave ``epochs`` to ``None``.
      newer_samples_weight: float, default 2.0
          Sets factor by which the model fit is skewed towards more recent observations.
  
          Controls the factor by which final samples are weighted more compared to initial samples.
          Applies a positional weighting to each sample's loss value.
  
          e.g. ``newer_samples_weight = 2``: final samples are weighted twice as much as initial samples.
      newer_samples_start: float, default 0.0
          Sets beginning of 'newer' samples as fraction of training data.
  
          Throughout the range of 'newer' samples, the weight is increased
          from ``1.0/newer_samples_weight`` initially to 1.0 at the end,
          in a monotonously increasing function (cosine from pi to 2*pi).
      loss_func : str, torch.nn.functional.loss
          Type of loss to use:
  
          Options
              * (default) ``SmoothL1Loss``: SmoothL1 loss function
              * ``MSE``: Mean Squared Error loss function
              * ``MAE``: Mean Absolute Error loss function
              * ``torch.nn.functional.loss.``: loss or callable for custom loss, eg. L1-Loss
  
          Examples
          --------
          >>> from neuralprophet import NeuralProphet
          >>> import torch
          >>> import torch.nn as nn
          >>> m = NeuralProphet(loss_func=torch.nn.L1Loss)
  
      collect_metrics : list of str, dict, bool
          Set metrics to compute.
  
          Options
              * (default) ``True``: [``mae``, ``rmse``]
              * ``False``: No metrics
              * ``list``:  Valid options: [``mae``, ``rmse``, ``mse``]
              * ``dict``:  Collection of names of torchmetrics.Metric objects
  
          Examples
          --------
          >>> from neuralprophet import NeuralProphet
          >>> # computer MSE, MAE and RMSE
          >>> m = NeuralProphet(collect_metrics=["MSE", "MAE", "RMSE"])
          >>> # use custorm torchmetrics names
          >>> m = NeuralProphet(collect_metrics={"MAPE": "MeanAbsolutePercentageError", "MSLE": "MeanSquaredLogError",
  
      COMMENT
      Uncertainty Estimation
      COMMENT
      quantiles : list, default None
          A list of float values between (0, 1) which indicate the set of quantiles to be estimated.
  
      COMMENT
      Missing Data
      COMMENT
      impute_missing : bool
          whether to automatically impute missing dates/values
  
          Note
          ----
          imputation follows a linear method up to 20 missing values, more are filled with trend.
      impute_linear : int
          maximal number of missing dates/values to be imputed linearly (default: ``10``)
      impute_rolling : int
          maximal number of missing dates/values to be imputed
          using rolling average (default: ``10``)
      drop_missing : bool
          whether to automatically drop missing samples from the data
  
          Options
              * (default) ``False``: Samples containing NaN values are not dropped.
              * ``True``: Any sample containing at least one NaN value will be dropped.
  
      COMMENT
      Data Normalization
      COMMENT
      normalize : str
          Type of normalization to apply to the time series.
  
          Options
              * ``off`` bypasses data normalization
              * (default, binary timeseries) ``minmax`` scales the minimum value to 0.0 and the maximum value to 1.0
              * ``standardize`` zero-centers and divides by the standard deviation
              * (default) ``soft`` scales the minimum value to 0.0 and the 95th quantile to 1.0
              * ``soft1`` scales the minimum value to 0.1 and the 90th quantile to 0.9
      global_normalization : bool
          Activation of global normalization
  
          Options
              * ``True``: dict of dataframes is used as global_time_normalization
              * (default) ``False``: local normalization
      global_time_normalization : bool
          Specifies global time normalization
  
          Options
              * (default) ``True``: only valid in case of global modeling local normalization
              * ``False``: set time data_params locally
      unknown_data_normalization : bool
          Specifies unknown data normalization
  
          Options
              * ``True``: test data is normalized with global data params even if trained with local data params
              (global modeling with local normalization)
              * (default) ``False``: no global modeling with local normalization
      accelerator: str
          Name of accelerator from pytorch_lightning.accelerators to use for training. Use "auto" to automatically
          select an available accelerator.
          Provide `None` to deactivate the use of accelerators.
      trainer_config: dict
          Dictionary of additional trainer configuration parameters.
      prediction_frequency: dict
          periodic interval in which forecasts should be made.
          More than one item only allowed for {"daily-hour": x, "weekly-day": y"} to forecast on a specific hour of a
          specific day of week.
  
          Key: str
              periodicity of the predictions to be made.
          value: int
              forecast origin of the predictions to be made, e.g. 7 for 7am in case of 'daily-hour'.
  
          Options
              * ``'hourly-minute'``: forecast once per hour at a specified minute
              * ``'daily-hour'``: forecast once per day at a specified hour
              * ``'weekly-day'``: forecast once per week at a specified day
              * ``'monthly-day'``: forecast once per month at a specified day
              * ``'yearly-month'``: forecast once per year at a specified month
class_docstr_tok: ["NeuralProphet","forecaster",".","A","simple","yet","powerful","forecaster","that","models",":","Trend",",","seasonality",",","events",",","holidays",",","auto-regression",",","lagged","covariates",",","and","future-known","regressors",".","Can","be","regularized","and","configured","to","model","nonlinear","relationships",".","Parameters","--","--","--","--","--","COMMENT","Trend","Config","COMMENT","growth",":","{","'off","'","or","'linear","'","}",",","default","'linear'","Set","use","of","trend","growth","type",".","Options",":","*","``","off","``",":","no","trend",".","*","(","default",")","``","linear","``",":","fits","a","piece-wise","linear","trend","with","``","n_changepoints","+","1","``","segments","*","``","discontinuous","``",":","For","advanced","users","only","-","not","a","conventional","trend",",","allows","arbitrary","jumps","at","each","trend","changepoint","changepoints",":","{","list","of","str",",","list","of","np.datetimes","or","np.array","of","np.datetimes","}",",","optional","Manually","set","dates","at","which","to","include","potential","changepoints",".","Note","--","--","Does","not","accept","``","np.array","``","of","``","np.str","``",".","If","not","specified",",","potential","changepoints","are","selected","automatically",".","n_changepoints",":","int","Number","of","potential","trend","changepoints","to","include",".","Note","--","--","Changepoints","are","selected","uniformly","from","the","first","``","changepoint_range","``","proportion","of","the","history",".","Ignored","if","manual","``","changepoints","``","list","is","supplied",".","changepoints_range",":","float","Proportion","of","history","in","which","trend","changepoints","will","be","estimated",".","e.g",".","set","to","0.8","to","allow","changepoints","only","in","the","first","80","%","of","training","data",".","Ignored","if","manual","``","changepoints","``","list","is","supplied",".","trend_reg",":","float",",","optional","Parameter","modulating","the","flexibility","of","the","automatic","changepoint","selection",".","Note","--","--","Large","values","(","~1-100",")","will","limit","the","variability","of","changepoints",".","Small","values","(","~0.001-1.0",")","will","allow","changepoints","to","change","faster",".","default",":","0","will","fully","fit","a","trend","to","each","segment",".","trend_reg_threshold",":","bool",",","optional","Allowance","for","trend","to","change","without","regularization",".","Options","*","``","True","``",":","Automatically","set","to","a","value","that","leads","to","a","smooth","trend",".","*","(","default",")","``","False","``",":","All","changes","in","changepoints","are","regularized","trend_global_local",":","str",",","default","'global'","Modelling","strategy","of","the","trend","when","multiple","time","series","are","present",".","Options",":","*","``","global","``",":","All","the","elements","are","modelled","with","the","same","trend",".","*","``","local","``",":","Each","element","is","modelled","with","a","different","trend",".","Note","--","--","When","only","one","time","series","is","input",",","this","parameter","should","not","be","provided",".","Internally","it","will","be","set","to","``","global","``",",","meaning","that","all","the","elements","(","only","one","in","this","case",")","are","modelled","with","the","same","trend",".","COMMENT","Seasonality","Config","COMMENT","yearly_seasonality",":","bool",",","int","Fit","yearly","seasonality",".","Options","*","``","True","``","or","``","False","``","*","``","auto","``",":","set","automatically","*","``","value","``",":","number","of","Fourier\/linear","terms","to","generate","weekly_seasonality",":","bool",",","int","Fit","monthly","seasonality",".","Options","*","``","True","``","or","``","False","``","*","``","auto","``",":","set","automatically","*","``","value","``",":","number","of","Fourier\/linear","terms","to","generate","daily_seasonality",":","bool",",","int","Fit","daily","seasonality",".","Options","*","``","True","``","or","``","False","``","*","``","auto","``",":","set","automatically","*","``","value","``",":","number","of","Fourier\/linear","terms","to","generate","seasonality_mode",":","str","Specifies","mode","of","seasonality","Options","*","(","default",")","``","additive","``","*","``","multiplicative","``","seasonality_reg",":","float",",","optional","Parameter","modulating","the","strength","of","the","seasonality","model",".","Note","--","--","Smaller","values","(","~0.1-1",")","allow","the","model","to","fit","larger","seasonal","fluctuations",",","larger","values","(","~1-100",")","dampen","the","seasonality",".","default",":","None",",","no","regularization","season_global_local",":","str",",","default","'global'","Modelling","strategy","of","the","seasonality","when","multiple","time","series","are","present",".","Options",":","*","``","global","``",":","All","the","elements","are","modelled","with","the","same","seasonality",".","*","``","local","``",":","Each","element","is","modelled","with","a","different","seasonality",".","Note","--","--","When","only","one","time","series","is","input",",","this","parameter","should","not","be","provided",".","Internally","it","will","be","set","to","``","global","``",",","meaning","that","all","the","elements","(","only","one","in","this","case",")","are","modelled","with","the","same","seasonality",".","COMMENT","AR","Config","COMMENT","n_lags",":","int","Previous","time","series","steps","to","include","in","auto-regression",".","Aka","AR-order","ar_reg",":","float",",","optional","how","much","sparsity","to","induce","in","the","AR-coefficients","Note","--","--","Large","values","(","~1-100",")","will","limit","the","number","of","nonzero","coefficients","dramatically",".","Small","values","(","~0.001-1.0",")","will","allow","more","non-zero","coefficients",".","default",":","0","no","regularization","of","coefficients",".","ar_layers",":","list","of","int",",","optional","array","of","hidden","layer","dimensions","of","the","AR-Net",".","Specifies","number","of","hidden","layers","(","number","of","entries",")","and","layer","dimension","(","list","entry",")",".","COMMENT","Model","Config","COMMENT","n_forecasts",":","int","Number","of","steps","ahead","of","prediction","time","step","to","forecast",".","lagged_reg_layers",":","list","of","int",",","optional","array","of","hidden","layer","dimensions","of","the","Covar-Net",".","Specifies","number","of","hidden","layers","(","number","of","entries",")","and","layer","dimension","(","list","entry",")",".","COMMENT","Train","Config","COMMENT","learning_rate",":","float","Maximum","learning","rate","setting","for","1cycle","policy","scheduler",".","Note","--","--","Default","``","None","``",":","Automatically","sets","the","``","learning_rate","``","based","on","a","learning","rate","range","test",".","For","manual","user","input",",","(","try","values","~0.001-10",")",".","epochs",":","int","Number","of","epochs","(","complete","iterations","over","dataset",")","to","train","model",".","Note","--","--","Default","``","None","``",":","Automatically","sets","the","number","of","epochs","based","on","dataset","size",".","For","best","results","also","leave","batch_size","to","None",".","For","manual","values",",","try","~5-500",".","batch_size",":","int","Number","of","samples","per","mini-batch",".","If","not","provided",",","``","batch_size","``","is","approximated","based","on","dataset","size",".","For","manual","values",",","try","~8-1024",".","For","best","results","also","leave","``","epochs","``","to","``","None","``",".","newer_samples_weight",":","float",",","default","2.0","Sets","factor","by","which","the","model","fit","is","skewed","towards","more","recent","observations",".","Controls","the","factor","by","which","final","samples","are","weighted","more","compared","to","initial","samples",".","Applies","a","positional","weighting","to","each","sample","'s","loss","value",".","e.g",".","``","newer_samples_weight","=","2","``",":","final","samples","are","weighted","twice","as","much","as","initial","samples",".","newer_samples_start",":","float",",","default","0.0","Sets","beginning","of","'newer","'","samples","as","fraction","of","training","data",".","Throughout","the","range","of","'newer","'","samples",",","the","weight","is","increased","from","``","1.0\/newer_samples_weight","``","initially","to","1.0","at","the","end",",","in","a","monotonously","increasing","function","(","cosine","from","pi","to","2","*","pi",")",".","loss_func",":","str",",","torch.nn.functional.loss","Type","of","loss","to","use",":","Options","*","(","default",")","``","SmoothL1Loss","``",":","SmoothL1","loss","function","*","``","MSE","``",":","Mean","Squared","Error","loss","function","*","``","MAE","``",":","Mean","Absolute","Error","loss","function","*","``","torch.nn.functional.loss.","``",":","loss","or","callable","for","custom","loss",",","eg",".","L1-Loss","Examples","--","--","--","--",">",">",">","from","neuralprophet","import","NeuralProphet",">",">",">","import","torch",">",">",">","import","torch.nn","as","nn",">",">",">","m","=","NeuralProphet","(","loss_func=torch.nn.L1Loss",")","collect_metrics",":","list","of","str",",","dict",",","bool","Set","metrics","to","compute",".","Options","*","(","default",")","``","True","``",":","[","``","mae","``",",","``","rmse","``","]","*","``","False","``",":","No","metrics","*","``","list","``",":","Valid","options",":","[","``","mae","``",",","``","rmse","``",",","``","mse","``","]","*","``","dict","``",":","Collection","of","names","of","torchmetrics.Metric","objects","Examples","--","--","--","--",">",">",">","from","neuralprophet","import","NeuralProphet",">",">",">","#","computer","MSE",",","MAE","and","RMSE",">",">",">","m","=","NeuralProphet","(","collect_metrics=","[","``","MSE","''",",","``","MAE","''",",","``","RMSE","''","]",")",">",">",">","#","use","custorm","torchmetrics","names",">",">",">","m","=","NeuralProphet","(","collect_metrics=","{","``","MAPE","''",":","``","MeanAbsolutePercentageError","''",",","``","MSLE","''",":","``","MeanSquaredLogError","''",",","COMMENT","Uncertainty","Estimation","COMMENT","quantiles",":","list",",","default","None","A","list","of","float","values","between","(","0",",","1",")","which","indicate","the","set","of","quantiles","to","be","estimated",".","COMMENT","Missing","Data","COMMENT","impute_missing",":","bool","whether","to","automatically","impute","missing","dates\/values","Note","--","--","imputation","follows","a","linear","method","up","to","20","missing","values",",","more","are","filled","with","trend",".","impute_linear",":","int","maximal","number","of","missing","dates\/values","to","be","imputed","linearly","(","default",":","``","10","``",")","impute_rolling",":","int","maximal","number","of","missing","dates\/values","to","be","imputed","using","rolling","average","(","default",":","``","10","``",")","drop_missing",":","bool","whether","to","automatically","drop","missing","samples","from","the","data","Options","*","(","default",")","``","False","``",":","Samples","containing","NaN","values","are","not","dropped",".","*","``","True","``",":","Any","sample","containing","at","least","one","NaN","value","will","be","dropped",".","COMMENT","Data","Normalization","COMMENT","normalize",":","str","Type","of","normalization","to","apply","to","the","time","series",".","Options","*","``","off","``","bypasses","data","normalization","*","(","default",",","binary","timeseries",")","``","minmax","``","scales","the","minimum","value","to","0.0","and","the","maximum","value","to","1.0","*","``","standardize","``","zero-centers","and","divides","by","the","standard","deviation","*","(","default",")","``","soft","``","scales","the","minimum","value","to","0.0","and","the","95th","quantile","to","1.0","*","``","soft1","``","scales","the","minimum","value","to","0.1","and","the","90th","quantile","to","0.9","global_normalization",":","bool","Activation","of","global","normalization","Options","*","``","True","``",":","dict","of","dataframes","is","used","as","global_time_normalization","*","(","default",")","``","False","``",":","local","normalization","global_time_normalization",":","bool","Specifies","global","time","normalization","Options","*","(","default",")","``","True","``",":","only","valid","in","case","of","global","modeling","local","normalization","*","``","False","``",":","set","time","data_params","locally","unknown_data_normalization",":","bool","Specifies","unknown","data","normalization","Options","*","``","True","``",":","test","data","is","normalized","with","global","data","params","even","if","trained","with","local","data","params","(","global","modeling","with","local","normalization",")","*","(","default",")","``","False","``",":","no","global","modeling","with","local","normalization","accelerator",":","str","Name","of","accelerator","from","pytorch_lightning.accelerators","to","use","for","training",".","Use","``","auto","''","to","automatically","select","an","available","accelerator",".","Provide","`","None","`","to","deactivate","the","use","of","accelerators",".","trainer_config",":","dict","Dictionary","of","additional","trainer","configuration","parameters",".","prediction_frequency",":","dict","periodic","interval","in","which","forecasts","should","be","made",".","More","than","one","item","only","allowed","for","{","``","daily-hour","''",":","x",",","``","weekly-day","''",":","y","''","}","to","forecast","on","a","specific","hour","of","a","specific","day","of","week",".","Key",":","str","periodicity","of","the","predictions","to","be","made",".","value",":","int","forecast","origin","of","the","predictions","to","be","made",",","e.g",".","7","for","7am","in","case","of","'daily-hour","'",".","Options","*","``","'hourly-minute","'","``",":","forecast","once","per","hour","at","a","specified","minute","*","``","'daily-hour","'","``",":","forecast","once","per","day","at","a","specified","hour","*","``","'weekly-day","'","``",":","forecast","once","per","week","at","a","specified","day","*","``","'monthly-day","'","``",":","forecast","once","per","month","at","a","specified","day","*","``","'yearly-month","'","``",":","forecast","once","per","year","at","a","specified","month"]
docstr: Train, and potentially evaluate model.
  
  Training/validation metrics may be distorted in case of auto-regression,
  if a large number of NaN values are present in df and/or validation_df.
  
  Parameters
  ----------
      df : pd.DataFrame
          containing column ``ds``, ``y``, and optionally``ID`` with all data
      freq : str
          Data step sizes. Frequency of data recording,
  
          Note
          ----
          Any valid frequency for pd.date_range, such as ``5min``, ``D``, ``MS`` or ``auto`` (default) to
          automatically set frequency.
      validation_df : pd.DataFrame, dict
          If provided, model with performance  will be evaluated after each training epoch over this data.
      epochs : int
          Number of epochs to train for. If None, uses the number of epochs specified in the model config.
      batch_size : int
          Batch size for training. If None, uses the batch size specified in the model config.
      learning_rate : float
          Learning rate for training. If None, uses the learning rate specified in the model config.
      early_stopping : bool
          Flag whether to use early stopping to stop training when training / validation loss is no longer
          improving.
      minimal : bool
          Minimal mode deactivates metrics, the progress bar and checkpointing. Control more granular by using the
          `metrics`, `progress` and `checkpointing` parameters.
      metrics : bool
          Flag whether to collect metrics during training. If None, uses the metrics specified in the model
          config.
      progress : str
          Flag whether to show a progress bar during training. If None, uses the progress specified in the model
          config.
  
          Options
          * (default) ``bar``
          * ``plot``
          * `None`
      checkpointing : bool
          Flag whether to save checkpoints during training
      continue_training : bool
          Flag whether to continue training from the last checkpoint
      num_workers : int
          Number of workers for data loading. If 0, data will be loaded in the main process.
          Note: using multiple workers and therefore distributed training might significantly increase
          the training time since each batch needs to be copied to each worker for each epoch. Keeping
          all data on the main process might be faster for most datasets.
  
  Returns
  -------
      pd.DataFrame
          metrics with training and potentially evaluation metrics
code: def fit(
      self,
      df: pd.DataFrame,
      freq: str = "auto",
      validation_df: Optional[pd.DataFrame] = None,
      epochs: Optional[int] = None,
      batch_size: Optional[int] = None,
      learning_rate: Optional[float] = None,
      early_stopping: bool = False,
      minimal: bool = False,
      metrics: Optional[np_types.CollectMetricsMode] = None,
      progress: Optional[str] = "bar",
      checkpointing: bool = False,
      continue_training: bool = False,
      num_workers: int = 0,
  ):
      """Train, and potentially evaluate model.
  
      Training/validation metrics may be distorted in case of auto-regression,
      if a large number of NaN values are present in df and/or validation_df.
  
      Parameters
      ----------
          df : pd.DataFrame
              containing column ``ds``, ``y``, and optionally``ID`` with all data
          freq : str
              Data step sizes. Frequency of data recording,
  
              Note
              ----
              Any valid frequency for pd.date_range, such as ``5min``, ``D``, ``MS`` or ``auto`` (default) to
              automatically set frequency.
          validation_df : pd.DataFrame, dict
              If provided, model with performance  will be evaluated after each training epoch over this data.
          epochs : int
              Number of epochs to train for. If None, uses the number of epochs specified in the model config.
          batch_size : int
              Batch size for training. If None, uses the batch size specified in the model config.
          learning_rate : float
              Learning rate for training. If None, uses the learning rate specified in the model config.
          early_stopping : bool
              Flag whether to use early stopping to stop training when training / validation loss is no longer
              improving.
          minimal : bool
              Minimal mode deactivates metrics, the progress bar and checkpointing. Control more granular by using the
              `metrics`, `progress` and `checkpointing` parameters.
          metrics : bool
              Flag whether to collect metrics during training. If None, uses the metrics specified in the model
              config.
          progress : str
              Flag whether to show a progress bar during training. If None, uses the progress specified in the model
              config.
  
              Options
              * (default) ``bar``
              * ``plot``
              * `None`
          checkpointing : bool
              Flag whether to save checkpoints during training
          continue_training : bool
              Flag whether to continue training from the last checkpoint
          num_workers : int
              Number of workers for data loading. If 0, data will be loaded in the main process.
              Note: using multiple workers and therefore distributed training might significantly increase
              the training time since each batch needs to be copied to each worker for each epoch. Keeping
              all data on the main process might be faster for most datasets.
  
      Returns
      -------
          pd.DataFrame
              metrics with training and potentially evaluation metrics
      """
      # Configuration
      if epochs is not None:
          self.config_train.epochs = epochs
  
      if batch_size is not None:
          self.config_train.batch_size = batch_size
  
      if learning_rate is not None:
          self.config_train.learning_rate = learning_rate
  
      if early_stopping is not None:
          self.early_stopping = early_stopping
  
      if metrics is not None:
          self.metrics = utils_metrics.get_metrics(metrics)
  
      # Warnings
      if early_stopping:
          reg_enabled = utils.check_for_regularization(
              [
                  self.config_seasonality,
                  self.config_regressors,
                  self.config_ar,
                  self.config_events,
                  self.config_country_holidays,
                  self.config_trend,
                  self.config_lagged_regressors,
              ]
          )
          if reg_enabled:
              log.warning(
                  "Early stopping is enabled, but regularization only starts after half the number of configured \
                          epochs. If you see no impact of the regularization, turn off the early_stopping or reduce the \
                          number of epochs to train for."
              )
  
      if progress == "plot" and metrics is False:
          log.warning(
              "Progress plot requires metrics to be enabled. Enabling the default metrics."
          )
          metrics = utils_metrics.get_metrics(True)
  
      if not self.config_normalization.global_normalization:
          log.warning(
              "When Global modeling with local normalization, metrics are displayed in normalized scale."
          )
  
      if minimal:
          checkpointing = False
          self.metrics = False
          progress = None
  
      # Pre-processing
      # Copy df and save list of unique time series IDs (the latter for global-local modelling if enabled)
      df, _, _, self.id_list = df_utils.prep_or_copy_df(df)
      df = _check_dataframe(self, df, check_y=True, exogenous=True)
      self.data_freq = df_utils.infer_frequency(
          df, n_lags=self.max_lags, freq=freq
      )
      df = _handle_missing_data(
          df=df,
          freq=self.data_freq,
          n_lags=self.n_lags,
          n_forecasts=self.n_forecasts,
          config_missing=self.config_missing,
          config_regressors=self.config_regressors,
          config_lagged_regressors=self.config_lagged_regressors,
          config_events=self.config_events,
          config_seasonality=self.config_seasonality,
          predicting=False,
      )
  
      # Setup for global-local modelling: If there is only a single time series, then self.id_list = ['__df__']
      self.num_trends_modelled = (
          len(self.id_list)
          if self.config_trend.trend_global_local == "local"
          else 1
      )
      self.num_seasonalities_modelled = (
          len(self.id_list)
          if self.config_seasonality.global_local == "local"
          else 1
      )
      self.meta_used_in_model = (
          self.num_trends_modelled != 1
          or self.num_seasonalities_modelled != 1
      )
  
      if self.fitted is True and not continue_training:
          log.error(
              "Model has already been fitted. Re-fitting may break or produce different results."
          )
      self.max_lags = df_utils.get_max_num_lags(
          self.config_lagged_regressors, self.n_lags
      )
      if self.max_lags == 0 and self.n_forecasts > 1:
          self.n_forecasts = 1
          self.predict_steps = 1
          log.warning(
              "Changing n_forecasts to 1. Without lags, the forecast can be "
              "computed for any future time, independent of lagged values"
          )
  
      # Training
      if validation_df is None:
          metrics_df = self._train(
              df,
              progress_bar_enabled=bool(progress),
              metrics_enabled=bool(self.metrics),
              checkpointing_enabled=checkpointing,
              continue_training=continue_training,
              num_workers=num_workers,
          )
      else:
          df_val, _, _, _ = df_utils.prep_or_copy_df(validation_df)
          df_val = _check_dataframe(
              self, df_val, check_y=False, exogenous=False
          )
          df_val = _handle_missing_data(
              df=df_val,
              freq=self.data_freq,
              n_lags=self.n_lags,
              n_forecasts=self.n_forecasts,
              config_missing=self.config_missing,
              config_regressors=self.config_regressors,
              config_lagged_regressors=self.config_lagged_regressors,
              config_events=self.config_events,
              config_seasonality=self.config_seasonality,
              predicting=False,
          )
          metrics_df = self._train(
              df,
              df_val=df_val,
              progress_bar_enabled=bool(progress),
              metrics_enabled=bool(self.metrics),
              checkpointing_enabled=checkpointing,
              continue_training=continue_training,
              num_workers=num_workers,
          )
  
      # Show training plot
      if progress == "plot":
          assert metrics_df is not None
          if validation_df is None:
              fig = pyplot.plot(metrics_df[["Loss"]])
          else:
              fig = pyplot.plot(metrics_df[["Loss", "Loss_val"]])
          # Only display the plot if the session is interactive, eg. do not show in github actions since it
          # causes an error in the Windows and MacOS environment
          if matplotlib.is_interactive():
              fig
  
      self.fitted = True
      return metrics_df
  
imports: import logging
  import os
  import time
  from collections import OrderedDict
  from typing import Callable, List, Optional, Tuple, Type, Union
  import matplotlib
  import numpy
  import pandas
  import pytorch_lightning
  import torch
  from matplotlib import pyplot
  from matplotlib.axes import Axes
  from torch.utils.data import DataLoader
  from neuralprophet import configure, df_utils, np_types, time_dataset, time_net, utils, utils_metrics
  from neuralprophet.data.process import _check_dataframe, _convert_raw_predictions_to_raw_df, _create_dataset, _handle_missing_data, _prepare_dataframe_to_predict, _reshape_raw_predictions_to_forecst_df, _validate_column_name
  from neuralprophet.data.split import _make_future_dataframe, _maybe_extend_df
  from neuralprophet.data.transform import _normalize
  from neuralprophet.logger import MetricsLogger
  from neuralprophet.plot_forecast_matplotlib import plot, plot_components
  from neuralprophet.plot_forecast_plotly import conformal_plot_plotly
  from neuralprophet.plot_forecast_plotly import plot
  from neuralprophet.plot_forecast_plotly import plot_components
  from neuralprophet.plot_model_parameters_matplotlib import plot_parameters
  from neuralprophet.plot_model_parameters_plotly import plot_parameters
  from neuralprophet.plot_utils import get_valid_configuration, log_warning_deprecation_plotly, select_plotting_backend
  from neuralprophet.uncertainty import Conformal
label_desc: Use image node_id 9 for calling the NeuralProphet obj's underlying member method code with example usage: obj.fit(df, freq, validation_df, epochs, batch_size, learning_rate, early_stopping, minimal, metrics, progress, checkpointing, continue_training, num_workers) and returns: metrics_df