Returns a dict of trial (hyper-)parameters, as a serializable object.

        Parameters
        ----------
        parameter_id : int
436442
def generate_parameters(self, parameter_id):
        
        self.count +=1
        if self.count>len(self.values)-1:
            raise nni.NoMoreTrialError('no more parameters now.')
        return self.values[self.count]
636758
def list_parameters_as_df(self):
        
        to_df = []

        for i, e in enumerate(self.ext_params):
            row = {}
            row['id'] = e['name']
            row['coords'] = "n/a"
            row['description'] = e['description']
            row['function'] = "n/a"

            to_df.append(row)

        for pk in self.params:
            p = self.params[pk]
            row = {}
            row['id'] = pk
            row['coords'] = p['coords']
            row['description'] = p['description']
            row['function'] = p['function']

            to_df.append(row)

        df = pd.DataFrame(to_df)
        
        return df
520333
def params(self):
        
        params = {}
        params["access_token"] = self.access_token
        params["account_id"] = self.account_id
        params["alert_id"] = self.alert_id
        params["mention_id"] = self.mention_id
        params["before_date"] = self.before_date if self.before_date else ""

        if self.limit:
            if int(self.limit) > 1000:
                params["limit"] = "1000"
            elif int(self.limit) < 1:
                params["limit"] = ""
            else:
                params["limit"] = self.limit

        return params
1121662
def _create_trial_info(self, expr_dir):
        
        meta = self._build_trial_meta(expr_dir)

        self.logger.debug("Create trial for %s" % meta)

        trial_record = TrialRecord.from_json(meta)
        trial_record.save()
255446
def generate_parameters(self, parameter_id):
        
        if self.first_one:
            init_challenger = self.smbo_solver.nni_smac_start()
            self.total_data[parameter_id] = init_challenger
            return self.convert_loguniform_categorical(init_challenger.get_dictionary())
        else:
            challengers = self.smbo_solver.nni_smac_request_challengers()
            for challenger in challengers:
                self.total_data[parameter_id] = challenger
                return self.convert_loguniform_categorical(challenger.get_dictionary())
1335642
def _get_hyperparameters(self):
        """"""
        hyperparameters = {}
        for key in self._hyperparameters:
            hyperparameters[key] = getattr(self, key)
        return hyperparameters
502765
def params(self):
        
        params, complex = self.get_params()
        url_params = self.default_params.copy()
        url_params.update(self.serialize_params(params, complex))
        return url_params
1165545
def as_id_dict(self):
		
		d = {}
		for row in self:
			if row.experiment_id not in d:
				d[row.experiment_id] = {}
			if (row.time_slide_id, row.veto_def_name, row.datatype, row.sim_proc_id) in d[row.experiment_id]:
				# entry already exists, raise error
				raise KeyError("duplicate entries in experiment_summary table")
			d[row.experiment_id][(row.time_slide_id, row.veto_def_name, row.datatype, row.sim_proc_id)] = row.experiment_summ_id

		return d
1176082
def get_details(self, ids):
        
        if isinstance(ids, list):
            if len(ids) > 5:
                ids = ids[:5]
            id_param = ';'.join(ids) + '/'
        else:
            ids = str(ids)
            id_param = ids + '/'

        header, content = self._http_request(id_param)
        resp = json.loads(content)
        if not self._is_http_response_ok(header):
            error = resp.get('error_message', 'Unknown Error')
            raise HttpException(header.status, header.reason, error) 
        return resp
1343687
def get_process_by_its_id(self, process_type_id, expand=None):
        
        route_values = {}
        if process_type_id is not None:
            route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str')
        query_parameters = {}
        if expand is not None:
            query_parameters['$expand'] = self._serialize.query('expand', expand, 'str')
        response = self._send(http_method='GET',
                              location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af',
                              version='5.0-preview.2',
                              route_values=route_values,
                              query_parameters=query_parameters)
        return self._deserialize('ProcessInfo', response)
686787
def receive_trial_result(self, parameter_id, parameters, value):
        
        value = extract_scalar_reward(value)
        if self.optimize_mode == OptimizeMode.Maximize:
            value = -value

        logger.info("Received trial result.")
        logger.info("value is :" + str(value))
        logger.info("parameter is : " + str(parameters))

        # parse parameter to sample_x
        sample_x = [0 for i in range(len(self.key_order))]
        for key in parameters:
            idx = self.key_order.index(key)
            sample_x[idx] = parameters[key]

        # parse value to sample_y
        temp_y = []
        if sample_x in self.samples_x:
            idx = self.samples_x.index(sample_x)
            temp_y = self.samples_y[idx]
            temp_y.append(value)
            self.samples_y[idx] = temp_y

            # calculate y aggregation
            median = get_median(temp_y)
            self.samples_y_aggregation[idx] = [median]
        else:
            self.samples_x.append(sample_x)
            self.samples_y.append([value])

            # calculate y aggregation
            self.samples_y_aggregation.append([value])
651696
def get_unique_parameters(self):
        '''
        
        '''
        # start with parameters in the `_parameters` dictionary
        parameters = self._parameters.values()
        # add parameters defined with the class
        for name in dir(self):
            item = getattr(self, name)
            if isinstance(item, Parameter):
                if item.name not in self._parameters:
                    parameters.append(item)
        return parameters
630253
def store(self, report, test_id):
        '''
        
        '''
        report_d = report.to_dict()
        content = self._serialize_dict(report_d)
        report_id = self.insert(
            ['test_id', 'content', 'status', 'reason'],
            [test_id, content, report.get_status(), report.get('reason')],
        )
        return report_id
475129
def getJsonData(self, params):
        
        try:
            return eval("self." + str(params['output_id']) + "(params)")
        except AttributeError:
            df = self.getData(params)
            if df is None:
                return None
            return df.to_dict(orient='records')
692203
def try_checkpoint_metadata(self, trial):
        
        if trial._checkpoint.storage == Checkpoint.MEMORY:
            logger.debug("Not saving data for trial w/ memory checkpoint.")
            return
        try:
            logger.debug("Saving trial metadata.")
            self._cached_trial_state[trial.trial_id] = trial.__getstate__()
        except Exception:
            logger.exception("Error checkpointing trial metadata.")
509056
def get_parameter(self, name):
        
        i = self.get_parameter_names(include_frozen=True).index(name)
        return self.get_parameter_vector(include_frozen=True)[i]
34827
def get_parameter_tbl(self, parameter):
        
        par = []
        for entry in parameter.findall('Entry'):
            instance = defaultdict(list)
            instance['Instance'] = entry.find('Instance').text.split()
            if entry.find('ProbTable') is None:
                instance['ValueTable'] = entry.find('ValueTable').text.split()
            else:
                instance['ProbTable'] = entry.find('ProbTable').text.split()
            par.append(instance)
        return par