class_docstr: Mixin for k-neighbors searches on Time Series.
code: def _sax_preprocess(
      self, X, n_segments=10, alphabet_size_avg=4, scale=False
  ):
      # Now SAX-transform the time series
      if not hasattr(self, "_sax") or self._sax is None:
          self._sax = SymbolicAggregateApproximation(
              n_segments=n_segments,
              alphabet_size_avg=alphabet_size_avg,
              scale=scale,
          )
  
      X = to_time_series_dataset(X)
      X_sax = self._sax.fit_transform(X)
  
      return X_sax
  
imports: import numpy
  from sklearn import neighbors
  from sklearn.neighbors import KNeighborsClassifier, NearestNeighbors, KNeighborsRegressor
  from sklearn.utils import check_array
  from sklearn.utils.validation import check_is_fitted
  from scipy.spatial.distance import cdist
  from tslearn.metrics import cdist_dtw, cdist_ctw, cdist_soft_dtw, cdist_sax, TSLEARN_VALID_METRICS
  from tslearn.piecewise import SymbolicAggregateApproximation
  from tslearn.utils import to_time_series_dataset, to_sklearn_dataset, check_dims
  from tslearn.bases import BaseModelPackage
label_desc: Use image node_id 1 for calling the KNeighborsTimeSeriesMixin obj's underlying member method code with example usage: obj._sax_preprocess(X, n_segments, alphabet_size_avg, scale) and returns: X_sax