emat/model/core_model.py
def create_metamodel_from_design(
            self,
            design_name:str,
            metamodel_id:int = None,
            include_measures=None,
            exclude_measures=None,
            db=None,
            random_state=None,
            suppress_converge_warnings=False,
            regressor=None,
    ):
        """
        Create a MetaModel from a set of input and output observations.

        Args:
            design_name (str): The name of the design to use.
            metamodel_id (int, optional): An identifier for this meta-model.
                If not given, a unique id number will be created randomly.
            include_measures (Collection[str], optional): If provided, only
                output performance measures with names in this set will be included.
            exclude_measures (Collection[str], optional): If provided, only
                output performance measures with names not in this set will be included.
            random_state (int, optional): A random state to use in the metamodel
                regression fitting.
            suppress_converge_warnings (bool, default False):
                Suppress convergence warnings during metamodel fitting.
            regressor (Estimator, optional): A scikit-learn estimator implementing a
                multi-target regression.  If not given, a detrended simple Gaussian
                process regression is used.

        Returns:
            MetaModel:
                a callable object that, when called as if a
                function, accepts keyword arguments as inputs and
                returns a dictionary of (measure name: value) pairs.

        Raises:
            ValueError: If the named design still has pending experiments.
        """
        db = db if db is not None else self.db

        if db is not None:
            check_df = db.read_experiment_parameters(self.scope.name, design_name, only_pending=True)
            if not check_df.empty:
                from ..exceptions import PendingExperimentsError
                raise PendingExperimentsError(f'design "{design_name}" has pending experiments')

        experiment_inputs = db.read_experiment_parameters(self.scope.name, design_name)
        experiment_outputs = db.read_experiment_measures(self.scope.name, design_name)

        transforms = {
            i.name: i.metamodeltype
            for i in self.scope.get_measures()
        }

        return self.create_metamodel_from_data(
            experiment_inputs,
            experiment_outputs,
            transforms,
            metamodel_id=metamodel_id,
            include_measures=include_measures,
            exclude_measures=exclude_measures,
            db=db,
            random_state=random_state,
            suppress_converge_warnings=suppress_converge_warnings,
            regressor=regressor,
        )

        Create a MetaModel from a set of input and output observations.

        Args:
            design_name (str): The name of the design to use.
            metamodel_id (int, optional): An identifier for this meta-model.
                If not given, a unique id number will be created randomly.
            include_measures (Collection[str], optional): If provided, only
                output performance measures with names in this set will be included.
            exclude_measures (Collection[str], optional): If provided, only
                output performance measures with names not in this set will be included.
            random_state (int, optional): A random state to use in the metamodel
                regression fitting.
            suppress_converge_warnings (bool, default False):
                Suppress convergence warnings during metamodel fitting.
            regressor (Estimator, optional): A scikit-learn estimator implementing a
                multi-target regression.  If not given, a detrended simple Gaussian
                process regression is used.

        Returns:
            MetaModel:
                a callable object that, when called as if a
                function, accepts keyword arguments as inputs and
                returns a dictionary of (measure name: value) pairs.

        Raises:
            ValueError: If the named design still has pending experiments.
        
Create a MetaModel from a set of input and output observations.
Create a MetaModel from a set of input and output observations .
def create_metamodel_from_design(
            self,
            design_name:str,
            metamodel_id:int = None,
            include_measures=None,
            exclude_measures=None,
            db=None,
            random_state=None,
            suppress_converge_warnings=False,
            regressor=None,
    ):
        db = db if db is not None else self.db
        if db is not None:
            check_df = db.read_experiment_parameters(self.scope.name, design_name, only_pending=True)
            if not check_df.empty:
                from ..exceptions import PendingExperimentsError
                raise PendingExperimentsError(f'design "{design_name}" has pending experiments')
        experiment_inputs = db.read_experiment_parameters(self.scope.name, design_name)
        experiment_outputs = db.read_experiment_measures(self.scope.name, design_name)
        transforms = {
            i.name: i.metamodeltype
            for i in self.scope.get_measures()
        }
        return self.create_metamodel_from_data(
            experiment_inputs,
            experiment_outputs,
            transforms,
            metamodel_id=metamodel_id,
            include_measures=include_measures,
            exclude_measures=exclude_measures,
            db=db,
            random_state=random_state,
            suppress_converge_warnings=suppress_converge_warnings,
            regressor=regressor,
        )
def create_metamodel_from_design ( self , design_name : str , metamodel_id : int = None , include_measures = None , exclude_measures = None , db = None , random_state = None , suppress_converge_warnings = False , regressor = None , ) : db = db if db is not None else self . db if db is not None : check_df = db . read_experiment_parameters ( self . scope . name , design_name , only_pending = True ) if not check_df . empty : from . . exceptions import PendingExperimentsError raise PendingExperimentsError ( f'design "{design_name}" has pending experiments' ) experiment_inputs = db . read_experiment_parameters ( self . scope . name , design_name ) experiment_outputs = db . read_experiment_measures ( self . scope . name , design_name ) transforms = { i . name : i . metamodeltype for i in self . scope . get_measures ( ) } return self . create_metamodel_from_data ( experiment_inputs , experiment_outputs , transforms , metamodel_id = metamodel_id , include_measures = include_measures , exclude_measures = exclude_measures , db = db , random_state = random_state , suppress_converge_warnings = suppress_converge_warnings , regressor = regressor , )
Create a MetaModel from a set of input and output observations.
Create a MetaModel from a set of input and output observations .
"""
        Create a MetaModel from a set of input and output observations.

        Args:
            design_name (str): The name of the design to use.
            metamodel_id (int, optional): An identifier for this meta-model.
                If not given, a unique id number will be created randomly.
            include_measures (Collection[str], optional): If provided, only
                output performance measures with names in this set will be included.
            exclude_measures (Collection[str], optional): If provided, only
                output performance measures with names not in this set will be included.
            random_state (int, optional): A random state to use in the metamodel
                regression fitting.
            suppress_converge_warnings (bool, default False):
                Suppress convergence warnings during metamodel fitting.
            regressor (Estimator, optional): A scikit-learn estimator implementing a
                multi-target regression.  If not given, a detrended simple Gaussian
                process regression is used.

        Returns:
            MetaModel:
                a callable object that, when called as if a
                function, accepts keyword arguments as inputs and
                returns a dictionary of (measure name: value) pairs.

        Raises:
            ValueError: If the named design still has pending experiments.
        """
a callable object that, when called as if a
function, accepts keyword arguments as inputs and
returns a dictionary of (measure name: value) pairs.
a callable object that when called as if a function accepts keyword arguments as inputs and returns a dictionary of ( measure name : value ) pairs .
MetaModel
If the named design still has pending experiments.
If the named design still has pending experiments .
ValueError
self
design_name
str
The name of the design to use.
The name of the design to use .
metamodel_id
int
An identifier for this meta-model.
If not given, a unique id number will be created randomly.
An identifier for this meta - model . If not given a unique id number will be created randomly .
include_measures
If provided, only
output performance measures with names in this set will be included.
If provided only output performance measures with names in this set will be included .
exclude_measures
If provided, only
output performance measures with names not in this set will be included.
If provided only output performance measures with names not in this set will be included .
db
random_state
A random state to use in the metamodel
regression fitting.
A random state to use in the metamodel regression fitting .
suppress_converge_warnings
Suppress convergence warnings during metamodel fitting.
Suppress convergence warnings during metamodel fitting .
regressor
A scikit-learn estimator implementing a
multi-target regression.  If not given, a detrended simple Gaussian
process regression is used.
A scikit - learn estimator implementing a multi - target regression . If not given a detrended simple Gaussian process regression is used .