class_docstr: Class to select appropriate window size to catch periodicity for time series analysis.
  There are two group of algorithms implemented:
  Whole-Series-Based (WSB):
      1. WindowSizeSelectorMethodsEnum.HAC - highest_autocorrelation
      2. WindowSizeSelectorMethodsEnum.DFF - dominant_fourier_frequency
  Subsequence-based (SB):
      1. WindowSizeSelectorMethodsEnum.MWF - multi_window_finder
      2. WindowSizeSelectorMethodsEnum.SSS - summary_statistics_subsequence
  Args:
      method: by ``default``, it is WindowSizeSelectorMethodsEnum.DFF.
      window_range: % of time series length, by ``default`` it is (5, 50).
  Attributes:
      length_ts(int): length of the time_series.
      window_max(int): maximum window size in real values.
      window_min(int): minimum window size in real values.
      dict_methods(dict): dictionary with all implemented methods.
  Example:
      To find window size for single time series::
          ts = np.random.rand(1000)
          ws_selector = WindowSizeSelector(method='hac')
          window_size = ws_selector.get_window_size(time_series=ts)
      To find window size for multiple time series::
          ts = np.random.rand(1000, 10)
          ws_selector = WindowSizeSelector(method='hac')
          window_size = ws_selector.apply(time_series=ts, average='median')
  Reference:
      (c) "Windows Size Selection in Unsupervised Time Series Analytics: A Review and Benchmark. Arik Ermshaus,
      Patrick Schafer, and Ulf Leser. 2022"
class_docstr_tok: ["Class","to","select","appropriate","window","size","to","catch","periodicity","for","time","series","analysis",".","There","are","two","group","of","algorithms","implemented",":","Whole-Series-Based","(","WSB",")",":","1",".","WindowSizeSelectorMethodsEnum.HAC","-","highest_autocorrelation","2",".","WindowSizeSelectorMethodsEnum.DFF","-","dominant_fourier_frequency","Subsequence-based","(","SB",")",":","1",".","WindowSizeSelectorMethodsEnum.MWF","-","multi_window_finder","2",".","WindowSizeSelectorMethodsEnum.SSS","-","summary_statistics_subsequence","Args",":","method",":","by","``","default","``",",","it","is","WindowSizeSelectorMethodsEnum.DFF",".","window_range",":","%","of","time","series","length",",","by","``","default","``","it","is","(","5",",","50",")",".","Attributes",":","length_ts","(","int",")",":","length","of","the","time_series",".","window_max","(","int",")",":","maximum","window","size","in","real","values",".","window_min","(","int",")",":","minimum","window","size","in","real","values",".","dict_methods","(","dict",")",":","dictionary","with","all","implemented","methods",".","Example",":","To","find","window","size","for","single","time","series",":",":","ts","=","np.random.rand","(","1000",")","ws_selector","=","WindowSizeSelector","(","method='hac","'",")","window_size","=","ws_selector.get_window_size","(","time_series=ts",")","To","find","window","size","for","multiple","time","series",":",":","ts","=","np.random.rand","(","1000",",","10",")","ws_selector","=","WindowSizeSelector","(","method='hac","'",")","window_size","=","ws_selector.apply","(","time_series=ts",",","average='median","'",")","Reference",":","(","c",")","``","Windows","Size","Selection","in","Unsupervised","Time","Series","Analytics",":","A","Review","and","Benchmark",".","Arik","Ermshaus",",","Patrick","Schafer",",","and","Ulf","Leser",".","2022","''"]
docstr: Method to find dominant fourier frequency in time series and return appropriate window size. It is based on
  the assumption that the dominant frequency is the one with the highest magnitude in the Fourier transform. The
  window size is then the inverse of the dominant frequency.
docstr_tok: ["Method","to","find","dominant","fourier","frequency","in","time","series","and","return","appropriate","window","size",".","It","is","based","on","the","assumption","that","the","dominant","frequency","is","the","one","with","the","highest","magnitude","in","the","Fourier","transform",".","The","window","size","is","then","the","inverse","of","the","dominant","frequency","."]
code: def dominant_fourier_frequency(self, time_series: np.ndarray) -> int:
      """
      Method to find dominant fourier frequency in time series and return appropriate window size. It is based on
      the assumption that the dominant frequency is the one with the highest magnitude in the Fourier transform. The
      window size is then the inverse of the dominant frequency.
      """
      fourier = np.fft.fft(time_series)
      freq = np.fft.fftfreq(time_series.shape[0], 1)
  
      magnitudes, window_sizes = [], []
  
      for coef, freq in zip(fourier, freq):
          if coef and freq > 0:
              window_size = int(1 / freq)
              mag = math.sqrt(
                  coef.real * coef.real + coef.imag * coef.imag
              )
  
              if self.window_min <= window_size < self.window_max:
                  window_sizes.append(window_size)
                  magnitudes.append(mag)
      if window_sizes and magnitudes:
          return window_sizes[np.argmax(magnitudes)]
      else:
          return self.window_min
  
file_path: FEDOT/fedot/utilities/window_size_selector.py
imports: import math
  from enum import Enum, auto
  import numpy
  import pandas
  from scipy.signal import find_peaks
  from statsmodels.tsa.stattools import acf
label_desc: Use image node_id 4 for calling the WindowSizeSelector obj's underlying member method code with example usage: obj.dominant_fourier_frequency(time_series) and returns: window_sizes, self