Generator.generate

Generator.generate(request: Dict[str, int | float | bool | str | List] | None = None, y_req: List[int | float | bool | str | List] | None = None, attributes: List[str] | None = None, weights: Dict[str, int | float | bool | str | List] | None = None, format_out: str = 'df', n_samples: int = 50, print_results: bool = True, analyzer: AnalysisCallback | None = None, **kwargs) Tuple[Dict | List | DataFrame, Dict[str, Dict]][source]

Wrapper method to call the generation process. It takes care of adapting the request, running the generator, and then providing the output in the specified format. Some of the options are simplified, as this is the function exposed to the user. For example, we assume the values are requested in the original domain, and that we are performing a single request. To run more specific generation process, it is better to use .run method.

Parameters:
  • self (object) – The instance of the class containing this method.

  • request (Dict[str, Union[int, float, bool, str, List]], optional, default=None) – A dictionary with the attributes and values requested for generation. If provided, the y_req and attributes parameters are ignored.

  • y_req (List[int, float, bool, str, List[int, float, bool, str]], optional, default=None) – The values requested for each of the attributes specified. Depending on the type of attribute, we can have to provide an specific type. Besides, if we want to generate in an interval, we can alternatively provide a List.

  • attributes (List[str], optional, default=None) – The list of attribute names used to run the generative process.

  • weights (Dict[str, Union[int, float, bool, str, List]], optional, default=None) – To assign different weighting to each attribute, when selecting the best instances

  • format_out (str, optional, default=None) – The format of the output. The options are: “dict”, “dict_list”, “array”, “torch”, “list”, “df_per_obj”, “df”. If not provided, the output will be a dictionary with all the information gathered from the generation process.

  • n_samples (int, optional, default=50) – The number of samples of design parameters to generate.

  • print_results (bool, optional, default=True) – Print an overview of the samples generated, and the errors computed.

  • analyzer (AnalysisCallback, optional, default=None) – If provided, the generator will use the analyzer to compute the ground truth values. This is only possible when the InputML and OutputML are aligned with the DesignParameters and the PerformanceAttributes. If not, these values won’t be computed.

Returns:

  • Tuple[Union[Dict, List, pd.DataFrame] – The dataframe with the combined inputML and outputML data, in the format specified by format_out.

  • Dict[str, Dict]] – This dictionary contains all the information gathered from the generation process. Hence, it can be used in other methods, from plotting, to computing errors, etc.