<jupyter_start><jupyter_text>MultiFiMetaModelUnStructuredComp`MultiFiMetaModelUnStructuredComp` is a component that allows you to create a surrogate model wherethe training data has been gathered from sources with multiple levels of fidelity. This approachcan be beneficial when a high-fidelity model is expensive to evaluate but a low-fidelity modelexists that can be evaluated more efficiently at the cost of some accuracy; the main benefit comesfrom replacing some of the expensive evaluation points with a larger set of cheaper points whilemaintaining confidence in the overall prediction.`MultiFiMetaModelUnStructuredComp` inherits from [MetaModelUnStructuredComp](metamodelunstructured_comp), so its interface andusage are mostly the same. However, it does not use the same SurrogateModels. The only availableSurrogateModel is the `MultiFiCoKrigingSurrogate`, which implements the Multi-Fidelity Co-Krigingmethod as found in Scikit-Learn. MultiFiMetaModelUnStructuredComp Options<jupyter_code>om.show_options_table("openmdao.components.multifi_meta_model_unstructured_comp.MultiFiMetaModelUnStructuredComp")<jupyter_output><empty_output><jupyter_text>MultiFiMetaModelUnStructuredComp ConstructorThe call signature for the `MultiFiMetaModelUnStructuredComp` constructor is:```{eval-rst}    .. automethod:: openmdao.components.multifi_meta_model_unstructured_comp.MultiFiMetaModelUnStructuredComp.__init__()        :noindex:``` Simple ExampleThe following example shows a `MultiFiMetaModelUnStructuredComp` used to model the 2D Braninfunction, where the output is a function of two inputs, and we have pre-computed the trainingpoint location and values at a variety of points using models with two different fidelitylevels. Adding an input or output named 'x' spawns entries in the "options" dictionary where thetraining data can be specified. The naming convention is 'train:y' for the highest fidelity, and'train:y_fi2' for the lowest fidelity level (or in the case of more than 2 fidelity levels, thenext highest level.)<jupyter_code>import numpy as np

mm = om.MultiFiMetaModelUnStructuredComp(nfi=2)
mm.add_input('x', np.zeros((1, 2)))
mm.add_output('y', np.zeros((1, )))

# Surrrogate model that implements the multifidelity cokriging method.
mm.options['default_surrogate'] = om.MultiFiCoKrigingSurrogate(normalize=False)

prob = om.Problem()
prob.model.add_subsystem('mm', mm)

prob.setup()

x_hifi = np.array([[ 0.13073587,  0.24909577],  # expensive (hifi) doe
                   [ 0.91915571,  0.4735261 ],
                   [ 0.75830543,  0.13321705],
                   [ 0.51760477,  0.34594101],
                   [ 0.03531219,  0.77765831],
                   [ 0.27249206,  0.5306115 ],
                   [ 0.62762489,  0.65778471],
                   [ 0.3914706 ,  0.09852519],
                   [ 0.86565585,  0.85350002],
                   [ 0.40806563,  0.91465314]])

y_hifi = np.array([69.22687251161716,
                   28.427292491743817,
                   20.36175030334259,
                   7.840766670948326,
                   23.950783505007422,
                   16.0326610719367,
                   77.32264403894713,
                   26.625242780670835,
                   135.85615334210993,
                   101.43980212355875])

x_lofi = np.array([[ 0.91430235,  0.17029894],  # cheap (lowfi) doe
                   [ 0.99329651,  0.76431519],
                   [ 0.2012252 ,  0.35006032],
                   [ 0.61707854,  0.90210676],
                   [ 0.15113004,  0.0133355 ],
                   [ 0.07108082,  0.55344447],
                   [ 0.4483159 ,  0.52182902],
                   [ 0.5926638 ,  0.06595122],
                   [ 0.66305449,  0.48579608],
                   [ 0.47965045,  0.7407793 ],
                   [ 0.13073587,  0.24909577],  # notice hifi doe inclusion
                   [ 0.91915571,  0.4735261 ],
                   [ 0.75830543,  0.13321705],
                   [ 0.51760477,  0.34594101],
                   [ 0.03531219,  0.77765831],
                   [ 0.27249206,  0.5306115 ],
                   [ 0.62762489,  0.65778471],
                   [ 0.3914706 ,  0.09852519],
                   [ 0.86565585,  0.85350002],
                   [ 0.40806563,  0.91465314]])

y_lofi = list([18.204898470295255,
               107.66640600958577,
               46.11717344625053,
               186.002239934648,
               135.12480249921992,
               65.3605467926758,
               51.72316385370553,
               15.541873662737451,
               72.77648156410065,
               100.33324800434931,
               86.69974561161716,
               52.63307549174382,
               34.358261803342586,
               28.218996970948325,
               57.280532805007425,
               41.9510060719367,
               107.05618533894713,
               39.580998480670836,
               171.46115394210995,
               138.87939632355875])

mm.options['train:x'] = x_hifi
mm.options['train:y'] = y_hifi
mm.options['train:x_fi2'] = x_lofi
mm.options['train:y_fi2'] = y_lofi

prob.set_val('mm.x', np.array([[2./3., 1./3.]]))
prob.run_model()

print(prob.get_val('mm.y'))
from openmdao.utils.assert_utils import assert_near_equal

assert_near_equal(prob.get_val('mm.y'), 26.26, tolerance=0.02)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09199700822737472, 'fraction_numerical': 0.19483919222139118, 'mean_word_length': 2.3120743034055726, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '162353', 'license': 'Apache-2.0', 'n_tokens_mistral': 2383, 'n_tokens_neox': 1703, 'n_words': 364, 'path': 'openmdao/docs/openmdao_book/features/building_blocks/components/multifi_metamodelunstructured_comp.ipynb', 'repo_name': 'sebasgo/OpenMDAO', 'size': '5348'}