class_docstr: MOdular FActorial Design (MOFA).
  
  For more information on the algorithm, see original paper: MOFA: Modular
  Factorial Design for Hyperparameter Optimization https://arxiv.org/abs/2011.09545
  
  Xiong, Bo, Yimin Huang, Hanrong Ye, Steffen Staab, and Zhenguo Li.
  "MOFA: Modular Factorial Design for Hyperparameter Optimization."
  arXiv preprint arXiv:2011.09545 (2020).
  
  Notes
  -----
  Default values for the index, n_levels, and strength (t) parameter are set
  to the empirically obtained optimal values described in section 5.2 of the paper.
  
  The number of trials N for a single MOFA iteration is set to ``N = index * n_levels^t``.
  The ``--exp-max-trials`` should be a multiple of N.
  
  MOFA requires Python v3.8 or greater and scipy v1.8 or greater.
  
  Parameters
  ----------
  space: `orion.algo.space.Space`
      Optimisation space with priors for each dimension.
  seed: None, int or sequence of int
      Seed for the random number generator used to sample new trials.
      Default: ``None``
  index: int, optional
      This is the lambda parameter in the paper.
      Default: ``1``
  n_levels: int, optional
      Number of levels in the orthogonal Latin hypercube (OLH) table. Should be set to a
      prime number. This is the l parameter in the paper.
      Default: ``5``
  strength: int, optional
      Strength parameter. This is the t parameter in the paper.
      Default: ``2``
  threshold: float, optional
      The threshold to determine is a dimension was explored enough and can be fixed.
      Default: 0.1
code: def __init__(
      self,
      space: Space,
      seed: int | Sequence[int] | None = None,
      index: int = 1,
      n_levels: int = 5,
      strength: int = 2,
      threshold: float = 0.1,
  ):
      if version.parse(scipy.__version__) < version.parse("1.8"):
          raise RuntimeError(
              "MOFA algorithm requires scipy version >= 1.8."
          )
  
      index = int(index)
      n_levels = int(n_levels)
      threshold = float(threshold)
      if index < 1:
          raise ValueError(
              f"index must be >= 1! (currently: {index})!\n"
          )
      if n_levels not in {2, 3, 5, 7, 11, 13, 17, 19}:
          raise ValueError(
              f"n_levels must be a small prime number! (currently: {n_levels})!\n"
              f"The implementation additionally restricts it to <= 19."
          )
      if strength not in {1, 2}:
          raise ValueError(
              f"strength must be 1 or 2 (currently: {strength})!\n"
          )
      if threshold <= 0 or threshold >= 1:
          raise ValueError(
              f"threshold must be strictly between 0 and 1! (currently: {threshold})!\n"
          )
  
      super().__init__(
          space,
          seed=seed,
          index=index,
          n_levels=n_levels,
          strength=strength,
          threshold=threshold,
      )
  
      self.cur_n_levels = self.n_levels
      self.roi_space = None
      self.completed_trials = []
      self.duplicates = defaultdict(list)
      self.converged = False
      self.n_trials = None
  
      # Initialize a dictionary for the frozen values of each hyperparameter
      self.frozen_param_values = {}
  
      # Generate the initial set of trials
      self.roi_space = self.space
      self.current_trials_params = (
          self._generate_trials_unfrozen_params(self.roi_space)
      )
  
imports: from __future__ import annotations
  import copy
  import logging
  from collections import defaultdict
  from typing import Sequence
  import numpy
  import pandas
  import scipy
  from packaging import version
  from orion.algo.base import BaseAlgorithm
  from orion.algo.mofa import sampler
  from orion.algo.mofa.transformer import Transformer
  from orion.algo.space import Real, Space
  from orion.core.utils.format_trials import dict_to_trial
  from orion.core.worker.trial import Trial
label_desc: Use image node_id 1 to create a new MOFA object from inherited base classes: BaseAlgorithm with example: obj = MOFA(space, seed, index, n_levels, strength, threshold)