class_docstr: Class to test the AutoML flow
      
class_docstr_tok: ["Class","to","test","the","AutoML","flow"]
docstr: Testing ML Standalone with CV
docstr_tok: ["Testing","ML","Standalone","with","CV"]
code: def test_ml_standalone_with_cv(self):
      """
      Testing ML Standalone with CV
      """
      print("\n\n" + "*" * 50)
      print("Performing Unit Test: 'test_ml_standalone_withCV'")
      print("*" * 50 + "\n\n")
  
      # import numpy as np  # type: ignore
      # from auto_ts import auto_timeseries as ATS
  
      automl_model = ATS(
          score_type="rmse",
          forecast_period=self.forecast_period,
          time_interval="Month",
          non_seasonal_pdq=None,
          seasonality=False,
          seasonal_period=12,
          model_type=["ML"],
          verbose=0,
      )
      automl_model.fit(
          traindata=self.train_multivar,
          ts_column=self.ts_column,
          target=self.target,
          cv=2,
          sep=self.sep,
      )
  
      ml_dict = automl_model.get_ml_dict()
  
      leaderboard_gold = pd.DataFrame(
          {"name": ["ML"], "rmse": [self.rmse_gold_ml_multivar_cv]}
      )
      assert_frame_equal(
          automl_model.get_leaderboard()
          .reset_index(drop=True)
          .round(6),
          leaderboard_gold,
      )
  
      if automl_model.get_model_build("ML") is not None:
          # Simple forecast with forecast window = one used in training
          # Using named model
          test_predictions = automl_model.predict(
              forecast_period=self.forecast_period,
              testdata=self.test_multivar[
                  [self.ts_column] + self.preds
              ],
              model="ML",
          )
          assert_series_equal(
              test_predictions["mean"].round(6),
              self.forecast_gold_ml_multivar_external_test_cv,
          )
  
          # Simple forecast with forecast window != one used in training
          # Using named model
          test_predictions = automl_model.predict(
              forecast_period=6,
              testdata=self.test_multivar.iloc[0:6][
                  [self.ts_column] + self.preds
              ],
              model="ML",
          )
          assert_series_equal(
              test_predictions["mean"].round(6),
              self.forecast_gold_ml_multivar_external_test_10_cv,
          )
  
          # Complex forecasts (returns confidence intervals, etc.)
          test_predictions = automl_model.predict(
              forecast_period=self.forecast_period,
              testdata=self.test_multivar[
                  [self.ts_column] + self.preds
              ],
              model="ML",
              simple=False,
          )
          self.assertIsNone(
              np.testing.assert_array_equal(
                  test_predictions.columns.values,
                  self.expected_pred_col_names,
              )
          )
  
          # For ML forecast window is ignored (horizon only depends on the length of testdata)
          # Hence even though we specify forecast_period of 10, it only takes 8 here
          test_predictions = automl_model.predict(
              forecast_period=10,
              testdata=self.test_multivar[
                  [self.ts_column] + self.preds
              ],
              model="ML",
          )
          assert_series_equal(
              test_predictions["mean"].round(6),
              self.forecast_gold_ml_multivar_external_test_cv,
          )
  
      # RMSE check for each fold
      self.assertEqual(
          round(ml_dict.get("ML").get("rmse")[0], 8),
          self.rmse_gold_ml_multivar_cv_fold1,
          "(Multivar Test) ML RMSE does not match up with expected values --> Fold 1.",
      )
      self.assertEqual(
          round(ml_dict.get("ML").get("rmse")[1], 8),
          self.rmse_gold_ml_multivar_cv_fold2,
          "(Multivar Test) ML RMSE does not match up with expected values --> Fold 2.",
      )
  
imports: import sys
  import os
  import unittest
  import math
  import numpy
  import pandas
  from pandas.testing import assert_series_equal
  from pandas.testing import assert_frame_equal
  from prophet.forecaster import Prophet
  from statsmodels.tsa.statespace.sarimax import SARIMAXResultsWrapper
  from sklearn.base import BaseEstimator
  from auto_ts import auto_timeseries
label_desc: Use image node_id 12 for calling the TestAutoTS obj's underlying member method code with example usage: obj.test_ml_standalone_with_cv() without return types