docstr: Checks __mdb_forecast_offset behavior using sktime mixer 
docstr_tok: ["Checks","__mdb_forecast_offset","behavior","using","sktime","mixer"]
code: def test_61_offset(self):
      """Checks __mdb_forecast_offset behavior using sktime mixer"""
      data = pd.read_csv("tests/data/house_sales.csv")
      data = data[data["type"] == "house"]
      data = data[data["bedrooms"] == 2]
      train = data.iloc[0:-1]
      test = data.iloc[[-1]]
      oby = "saledate"
      pdef = ProblemDefinition.from_dict(
          {
              "target": "MA",
              "timeseries_settings": {
                  "order_by": oby,
                  "window": 5,
                  "horizon": 5,
              },
          }
      )
      json_ai = json_ai_from_problem(train, problem_definition=pdef)
      json_ai.model["args"]["submodels"] = [
          {"module": "SkTime", "args": {}}
      ]
      predictor = predictor_from_code(code_from_json_ai(json_ai))
      train_and_check_time_aim(predictor, train)
  
      for idx in [-2, -1, 0]:
          # Should yield predictions starting on the date of the idx-most recent data point seen at training time.
          train["__mdb_forecast_offset"] = idx
          ps = predictor.predict(train)
          assert len(ps) == 1
          assert ps.iloc[0]["original_index"] == (len(train) - 1 + idx)
  
      for idx in [1, None]:
          # Last row yields predictions starting one period after the most recent timestamp seen at training time
          train["__mdb_forecast_offset"] = idx
          args = {} if idx == 1 else {"force_ts_infer": True}
          ps = predictor.predict(train, args=args)
          if idx == 1:
              assert len(ps) == 1
          else:
              assert (
                  len(ps) == len(train) + 1
              )  # `None` triggers bulk prediction with inferred row at the end
  
          assert ps.iloc[-1]["original_index"] == (
              len(train) - 1
          )  # fixed at the last seen training point
          start_predtime = datetime.utcfromtimestamp(
              ps.iloc[-1][f"order_{oby}"][0]
          )
          start_test = datetime.utcfromtimestamp(
              pd.to_datetime(test.iloc[0][oby], utc=True).value // 1e9
          )
          assert start_test - start_predtime <= timedelta(days=2)
  
          if idx is None:
              ps = predictor.predict(
                  train, args={}
              )  # ensure without `force_ts_infer` flag it behaves normally
              assert len(ps) == len(train)
  
imports: import random
  from datetime import datetime
  from datetime import timedelta
  import unittest
  import numpy
  import pandas
  from typing import List
  from scipy import signal
  from sklearn.metrics import r2_score
  from lightwood.api.types import ProblemDefinition
  from tests.utils.timing import train_and_check_time_aim
  from sktime.forecasting.base import ForecastingHorizon
  from sktime.forecasting.statsforecast import StatsForecastAutoARIMA
  from dataprep_ml.splitters import stratify
  from lightwood.api.high_level import json_ai_from_problem, code_from_json_ai, predictor_from_code, predictor_from_problem, predictor_from_json_ai
  from lightwood.mixer.sktime import SkTime
label_desc: Use image node_id 10 for calling the TestTimeseries obj's underlying member method code with example usage: obj.test_61_offset() without return types