class_docstr: Integration with the Nixtla NeuralForecast library for
  time series forecasting with neural networks.
class_docstr_tok: ["Integration","with","the","Nixtla","NeuralForecast","library","for","time","series","forecasting","with","neural","networks","."]
docstr: Makes forecasts with the NeuralForecast Handler.
  
  NeuralForecast is setup to predict for all groups, so it won't handle
  a dataframe that's been filtered to one group very well. Instead, we make
  the prediction for all groups then take care of the filtering after the
  forecasting. Prediction is nearly instant.
docstr_tok: ["Makes","forecasts","with","the","NeuralForecast","Handler",".","NeuralForecast","is","setup","to","predict","for","all","groups",",","so","it","wo","n't","handle","a","dataframe","that","'s","been","filtered","to","one","group","very","well",".","Instead",",","we","make","the","prediction","for","all","groups","then","take","care","of","the","filtering","after","the","forecasting",".","Prediction","is","nearly","instant","."]
code: def predict(self, df, args={}):
      """Makes forecasts with the NeuralForecast Handler.
  
      NeuralForecast is setup to predict for all groups, so it won't handle
      a dataframe that's been filtered to one group very well. Instead, we make
      the prediction for all groups then take care of the filtering after the
      forecasting. Prediction is nearly instant.
      """
      # Load model arguments
      model_args = self.model_storage.json_get("model_args")
  
      prediction_df = transform_to_nixtla_df(df, model_args)
      groups_to_keep = prediction_df["unique_id"].unique()
  
      neural = NeuralForecast.load(model_args["model_folder"])
      forecast_df = neural.predict()
      if (
          model_args["hierarchy"]
          and HierarchicalReconciliation is not None
      ):
          training_df = dill.loads(
              self.model_storage.file_get("training_df")
          )
          hier_df = dill.loads(self.model_storage.file_get("hier_df"))
          hier_dict = dill.loads(
              self.model_storage.file_get("hier_dict")
          )
          reconciled_df = reconcile_forecasts(
              training_df, forecast_df, hier_df, hier_dict
          )
          results_df = reconciled_df[
              reconciled_df.index.isin(groups_to_keep)
          ]
      else:
          results_df = forecast_df[
              forecast_df.index.isin(groups_to_keep)
          ].rename(
              {
                  "y": model_args["target"],  # auto mode
                  "NHITS": model_args["target"],  # non-auto mode
              },
              axis=1,
          )
      return get_results_from_nixtla_df(results_df, model_args)
  
file_path: mindsdb/mindsdb/integrations/handlers/neuralforecast_handler/neuralforecast_handler.py
imports: from sklearn.metrics import r2_score
  import dill
  import pandas
  import tempfile
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.integrations.utilities.time_series_utils import transform_to_nixtla_df, get_results_from_nixtla_df, infer_frequency, get_model_accuracy_dict, get_hierarchy_from_df, reconcile_forecasts
  from neuralforecast import NeuralForecast
  from neuralforecast.models import NHITS
  from neuralforecast.auto import AutoNHITS
  from ray.tune.search.hyperopt import HyperOptSearch
label_desc: Use image node_id 2 for calling the NeuralForecastHandler obj's underlying member method code with example usage: obj.predict(df, args) and returns: get_results_from_nixtla_df