AxModelManager#
- class optimas.utils.AxModelManager(source, varying_parameters=None, objectives=None, fit_out_of_design=False)#
Class for building and exploring GP models using an
AxClient.- Parameters:
- sourceAxClient, str or DataFrame
Source data for the model. It can be either an existing
AxClientwith a GP model, a string with the path to ajsonfile with a serializedAxClient, or a pandasDataFrame. When using aDataFrame, a list of objectives and varying parameters should also be provided.- objectiveslist of Objective, optional
Only needed if
sourceis a pandasDataFrame. List of objectives for which a GP model should be built. The names and data of these objectives must be contained in the sourceDataFrame.- varying_parameterslist of VaryingParameter, optional
Only needed if
sourceis a pandasDataFrame. List of parameters that were varied to scan the value of the objectives. The names and data of these parameters must be contained in the sourceDataFrame.- fit_out_of_designbool, optional
Whether to fit the surrogate model taking into account evaluations outside of the range of the varying parameters. This can be useful if the range of parameter has been reduced during the optimization. By default, False.
Methods
evaluate_model([sample, metric_name, ...])Evaluate the model over the specified sample.
get_best_evaluation([metric_name, ...])Get the best scoring point in the sample.
plot_contour([param_x, param_y, ...])Plot a 2D slice of the surrogate model.
plot_cross_validation([metric_name, ...])Make a cross-validation plot for the given metric.
plot_feature_importance([metric_name, ...])Plot the importance of each varying parameter for the given metric.
plot_slice([param_name, metric_name, ...])Plot a 1D slice of the surrogate model.