code: def get_factorial_performance_analysis(
      oa_table: pd.DataFrame, space: Space, n_levels: int
  ) -> pd.DataFrame:
      """Compute the factorial performance analysis"""
      levels = list(range(1, n_levels + 1))
      factorial_performance_analysis = [[level] for level in levels]
      for key in space.keys():
          marginal_means = (
              oa_table[[key, "objective"]]
              .groupby([key])
              .mean()
              .reset_index()
          )
          dim_levels = set(levels)
          for _, row in marginal_means.iterrows():
              dim_level = int(row[key])
              factorial_performance_analysis[dim_level - 1].append(
                  row["objective"]
              )
              dim_levels.remove(dim_level)
  
          for remaining_level in dim_levels:
              factorial_performance_analysis[
                  remaining_level - 1
              ].append(float("inf"))
  
      return pd.DataFrame(
          factorial_performance_analysis,
          columns=["level"] + list(space.keys()),
      )
  
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 for calling a global function with example usage: get_factorial_performance_analysis(oa_table, space, n_levels) and returns: pd