class_docstr: Configuration options for the training of the Profet meta-model.
class_docstr_tok: ["Configuration","options","for","the","training","of","the","Profet","meta-model","."]
docstr: Create, train and return the objective model, and (optionally) a cost model for the data.
  
  Parameters
  ----------
  X_train : np.ndarray
      Training samples.
  Y_train : np.ndarray
      Training objectives.
  C_train : np.ndarray
      Training costs.
  with_cost : bool, optional
      Whether to also create a surrogate model for the cost. Defaults to `False`.
  
  Returns
  -------
  Tuple[Bohamiann, Optional[Bohamiann]]
      Surrogate model for the objective, as well as another for the cost, if `with_cost` is
      True, otherwise `None`.
docstr_tok: ["Create",",","train","and","return","the","objective","model",",","and","(","optionally",")","a","cost","model","for","the","data",".","Parameters","--","--","--","--","--","X_train",":","np.ndarray","Training","samples",".","Y_train",":","np.ndarray","Training","objectives",".","C_train",":","np.ndarray","Training","costs",".","with_cost",":","bool",",","optional","Whether","to","also","create","a","surrogate","model","for","the","cost",".","Defaults","to","`","False","`",".","Returns","--","--","--","-","Tuple","[","Bohamiann",",","Optional","[","Bohamiann","]","]","Surrogate","model","for","the","objective",",","as","well","as","another","for","the","cost",",","if","`","with_cost","`","is","True",",","otherwise","`","None","`","."]
code: def _get_meta_model(
      self,
      X_train: np.ndarray,
      Y_train: np.ndarray,
      C_train: np.ndarray,
      with_cost: bool = False,
  ):
      """Create, train and return the objective model, and (optionally) a cost model for the data.
  
      Parameters
      ----------
      X_train : np.ndarray
          Training samples.
      Y_train : np.ndarray
          Training objectives.
      C_train : np.ndarray
          Training costs.
      with_cost : bool, optional
          Whether to also create a surrogate model for the cost. Defaults to `False`.
  
      Returns
      -------
      Tuple[Bohamiann, Optional[Bohamiann]]
          Surrogate model for the objective, as well as another for the cost, if `with_cost` is
          True, otherwise `None`.
      """
      objective_model = Bohamiann(
          get_network=type(self).get_architecture,
          print_every_n_steps=1000,
          normalize_output=self.normalize_targets,
      )
      logger.info("Training Bohamiann objective model.")
  
      if self.max_samples is not None:
          logger.info(
              f"Limiting the dataset to a maximum of {self.max_samples} samples."
          )
          X_train = X_train[: self.max_samples, ...]
          Y_train = Y_train[: self.max_samples, ...]
          C_train = C_train[: self.max_samples, ...]
  
      logger.debug(f"Shapes: {X_train.shape}, {Y_train.shape}")
      logger.debug(f"config: {self}")
  
      objective_model.train(
          X_train,
          Y_train,
          num_steps=self.num_steps + self.num_burnin_steps,
          num_burn_in_steps=self.num_burnin_steps,
          keep_every=self.mcmc_thining,
          lr=self.lr,
          verbose=True,
          batch_size=self.batch_size,
      )
  
      if with_cost:
          cost_model = Bohamiann(
              get_network=type(self).get_architecture,
              print_every_n_steps=1000,
          )
          logger.info("Training Bohamiann cost model.")
          cost_model.train(
              X_train,
              C_train,
              num_steps=self.num_steps + self.num_burnin_steps,
              num_burn_in_steps=self.num_burnin_steps,
              keep_every=self.mcmc_thining,
              lr=self.lr,
              verbose=True,
              batch_size=self.batch_size,
          )
      else:
          cost_model = None
  
      return objective_model, cost_model
  
imports: import json
  import pickle
  import warnings
  from abc import ABC
  from copy import deepcopy
  from dataclasses import dataclass
  from logging import getLogger
  from pathlib import Path
  from typing import Any, Callable, ClassVar, Optional, Tuple, Union
  import numpy
label_desc: Use image node_id 6 for calling the MetaModelConfig obj's underlying member method code with example usage: obj._get_meta_model(X_train, Y_train, C_train, with_cost) and returns: objective_model,  cost_model