code: def test_factorial_importance_analysis(space, n_levels):
      N = 20
      transformer = Transformer(space, n_levels)
      trials = get_n_completed_trials(space, N)
      oa_table = transformer.generate_oa_table(trials)
  
      factorial_performance_analysis = (
          get_factorial_performance_analysis(oa_table, space, n_levels)
      )
  
      factorial_importance_analysis = get_factorial_importance_analysis(
          factorial_performance_analysis, space
      )
  
      variance = np.ma.masked_invalid(
          factorial_performance_analysis[space.keys()].to_numpy()
      ).var(0)
      assert (
          variance.argmin()
          == factorial_importance_analysis["importance"].argmin()
      )
      assert (
          variance.argmax()
          == factorial_importance_analysis["importance"].argmax()
      )
  
file_path: orion/tests/unittests/algo/mofa/test_analysis.py
imports: import itertools
  import numpy
  import pandas
  import pytest
  from orion.algo.mofa.mofa import MOFA, get_factorial_importance_analysis, get_factorial_performance_analysis, select_new_region_of_interest
  from orion.algo.mofa.transformer import Transformer
  from orion.core.io.space_builder import SpaceBuilder
  from orion.core.worker.transformer import build_required_space
label_desc: Use image node_id 7 for calling a global function with example usage: test_factorial_importance_analysis(space, n_levels) without return types