dora/active_sampling/base_sampler.py
def _assign(self, xq, yq_exp):
        """
        Assign a pair (location in parameter space, virtual target) a job ID.

        Parameters
        ----------
        xq : numpy.ndarray
            Location in the parameter space for the next observation to be
            taken
        yq_exp : float
            The virtual target output at that parameter location

        Returns
        -------
        str
            A random hexadecimal ID to identify the corresponding job
        """
        # Place a virtual observation onto the collected data
        n = len(self.X)
        self.X.append(xq)
        self.virtual_flag.append(True)

        # If we get a None, insert zeros instead
        if yq_exp is None and self.n_tasks is not None:
            self.y.append(np.zeros(self.n_tasks))
        else:
            self.y.append(yq_exp)  # then add the real one

        # Create an uid for this observation
        # m = hashlib.md5()
        # m.update(np.array(np.random.random()))
        # uid = m.hexdigest()
        uid = uuid.uuid4().hex  # "%032x" % random.getrandbits(128)

        # Note the index of corresponding to this picked location
        self.pending_results[uid] = n

        return uid

        Assign a pair (location in parameter space, virtual target) a job ID.

        Parameters
        ----------
        xq : numpy.ndarray
            Location in the parameter space for the next observation to be
            taken
        yq_exp : float
            The virtual target output at that parameter location

        Returns
        -------
        str
            A random hexadecimal ID to identify the corresponding job
        
Assign a pair (location in parameter space, virtual target) a job ID.
Parameters

xq : numpy.ndarray
Location in the parameter space for the next observation to be
taken
yq_exp : float
The virtual target output at that parameter location

Returns

str
A random hexadecimal ID to identify the corresponding job
Assign a pair ( location in parameter space virtual target ) a job ID . Parameters xq : numpy . ndarray Location in the parameter space for the next observation to be taken yq_exp : float The virtual target output at that parameter location Returns str A random hexadecimal ID to identify the corresponding job
def _assign(self, xq, yq_exp):
        n = len(self.X)
        self.X.append(xq)
        self.virtual_flag.append(True)
        if yq_exp is None and self.n_tasks is not None:
            self.y.append(np.zeros(self.n_tasks))
        else:
            self.y.append(yq_exp)  
        uid = uuid.uuid4().hex  
        self.pending_results[uid] = n
        return uid
def _assign ( self , xq , yq_exp ) : n = len ( self . X ) self . X . append ( xq ) self . virtual_flag . append ( True ) if yq_exp is None and self . n_tasks is not None : self . y . append ( np . zeros ( self . n_tasks ) ) else : self . y . append ( yq_exp ) uid = uuid . uuid4 ( ) . hex self . pending_results [ uid ] = n return uid
Assign a pair (location in parameter space, virtual target) a job ID.
Assign a pair ( location in parameter space virtual target ) a job ID .
"""
        Assign a pair (location in parameter space, virtual target) a job ID.

        Parameters
        ----------
        xq : numpy.ndarray
            Location in the parameter space for the next observation to be
            taken
        yq_exp : float
            The virtual target output at that parameter location

        Returns
        -------
        str
            A random hexadecimal ID to identify the corresponding job
        """ # Place a virtual observation onto the collected data # If we get a None, insert zeros instead # then add the real one # Create an uid for this observation # m = hashlib.md5() # m.update(np.array(np.random.random())) # uid = m.hexdigest() # "%032x" % random.getrandbits(128) # Note the index of corresponding to this picked location
self
xq
yq_exp