code: def init(self):
      # Init our model, a kNN classifier
      self.clf = KNeighborsClassifier(7)
  
      # Train the classifier in advance on the first N_TRAIN examples
      df = self.data.df.iloc[:N_TRAIN]
      X, y = get_clean_Xy(df)
      self.clf.fit(X, y)
  
      # Plot y for inspection
      self.I(get_y, self.data.df, name="y_true")
  
      # Prepare empty, all-NaN forecast indicator
      self.forecasts = self.I(
          lambda: np.repeat(np.nan, len(self.data)), name="forecast"
      )
  
file_path: backtesting.py/doc/examples/Trading with Machine Learning.py
imports: from backtesting.test import EURUSD, SMA
  import numpy
  import pandas
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.model_selection import train_test_split
  from backtesting import Backtest, Strategy
label_desc: Use image node_id 1 for calling the MLTrainOnceStrategy obj's underlying member method code with example usage: obj.init() without return types