3. API pymetamodels (main class object)
Load main pymetamodels class as follow:
1import pymetamodels
2
3### Load main object
4mita = pymetamodels.metamodel()
5
6### Load main object (alternative)
7mita = pymetamodels.load()
and start building your metamodel and analysis
3.1. Class -> pymetamodels (functions)
3.2. Class -> pymetamodels
- class pymetamodels.metamodel[source]
Python class to perform design of experiments, analysis, metamodels and optimizations
- Platform:
Windows
- Synopsis:
object definition of optimization variables, read and save from Excel files, sensitivity analysis
- Dependences:
numpy, SALib, sklearn, scipy, xlrd, xlwt
- Variables:
case – global data object case
plt – object plot
- logging_start(logging_path)[source]
- Synopsis:
Initialize the logging to a external file named as logging_pymetamodels.log
- Args:
logging_path: the output folder path to the logging
- Optional parameters:
None
- Returns:
If the path exists
Note
See tutorials Tutorials
- keys()[source]
- Synopsis:
Return the list of names and id cases
- Args:
None
- Optional parameters:
None
- Returns:
List of names and id cases
Note
See tutorials Tutorials
- objconf()[source]
- Synopsis:
Return the objconf object for programatically build the configuration spreadsheet
- Args:
None
- Optional parameters:
None
- Returns:
objconf object
- obj_samplig_sensi()[source]
- Synopsis:
Return the objsamplingsensitivity object
- Args:
None
- Optional parameters:
None
- Returns:
objsamplingsensitivity object
Note
See tutorials Tutorials
- sensitivity_type(case)[source]
- Synopsis:
Returns the sensitivity type analysis
- Args:
None
- Optional parameters:
None
- Returns:
sensitivity type analysis name string
Note
See tutorials Tutorials
- run_sampling_routine(case)[source]
- Synopsis:
Execute the sampling routines to generate the DOEX for each case
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
None
Note
See tutorials Tutorials
The kind of sampling routines available specified metamodel configuration spreadsheet. See metamodel configuration spreadsheet
- run_sensitivity_analisis(case)[source]
- Synopsis:
Execute the sensitivity analysis routines to generate the sensitivity indexes S_i
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
None
Note
See tutorials Tutorials
The kind of sampling routines available specified metamodel configuration spreadsheet. See metamodel configuration spreadsheet
- run_sensitivity_normalization()[source]
- Synopsis:
Execute the normalization of the sensitivity indexes
- Args:
None
- Optional parameters:
None
- Returns:
Adds to the metamodel data structure the sensitivity indexes normalize
- run_metamodel_construction(case, scheme=None, with_test=True)[source]
- Synopsis:
Execute the metamodelling regression routines to generate a predictor of DOEY values
- Args:
case: case name to be execute
- Optional parameters:
scheme=None: designate the type of metamodel search scheme that will be carried out to find the most optimal ML metamolde. The available schemes are: None, general, general_fast, general_fast_nonpol, linear, gaussian, polynomial (see Section 2.3)
with_test = True: use doeX_test and doeY_test as test data, if not available split the train data into split and train data (by 0.35)
- Returns:
None
Note
See tutorials Tutorials and tutorial A3
The kind metamodel configuration spreadsheet. See metamodel configuration spreadsheet
The data object structure can be seen in objmetamodel()
- obj_metamodel(case)[source]
- Synopsis:
Returns a data structure object correspoding to the train metamodel object (see objmetamodel())
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
Pointer to data structure object correspoding to the objmetamodel()
Note
See tutorials Tutorials and tutorial A2
The data object structure can be seen in objmetamodel()
- save_metamodel(folder_path, case)[source]
- Synopsis:
Save metamodels objects as a .metaita file which can be later read
.metaita files are placed in a sub-folder of the output folder
- Args:
folder_path: path to the folder where to save the files
case: case name to be execute
- Optional parameters:
None
- Returns:
Path to the file
Note
See tutorials Tutorials
Relates to save_to_file()
- load_metamodel(folder_path, case)[source]
- Synopsis:
Load metamodels object as a .metaita file for each case with the function save_metamodel()
- Args:
folder_path: path to the folder where to save the files
case: case name to be execute
- Optional parameters:
None
- Returns:
True if the metamodel was loaded
Note
See tutorials Tutorials
Relates to save_metamodel()
- obj_optimization(case)[source]
- Synopsis:
Returns a data structure object correspoding to the optimization object (see objoptimization())
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
Pointer to data structure object correspoding to the objoptimization()
Note
See tutorials Tutorials and tutorial A06
The data object structure can be seen in objoptimization()
- save_optimization(folder_path, case)[source]
- Synopsis:
Save the optimization data as a .optita file which can be later read
.optita files are placed in a sub-folder of the output folder
- Args:
folder_path: path to the folder where to save the files
case: case name to be execute
- Optional parameters:
None
- Returns:
Path to the file
Note
See tutorials Tutorials
Relates to save_to_file()
- load_optimization(folder_path, case)[source]
- Synopsis:
Load optimization object as a .optita file for each case
- Args:
folder_path: path to the folder where to save the files
case: case name to be execute
- Optional parameters:
None
- Returns:
True if the optimization was loaded
Note
See tutorials Tutorials
Relates to save_optimization()
- run_optimization_problem(case, scheme=None, max_size_grid_methods=None, rel_tol_val_grid_methods=None, verbose_testing=False)[source]
- Synopsis:
Execute optimization problem routines for a case according the configuration spreadsheet
- Args:
case: case name to be execute
- Optional parameters:
scheme = None: designate the type of optimization solver scheme that will be carried out (see Section 2.4). The availables schemes are: “general”, “general_fast”, “general_with_constrains”, “global”, “minimize”, “grid_method”, “iter_grid_method”
max_size_grid_methods = None: value for max_size_grid_methods ivar, diemsion of the grid for grid methods
rel_tol_val_grid_methods = None: tolerance value for rel_tol_val_grid_methods ivar, tolerance of the iterative maximum error
verbose_testing = False: verbose routines messages
- Returns:
None
Note
See tutorials Tutorials and tutorial A06
The optimization configuration spreadsheet. See optimization configuration spreadsheet
The data object structure can be seen in objoptimization()
- print_structure(case=None)[source]
- Synopsis:
Recursively data object structure case and all the nested data objects dictionaries
- Args:
dictionary: dictionary object to recursively be printed
- Optional parameters:
case: case name to be execute, if None prints the full case object
- Returns:
None
Note
See tutorials Tutorials and tutorial A2
- vars_parameter_matrix(case)[source]
- Synopsis:
Returns a data structure object correspoding to the parameters values for each input variables from the metamodel configuration
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
Pointer to data structure object correspoding to the parameters values for each input variable from the metamodel configuration
Note
See tutorials Tutorials and tutorial A2
The data object structure can be seen using the function print_dict()
- vars_out_parameter_matrix(case)[source]
- Synopsis:
Returns a data structure object correspoding to the parameters values for each output variables from the metamodel configuration
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
Pointer to data structure object correspoding to the parameters values for each output variable from the metamodel configuration
Note
See tutorials Tutorials and tutorial A2
The data object structure can be seen using the function print_dict()
- doeX(case)[source]
- Synopsis:
Returns a data structure object correspoding to the DOEX inputs variable arrays
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
Pointer to data structure object correspoding to the DOEX
Note
See tutorials Tutorials and tutorial A2
The data object structure can be seen using the function print_dict()
- doeY(case)[source]
- Synopsis:
Returns a data structure object correspoding to the DOEY output variables arrays
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
Pointer to data structure object correspoding to the DOEY
Note
See tutorials Tutorials and tutorial A2
The data object structure can be seen using the function print_dict()
- SiY(case)[source]
- Synopsis:
Returns a data structure object correspoding to the results for the sensitivity analysis values
- Args:
case: case name to be execute
- Optional parameters:
None
- Returns:
Pointer to data structure object correspoding to the results for the sensitivity analysis values
Note
See tutorials Tutorials and tutorial A2
The data object structure can be seen using the function print_dict()
- read_xls_case(folder_path, file_name, sheet='cases', col_start=0, row_start=1, tit_row=0)[source]
- Synopsis:
Read metamodel configuration spreadsheet in xls format
- Args:
folder_path: path to xls spreadsheet
file_name: xls spreadsheet file name
sheet: sheet name with the cases description
- Optional parameters:
col_start = 0: the columm number where the data starts
row_start = 1: the row number where the data starts
tit_row = 0: the row number where the titles start
- Returns:
None
Note
See tutorials Tutorials
Template of a metamodel configuration spreadsheet in xls format
Download template
- output_xls(folder_path, file_name, col_start=0, tit_row=0)[source]
- Synopsis:
Output DOEX, DOEY and analysis data into a spreadsheet in xls format
- Args:
folder_path: path to xls spreadsheet
file_name: xls spreadsheet file name
- Optional parameters:
col_start = 0: the columm number where the data starts
row_start = 1: the row number where the data starts
- Returns:
The path to the xls spreadsheet
Note
See tutorials Tutorials
It is limit to DOE with a maximun size of 65500 samples. For larger values save directly to csv
- save_tofile_DOEX(folder_path, file_name)[source]
- Synopsis:
Save DOEX into a spreadsheet in xls format
- Args:
folder_path: path to xls spreadsheet
file_name: xls spreadsheet file name
- Optional parameters:
None
- Returns:
The path to the xls spreadsheet
Note
See tutorials Tutorials. See tutorial A09
It is limit to DOE with a maximun size of 65500 samples. For larger values save directly to csv
It can be read with the function read_fromfile_DOEX()
- read_fromfile_DOEX(folder_path, file_name)[source]
- Synopsis:
Read DOEX from a spreadsheet in xls format
- Args:
folder_path: path to xls spreadsheet
file_name: xls spreadsheet file name
- Optional parameters:
None
- Returns:
The path to the xls spreadsheet
Note
See tutorials Tutorials. See tutorial A09
It is limit to DOE with a maximun size of 65500 samples. For larger values save directly to csv
It read formats saved with save_tofile_DOEX()
- save_tofile_DOEY(folder_path, file_name)[source]
- Synopsis:
Save DOEY into a spreadsheet in xls format
- Args:
folder_path: path to xls spreadsheet
file_name: xls spreadsheet file name
- Optional parameters:
None
- Returns:
The path to the xls spreadsheet
Note
See tutorials Tutorials. See tutorial A09
It is limit to DOE with a maximun size of 65500 samples. For larger values save directly to csv
It can be read with the function read_fromfile_DOEY()
- read_fromfile_DOEY(folder_path, file_name)[source]
- Synopsis:
Read DOEY from a spreadsheet in xls format
- Args:
folder_path: path to xls spreadsheet
file_name: xls spreadsheet file name
- Optional parameters:
None
- Returns:
The path to the xls spreadsheet
Note
See tutorials Tutorials. See tutorial A09
It is limit to DOE with a maximun size of 65500 samples. For larger values save directly to csv
It read formats saved with save_tofile_DOEY()
- output_plts_sensitivity(folder_path, case, use_alias_as_vars=False)[source]
- Synopsis:
Plots all cross DOEX variable sampling combinations and sensitivity analisys
Plots sensitivity histograms for each case
Plots are placed in a sub-folder of the output folder
- Args:
folder_path: path to the folder where to save the plots images
case: case name to be execute
- Optional parameters:
use_alias_as_vars: use alias names as variable names
- Returns:
Saves in the folder_path location the plots regarding the sensitivity analysis
Note
See tutorials Tutorials or Tutorial A01
The kind of sampling routines available specified metamodel configuration spreadsheet. See metamodel configuration spreadsheet
- output_plts_models_XY(folder_path, case, use_alias_as_vars=False)[source]
- Synopsis:
XY 2D scatter plots of the DOEY variables versus DOEX variables
Plots are placed in a sub-folder of the output folder
- Args:
folder_path: path to the folder where to save the plots images
case: case name to be execute
- Optional parameters:
use_alias_as_vars: use alias names as variable names
- Returns:
Saves in the folder_path location the plots regarding the XY plots of the DOEY variables versus DOEX variables
Note
See tutorials Tutorials or Tutorial A03
- output_plts_models_XYZ(folder_path, case, default_other_vars_level=0.5, text_annotation=True, scatter=False, use_alias_as_vars=False)[source]
- Synopsis:
XYZ 3D scatter plots of the DOEY variables versus DOEX variables
Plots are placed in a sub-folder of the output folder
- Args:
folder_path: path to the folder where to save the plots images
case: case name to be execute
- Optional parameters:
default_other_vars_level = 0.5: range fraction for non doeX X,Y variables
text_annotation = True: switch on and off the text annotation regarding default_other_vars_level
scatter = True: show scatter plot
use_alias_as_vars: use alias names as variable names
- Returns:
Saves in the folder_path location the plots regarding the XY plots of the DOEY variables versus DOEX variables
Note
Non X,Y plots variables values are compute according var default_other_vars_level
See tutorials Tutorials or Tutorial A03
- output_plts_models_residuals_plot(folder_path, case, use_alias_as_vars=False)[source]
- Synopsis:
XY 2D scatter plots of the residual values, DOEY varibles metamodel predictions ploted versus DOEY variable values
Plots are placed in a sub-folder of the output folder
- Args:
folder_path: path to the folder where to save the plots images
case: case name to be execute
- Optional parameters:
use_alias_as_vars: use alias names as variable names
- Returns:
Saves in the folder_path location the residual values, DOEY varibles predictions ploted versus DOEY variable values
Note
See tutorials Tutorials or Tutorial A03
3.3. Class -> objconf
Load the programmatically configuration spreadsheet builder as follows:
1import pymetamodels
2
3### Load main object (alternative)
4mita = pymetamodels.load()
5
6### Load objconf object
7conf = mita.objconf()
and start building your configuration spreadsheet
- class obj_conf.objconf(model)[source]
Python class to build programatically the configuration spreadsheet
- Platform:
Windows
- Synopsis:
to build programatically the pymetamodels configuration spreadsheet
- Dependences:
Excel©, xlrd, xlwt, numpy
- start(folder_path, file_name)[source]
- Synopsis:
Initialise the objconf with the file and path name
- Args:
folder_path: folder path
file_name: conf file name without extension
- Optional parameters:
None
- Returns:
None
Note
See tutorials Tutorials
- add_case(case_name, vars_sheet, output_sheet, samples, sensitivity_method, comment=None, others={}, force_overwrite=False)[source]
- Synopsis:
Adds a new entry to the cases sheet
- Args:
case_name: name and id of the case, is a unique key value
vars_sheet: name and id of the sheet where are described the input vars for the given case
output_sheet: name and id of the sheet where are described the output vars for the given case
samples: number of samples for the sampling activities (\(2^N \ values\))
sensitivity_method: name and id of the sensitivity analysis method (see Section 2.2)
- Optional parameters:
comment = None: comment for the given case
others = {}: dictionary with other variables
force_overwrite = False: force over writting case_name data
- Returns:
True if the action was possible, False if the key case_name already exist
Note
See tutorials Tutorials
See the configurations spread sheet description Configuration spreadsheet
- add_vars_sheet_variable(vars_sheet, variable, value, min, max, distribution, is_range, cov_un, ud, alias, comment=None, others={}, force_overwrite=False)[source]
- Synopsis:
Adds a new entry to the input variable to the vars_sheet
- Args:
vars_sheet: name and id of the sheet where are described the input vars for the given case
variable: name and id of the input variable, is a unique key value
value: nominal value of the input variable, use in case is not considered a ranged variable in the DOEX
min: min value of the ranged variable in the DOEX
max: max value of the ranged variable in the DOEX
distribution: type of range distribution (unif, triang, norm, lognorm)
is_range: TRUE or FALSE value to choose if the variable is a range or a single value in the DOEX
cov_un: covariance used for the generation of the norm distributions
ud: units name for the variable (i.e. [m])
alias: alias name for the variable
- Optional parameters:
comment = None: comment for the given case
others = {}: dictionary with other variables
force_overwrite = False: force over writting variable data
- Returns:
None
Note
See tutorials Tutorials
See the configurations spread sheet description Configuration spreadsheet
- add_output_sheet(output_sheet, variable, value, ud, array, op_min, op_min_0, ineq_0, eq_0, alias, comment=None, others={}, force_overwrite=False)[source]
- Synopsis:
Adds a new entry to the output vars case sheet
- Args:
output_sheet: name and id of the sheet where are described the output vars for the given case
variable: name and id of the output variable, is a unique key value
value: nominal value of the output variable
ud: units name for the variable (i.e. [m])
array: TRUE or FALSE, is the output variable an array or single value
op_min: TRUE if variable is to be minimize, \(min(DOEY_{var})\)
op_min_0: TRUE if variable is to be optimize to 0, \(objective(DOEY_{var}=0)\)
ineq_0: TRUE if variables is consider for an inequality constrain, \(DOEY_{var}>=0\)
eq_0: TRUE if variables is consider for an equality constrain =0, \(DOEY_{var}=0\)
alias: alias name for the variable
- Optional parameters:
comment = None: comment for the given case
others = {}: dictionary with other variables
force_overwrite = False: force over writting variable data
- Returns:
None
Note
See tutorials Tutorials
See the configurations spread sheet description Configuration spreadsheet
- check_consistency()[source]
- Synopsis:
Check consistency between cases, the input vars case sheet and the output vars case sheet
- Args:
None
- Optional parameters:
None
- Returns:
True if pass or list of text messages
Note
See tutorials Tutorials
See the configurations spread sheet description Configuration spreadsheet
- save_conf()[source]
- Synopsis:
Save the configuration to a file
- Args:
None
- Optional parameters:
None
- Returns:
True or False if errors
Note
See tutorials Tutorials
See the configurations spread sheet description Configuration spreadsheet
- read_xls_sheet_to_dict(folder_path, file_name, sheet_name, col_start=0, row_title=0, units=False)[source]
- Synopsis:
Load excel sheet (in .xls format) into a dictionary of arrays
The format is each column is a data channel or array of data
First row is the channel names
Second row is the units names
- Args:
folder_path: the folder path name
file_name: file name of the coupons file (type xls)
sheet_name: sheet name with the channel list or array of data
- Optional parameters:
col_start = 0: first column
row_title = 0: first row
units = False: does the sheet con tain a second row of units
- Returns:
(dct, dct_units): (dictionary, dictionary of units)
Note
None
- save_dict_to_xls_sheet(folder_path, file_name, sheet_name, data_dict, col_start=0, row_title=0, dict_units=None, add_row_under_units=None, overwrite=True)[source]
- Synopsis:
Save a dictionary of arrays (see read_xls_sheet_to_dict()) into a excel sheet (in .xls format)
The format is each column is a data channel or array of data
First row is the channel names
Second row is the units names
- Args:
folder_path: the folder path name
file_name: file name of the coupons file (type xls)
sheet_name: sheet name with the channel list or array of data
data_dict: dictionary of units per channel
- Optional parameters:
col_start = 0: first column
row_title = 0: first row
dict_units = None:
add_row_under_units = None: value of a third row under the units
overwrite = True: overwrites the file creating a new one with the same name or updates the file if it exists
- Returns:
None
Note
None
3.4. Class -> objsamplingsensitivity
Access to the sampling and sensitivity object:
1import pymetamodels
2
3### Load main object (alternative)
4mita = pymetamodels.load()
5
6### Load obj_samplig_sensi object
7conf = mita.obj_samplig_sensi()
- class obj_sampling_sensitivity.objsamplingsensitivity(model)[source]
Python class representing the sampling and sensitivity analysis
- Platform:
Windows
- Synopsis:
object optimization calculation
- Dependences:
SALib
- Variables:
version – optimization model version
conf_level – the confidence interval level (default 0.95)
Note
See tutorials Tutorials
3.5. Class -> objmetamodel
Represent the metamodel constructed with the DOEX and DOEY for each case and predict new values.
- class obj_metamodel.objmetamodel(logging_path=None)[source]
Python class representing a metamodel object train with doeX and doeY data
- Platform:
Windows
- Synopsis:
object train with doeX and doeY data
- Dependences:
numpy, sklearn
- Variables:
tol – (default 0.0001) metamodel training tolerance
eps – (default 0.0001) metamodel training eps value for
n_alphas – (default 200) metamodel training eps value for
random_state – (default True) activate the random state generation (bool)
Note
The training is based on kriging, polynomial and regressor methods
See tutorials Tutorials and for example tutorial A3
- save_to_file(folder, file_name)[source]
- Synopsis:
Save the metamodel object to a file with .metaita extension
- Args:
folder: folder path
file_name: file name
- Optional parameters:
None
- Returns:
The file path
Note
See tutorials Tutorials
- load_file(file_path)[source]
- Synopsis:
Loads the metamodel object from a file with .metaita extension
- Args:
file_path: path to the file
- Optional parameters:
None
- Returns:
None
Note
See tutorials Tutorials
- fit_model(doeX_train, doeY_train, var_keysX, var_keysY, doeX_test=None, doeY_test=None, scheme=None, with_test=True)[source]
- Synopsis:
Execute the metamodelling regression fitting routines to generate a predictor of DOEY values choosing the best ME model
- Args:
doeX_train: numpy array representing the doeX (nsamplesxnfeatures) for performing the training
doeY_train: numpy array representing the doeY (ntargetsxnfeatures) for performing the training
var_keysX: list of doeX variable names
var_keysY: list of doeY variable names
- Optional parameters:
doeX_test = None: numpy array representing the doeX (nsamplesxnfeatures) for performing the evaluation
doeY_test = None: numpy array representing the doeY (ntargetsxnfeatures) for performing the evaluation
scheme: designate the type of metamodel search scheme that will be carried out to find the most optimal ML metamolde. The available schemes are: None, general, general_fast, general_fast_nonpol, linear, gaussian, polynomial (see Section 2.3)
with_test = True: use doeX_test and doeY_test as test data, if not available split the train data into split and train data (by 0.35)
- Returns:
None
Note
See tutorials Tutorials and tutorial A3
The kind of sampling routines available specified metamodel configuration spreadsheet. See metamodel configuration spreadsheet
- predict(doeX_predict)[source]
- Synopsis:
Execute the metamodelling regression fitting routines to generate a predictor of DOEY values choosing the best modelling strategy
- Args:
doeX_predict: numpy array representing the doeY (ntargetsxnfeatures) for performing the prediction
- Optional parameters:
None
- Returns:
None
Note
See tutorials Tutorials and tutorial A3
- predict_1D(var_target, lst_var_features)[source]
- Synopsis:
Execute the metamodelling regression fitting routines to generate a predictor of DOEY values choosing the best modelling strategy
Data is input as a 1D list of varibles values
- Args:
var_target: var name to predict the value
lst_var_features: list of values ordered as varX labels
- Optional parameters:
None
- Returns:
Prediction for var_target
Note
See tutorials Tutorials and tutorial A3
- score_doeY_target(doeX_test, doeY_test, var_target)[source]
- Synopsis:
Execute the regression of the origin values versus predicted ones
Obtains the regression score of the var_target prediction
- Args:
doeX_test = None: numpy array representing the doeX (nsamplesxnfeatures) for performing the evaluation
doeY_test = None: numpy array representing the doeY (ntargetsxnfeatures) for performing the evaluation
var_target: var name to predict the value
- Optional parameters:
None
- Returns:
(varY_predict, varY_values, score, varY_predict_line)
varY_predict: var_target array predicted values
varY_values: var_target values
score: score of var_target array predicted values versus var_target values regression
varY_predict_line: var_target array predicted values with line regression
Note
See tutorials Tutorials and tutorial A3
- property doeX_np_shape
Shape of the trained doeX
- Getter:
Returns train doeX shape
- Type:
tuple
- property doeY_np_shape
Shape of the trained doeY
- Getter:
Returns train doeY shape
- Type:
tuple
- property doeX_varX
List of var names corresponding to the trained doeX
- Getter:
Returns list of var names corresponding to the trained doeX
- Type:
tuple
- property doeY_varY
List of var names corresponding to the trained doeY
- Getter:
Returns list of var names corresponding to the trained doeY
- Type:
tuple
- property metamodel_score
Metamodel score value
- Getter:
Returns the metamodel score value
- Type:
float
3.6. Class -> objoptimization
Represent the optimization problem solution based on a constructed metamodel.
- class obj_optimization.objoptimization(logging_path=None)[source]
Python class representing the optimization calculation
- Platform:
Windows
- Synopsis:
object optimization calculation
- Dependences:
numpy, scipy
- Variables:
version – optimization model version
tol – (default 1e-6) optimization methods tolerance value
rel_tol_val_grid_methods – (default 5e-4) optimization grid methods tolerance value
max_size_grid_methods – (default 5e-3) optimization grid methods max size of the grid
tolerance_check_bounds_constrains – (default 1e-3) tolerance to check bounds and contrains limits
Note
See tutorials Tutorials and for example tutorial A06
- property min_fun
Min value of objective function found
- Getter:
Returns Min value of objective function found
- Type:
float
- property DOEX_min_func
DOEX array of Min value of objective function
- Getter:
Returns DOEX array of Min value of objective function
- Type:
array
- property min_func_model
Optimization model use for Min value of objective function
- Getter:
Returns Optimization model
- Type:
string
- property DOEY_min_func
DOEY array of Min value of objective function
- Getter:
Returns DOEY array of Min value of objective function
- Type:
array
- property doeX_varX
List of var names corresponding to the optimized doeX
- Getter:
Returns list of var names corresponding to the optimized doeX
- Type:
tuple
- property doeY_varY
List of var names corresponding to the optimized doeY
- Getter:
Returns list of var names corresponding to the optimized doeY
- Type:
tuple
- save_to_file(folder, file_name)[source]
- Synopsis:
Save the optimization data to a file with .optita extension
- Args:
folder: folder path
file_name: file name
- Optional parameters:
None
- Returns:
The file path
Note
See tutorials Tutorials
- load_file(file_path)[source]
- Synopsis:
Loads the optimization data to a file with .optita extension
- Args:
file_path: path to the file
- Optional parameters:
None
- Returns:
None
Note
See tutorials Tutorials
- run_optimization(obj_metamodel, min_vars, type_op_min, bounds, constrains_vars=None, scheme=None)[source]
- Synopsis:
Execute the optimization routines to minimize a DOEY metamodel variable
- Args:
obj_metamodel: metamodel object
min_var: variable to be minimize
type_op_min: type variable to be minimize 1: minimize 2:equal to zero
bounds: DOEX variables bounds
- Optional parameters:
constrains_vars = None:
scheme=None: scheme method to be applied. The availables schemes are: “general”, “general_fast”, “general_with_constrains”, “global”, “minimize”, “grid_method”, “iter_grid_method”
- Returns:
None
Note
See tutorials Tutorials and tutorial A06
The kind of sampling routines available specified metamodel configuration spreadsheet. See metamodel configuration spreadsheet