nextorch.plotting¶
Creates 1-dimensional, 2-dimensional and 3-dimensional visualizations The plots are rendered using matplotlib as a backend
- nextorch.plotting.acq_func_1d(acq_func: botorch.acquisition.acquisition.AcquisitionFunction, X_test: Union[list, nextorch.utils.Matrix, torch.Tensor], n_dim: Optional[int] = 1, X_ranges: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, x_index: Optional[int] = 0, X_train: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_names: Optional[str] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Plot 1-dimensional acquision function at the given dimension defined by x_index
- Parameters
acq_func ('botorch.acquisition.AcquisitionFunction'_) – the acquision function object
X_test (MatrixLike2d) – Test data points for plotting
n_dim (Optional[int], optional) – Dimensional of X, i.e., number of columns by default 1
X_ranges (Optional[MatrixLike2d], optional) – list of x ranges, by default None
x_index (Optional[int], optional) – index of the x variable, by default 0
X_train (Optional[MatrixLike2d], optional) – Training data points, by default None
X_new (Optional[MatrixLike2d], optional) – The next data point, i.e the infill points, by default None
X_names (Optional[str], optional) – Name of X varibale shown as x-label
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[Union[str, int]], optional) – Iteration index to add to the figure name by default ‘’
.._'botorch.acquisition.AcquisitionFunction' (https://botorch.org/api/acquisition.html) –
- nextorch.plotting.acq_func_1d_exp(Exp: nextorch.bo.Experiment, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, x_index: Optional[int] = 0, fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = None, fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = None, baseline: Optional[str] = 'left', mesh_size: Optional[int] = 41, save_fig: Optional[bool] = False)¶
Plot 1-dimensional acquision function at the given dimension defined by x_index Using Experiment object
- Parameters
Exp (Experiment) – Experiment object
X_new (Optional[MatrixLike2d], optional) – The next data point, i.e the infill points, by default None
x_index (Optional[int], optional) – index of two x variables, by default 0
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default None
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default None
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
mesh_size (int, optional) – mesh size, by default 41
- nextorch.plotting.add_x_slice_2d(ax: matplotlib.axes._axes.Axes, xvalue: float, yrange: List[float], zrange: List[float], mesh_size: Optional[int] = 100) matplotlib.axes._axes.Axes ¶
Adds a 2-dimensional plane on x axis, parallel to y-z plane in the 3-dimensional (x, y, z) space
- Parameters
ax (`matplotlib.axes.Axes.axis`_) – Ax of the plot
xvalue (float) – the value on x axis which the slice is made
yrange (list of float) – [left bound, right bound] of y value
zrange (list of float) – [left bound, right bound] of z value
mesh_size (Optional[int], optional) – mesh size on the slice, by default 100
- Returns
ax (`matplotlib.axes.Axes.axis`_) – Axes of the plots
.. _`matplotlib.axes.Axes.axis` (https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.axis.html)
- nextorch.plotting.add_y_slice_2d(ax: matplotlib.axes._axes.Axes, yvalue: float, xrange: List[float], zrange: List[float], mesh_size: Optional[int] = 100) matplotlib.axes._axes.Axes ¶
Adds a 2-dimensional plane on y axis, parallel to x-z plane in the 3-dimensional (x, y, z) space
- Parameters
ax (`matplotlib.axes.Axes.axis`_) – Ax of the plot
yvalue (float) – the value on y axis which the slice is made
xrange (list of float) – [left bound, right bound] of x value
zrange (list of float) – [left bound, right bound] of z value
mesh_size (Optional[int], optional) – mesh size on the slice, by default 100
- Returns
ax (`matplotlib.axes.Axes.axis`_) – Axes of the plots
.. _`matplotlib.axes.Axes.axis` (https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.axis.html)
- nextorch.plotting.add_z_slice_2d(ax: matplotlib.axes._axes.Axes, zvalue: float, xrange: List[float], yrange: List[float], mesh_size: Optional[int] = 100) matplotlib.axes._axes.Axes ¶
Adds a 2-dimensional plane on z axis, parallel to x-y plane in the 3-dimensional (x, y, z) space
- Parameters
ax (`matplotlib.axes.Axes.axis`_) – Ax of the plot
zvalue (float) – the value on z axis which the slice is made
xrange (list of float) – [left bound, right bound] of x value
yrange (list of float) – [left bound, right bound] of y value
mesh_size (Optional[int], optional) – mesh size on the slice, by default 100
- Returns
ax (`matplotlib.axes.Axes.axis`_) – Axes of the plots
.. _`matplotlib.axes.Axes.axis` (https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.axis.html)
- nextorch.plotting.objective_heatmap(objective_func: object, X_ranges: Union[list, nextorch.utils.Matrix, torch.Tensor], Y_name: Optional[str] = None, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], X_names: Optional[List[str]] = None, X_train: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, baseline: Optional[str] = 'left', mesh_size: Optional[int] = 41, save_fig: Optional[bool] = False, name: Optional[str] = 'simple_experiment')¶
Show a 3-dimensional response surface in a real scale Using the experiment object
- Parameters
objective_func (function object) – a objective function to optimize
X_ranges (MatrixLike2d,) – list of x ranges
Y_name (Optional[str], optional) – Name of Y variable, by default None
Y_real_range (Optional[ArrayLike1d], optional) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default []
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default []
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
X_name (Optional[List(str)], optional) – Names of X varibale shown as x,y,z-labels by default None
X_train (Optional[MatrixLike2d], optional) – Data points used in training, by default None
X_new (Optional[MatrixLike2d], optional) – The next data point, i.e the infill points, by default None
mesh_size (Optional[int], optional) – mesh size, by default 41
save_fig (Optional[bool], optional) – if true save the plot by default False
name (Optional[str], optional) – Name of the objective function, by default ‘simple_experiment’
- nextorch.plotting.objective_heatmap_exp(Exp: nextorch.bo.Experiment, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], baseline: Optional[str] = 'left', mesh_size: Optional[int] = 41, show_samples: Optional[bool] = True, save_fig: Optional[bool] = False)¶
Show a heat map for objective function in a real scale Using the experiment object :param Exp: Experiment object :type Exp: Experiment :param X_new: The next data point, i.e the infill points,
by default None
- Parameters
Y_real_range (Optional[ArrayLike1d], optional) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default []
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default []
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
mesh_size (Optional[int], optional) – mesh size, by default 41
show_samples (Optional[bool], optional) – if true show the sample points by default True
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.objective_surface(objective_func: object, X_ranges: Union[list, nextorch.utils.Matrix, torch.Tensor], Y_name: Optional[str] = None, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], baseline: Optional[str] = 'left', X_names: Optional[List[str]] = None, mesh_size: Optional[int] = 41, save_fig: Optional[bool] = False, name: Optional[str] = 'simple_experiment')¶
Show a 3-dimensional response surface in a real scale Using the experiment object
- Parameters
objective_func (function object) – a objective function to optimize
X_ranges (MatrixLike2d,) – list of x ranges
Y_name (Optional[str], optional) – Name of Y variable, by default None
Y_real_range (Optional[ArrayLike1d], optional) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default []
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default []
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
X_name (Optional[List(str)], optional) – Names of X varibale shown as x,y,z-labels by default None
mesh_size (Optional[int], optional) – mesh size, by default 41
save_fig (Optional[bool], optional) – if true save the plot by default False
name (Optional[str], optional) – Name of the objective function, by default ‘simple_experiment’
- nextorch.plotting.objective_surface_exp(Exp: nextorch.bo.Experiment, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], baseline: Optional[str] = 'left', mesh_size: Optional[int] = 41, save_fig: Optional[bool] = False)¶
Show a 3-dimensional response surface in a real scale Using the experiment object
- Parameters
Exp (Experiment) – Experiment object
Y_real_range (Optional[ArrayLike1d], optional) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default []
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default []
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
mesh_size (Optional[int], optional) – mesh size, by default 41
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.opt_per_trial(Ys: Union[list, nextorch.utils.Array, torch.Tensor], maximize: Optional[bool] = True, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, Y_name: Optional[str] = None, log_flag: Optional[bool] = False, design_names: Optional[Union[str, List[str]]] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None)¶
Discovery plot show the optimum value performance versus the trial number i.e. the index of training data
- Parameters
Ys (Union[list, ArrayLike1d]) – Response of each design in a real scale
maximize (Optional[bool], optional) – by default True, maximize the objective function Otherwise False, minimize the objective function
Y_real_range (ArrayLike1d) – Ranges of the response, [lb, rb] to show on the plot, by default None
Y_name (Optional[str], optional) – Name of Y variable, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale, by default False
design_names (Optional[List[str]], optional) – Names of the designs, by default None
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
- nextorch.plotting.opt_per_trial_exp(Exp: nextorch.bo.Experiment, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, save_fig: Optional[bool] = False)¶
Discovery plot show the optimum value performance versus the trial number i.e. the index of training data Using the experiment object
- Parameters
Exp (Experiment) – Experiment object
Y_real_range (ArrayLike1d) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale, by default False
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.pareto_front(y1: Union[list, nextorch.utils.Matrix, torch.Tensor], y2: Union[list, nextorch.utils.Matrix, torch.Tensor], Y_names: Optional[List[str]] = None, fill: Optional[bool] = True, diagonal: Optional[bool] = True, save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Plot parity plot comparing the ground true objective function values against predicted model mean
- Parameters
y1 (MatrixLike2d) – Ground truth values
y2 (MatrixLike2d) – Model predicted values
fill (Optional[bool], optional) – if true fill the space enclosed by the points by default True
diagonal (Optional[bool], optional) – if true plot the y = x line by default True
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[Union[str, int]], optional) – Iteration number to add to the figure name by default ‘’
- nextorch.plotting.pareto_front_exp(Exp: Union[nextorch.bo.WeightedMOOExperiment, nextorch.bo.EHVIMOOExperiment], fill: Optional[bool] = True, diagonal: Optional[bool] = True, save_fig: Optional[bool] = False, design_name: Optional[Union[str, int]] = 'final')¶
Plot parity plot comparing the ground true objective function values against predicted model mean Using MOOExperiment object
- Parameters
Exp (Union[WeightedMOOExperiment, EHVIMOOExperiment]) – MOOExperiment object
fill (Optional[bool], optional) – if true fill the space enclosed by the points by default True
diagonal (Optional[bool], optional) – if true plot the y = x line by default True
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
design_name (Optional[Union[str, int]], optional) – Design name to add to the figure name by default ‘final’
- nextorch.plotting.parity(y1: Union[list, nextorch.utils.Matrix, torch.Tensor], y2: Union[list, nextorch.utils.Matrix, torch.Tensor], save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Plot parity plot comparing the ground true objective function values against predicted model mean
- Parameters
y1 (MatrixLike2d) – Ground truth values
y2 (MatrixLike2d) – Model predicted values
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[Union[str, int]], optional) – Iteration number to add to the figure name by default ‘’
- nextorch.plotting.parity_exp(Exp: nextorch.bo.Experiment, save_fig: Optional[bool] = False, design_name: Optional[Union[str, int]] = 'final')¶
Plot parity plot comparing the ground true objective function values against predicted model mean Using Experiment object
- Parameters
- nextorch.plotting.parity_with_ci(y1: Union[list, nextorch.utils.Matrix, torch.Tensor], y2: Union[list, nextorch.utils.Matrix, torch.Tensor], y2_lower: Union[list, nextorch.utils.Matrix, torch.Tensor], y2_upper: Union[list, nextorch.utils.Matrix, torch.Tensor], save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Plot parity plot comparing the ground true objective function values against predicted model mean with predicted confidence interval as error bars
- Parameters
y1 (MatrixLike2d) – Ground truth values
y2 (MatrixLike2d) – Model predicted values
y2_lower (MatrixLike2d) –
y2_upper (MatrixLike2d) –
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[Union[str, int]], optional) – Iteration number to add to the figure name by default ‘’
- nextorch.plotting.parity_with_ci_exp(Exp: nextorch.bo.Experiment, save_fig: Optional[bool] = False, design_name: Optional[Union[str, int]] = 'final')¶
Plot parity plot comparing the ground true objective function values against predicted model mean with predicted confidence interval as error bars Using Experiment object
- Parameters
- nextorch.plotting.response_1d(model: botorch.models.model.Model, X_test: Union[list, nextorch.utils.Matrix, torch.Tensor], n_dim: Optional[int] = 1, X_ranges: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, x_index: Optional[int] = 0, Y_test: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_train: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_train: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, negate_Y: Optional[bool] = False, plot_real: Optional[bool] = False, Y_mean: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_std: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_names: Optional[str] = None, Y_name: Optional[str] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Plot response values at the given dimension defined by x_index Input X variables are in a unit scale and Input Y variables are in a real scale
- Parameters
model ('botorch.models.model.Model'_) – A GP model
X_test (MatrixLike2d) – Test data points for plotting
n_dim (Optional[int], optional) – Dimensional of X, i.e., number of columns by default 1
X_ranges (Optional[MatrixLike2d], optional) – list of x ranges, by default None
x_index (Optional[int], optional) – index of the x variable, by default 0
Y_test (Optional[MatrixLike2d], optional) – Test Y data if the objective function is known, by default None
X_train (Optional[MatrixLike2d], optional) – Training X data points, by default None
Y_train (Optional[MatrixLike2d], optional) – Training Y data points, by default None
X_new (Optional[MatrixLike2d], optional) – The next X data point, i.e the infill points, by default None
Y_new (Optional[MatrixLike2d], optional) – The next Y data point, i.e the infill points, by default None
plot_real (Optional[bool], optional) – if true plot in the real scale for Y, by default False
Y_mean (MatrixLike2d) – The mean of initial Y set
Y_std (MatrixLike2d) – The std of initial Y set
X_names (Optional[str], optional) – Name of X varibales shown as x-label
Y_name (Optional[str], optional) – Name of Y varibale shown as y-label
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[str], optional) – Iteration number to add to the figure name by default ‘’
- Raises
ValueError – if X_train is provided but Y_train is not
ValueError – if X_new is provided but Y_new is not
ValueError – if plot in the real scale but Y_mean or Y_std is not provided
:_'botorch.models.model.Model' – https://botorch.org/api/models.html:
- nextorch.plotting.response_1d_exp(Exp: nextorch.bo.Experiment, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, x_index: Optional[int] = 0, y_index: Optional[int] = 0, fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = None, fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = None, baseline: Optional[str] = 'left', mesh_size: Optional[int] = 41, plot_real: Optional[bool] = False, save_fig: Optional[bool] = False)¶
Plot reponse valus at the given dimension defined by x_index using Experiment object
- Parameters
Exp (Experiment) – Experiment object
X_test (MatrixLike2d) – Test X data points for plotting
Y_test (Optional[MatrixLike2d], optional) – Test Y data if the objective function is known, by default None
X_new (Optional[MatrixLike2d], optional) – The next X data point, i.e the infill points, by default None
Y_new (Optional[MatrixLike2d], optional) – The next Y data point, i.e the infill points, by default None
x_index (Optional[int], optional) – index of two x variables, by default 0
y_index (Optional[int], optional) – index of the y variables, by default 0
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default None
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default None
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
mesh_size (int, optional) – mesh size, by default 41
plot_real (Optional[bool], optional) – if true plot in the real scale for Y, by default False
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.response_heatmap(Y_real: Union[list, nextorch.utils.Matrix, torch.Tensor], Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, Y_name: Optional[str] = None, log_flag: Optional[bool] = False, n_dim: Optional[int] = 2, x_indices: Optional[List[int]] = [0, 1], X_ranges: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_names: Optional[List[str]] = None, X_train: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Show a heat map for the response in a real scale
- Parameters
Y_real (MatrixLike2d) – Response in a real scale
Y_real_range (ArrayLike1d) – Ranges of the response, [lb, rb] to show on the plot, by default None
Y_name (Optional[str], optional) – Names of Y variable, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale, by default False
n_dim (Optional[int], optional) – Dimensional of X, i.e., number of columns by default 2
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
X_ranges (Optional[MatrixLike2d], optional) – list of x ranges, by default None
X_name (Optional[List(str)], optional) – Names of X varibale shown as x,y,z-labels by default None
X_train (Optional[MatrixLike2d], optional) – Data points used in training, by default None
X_new (Optional[MatrixLike2d], optional) – The next data point, i.e the infill points, by default None
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[str], optional) – Iteration number to add to the figure name by default ‘’’
- nextorch.plotting.response_heatmap_err_exp(Exp: nextorch.bo.Experiment, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], baseline: Optional[str] = 'left', mesh_size: Optional[int] = 41, save_fig: Optional[bool] = False)¶
Show a heat map for percentage error (objective - response)/objective in a real scale Using the experiment object :param Exp: Experiment object :type Exp: Experiment :param X_new: The next data point, i.e the infill points,
by default None
- Parameters
Y_real_range (Optional[ArrayLike1d], optional) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default []
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default []
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
mesh_size (Optional[int], optional) – mesh size, by default 41
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.response_heatmap_exp(Exp: nextorch.bo.Experiment, X_new: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], baseline: Optional[str] = 'left', mesh_size: Optional[int] = 41, show_samples: Optional[bool] = True, save_fig: Optional[bool] = False)¶
Show a heat map for the response in a real scale Using the experiment object :param Exp: Experiment object :type Exp: Experiment :param X_new: The next data point, i.e the infill points,
by default None
- Parameters
Y_real_range (Optional[ArrayLike1d], optional) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default []
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default []
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
mesh_size (Optional[int], optional) – mesh size, by default 41
show_samples (Optional[bool], optional) – if true show the sample points by default True
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.response_scatter_exp(Exp: nextorch.bo.Experiment, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, Y_name: Optional[str] = None, n_dim: Optional[int] = 3, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1, 2], X_ranges: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_names: Optional[List[str]] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Plot a response surface in 3-dimensional space
- Parameters
Y_real_range (ArrayLike1d) – Ranges of the response, [lb, rb]
Y_name (Optional[str], optional) – Name of Y variable, by default None
n_dim (Optional[int], optional) – Dimensional of X, i.e., number of columns
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
X_ranges (MatrixLike2d, optional) – list of x ranges, by default None
X_names (Optional[List(str)], optional) – Names of X varibale shown as x,y,z-labels
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[str], optional) – Iteration number to add to the figure name by default ‘’’
- nextorch.plotting.response_surface(X1_test: Union[list, nextorch.utils.Matrix, torch.Tensor], X2_test: Union[list, nextorch.utils.Matrix, torch.Tensor], Y_real: Union[list, nextorch.utils.Matrix, torch.Tensor], Y_real_lower: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_real_upper: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, Y_name: Optional[str] = None, n_dim: Optional[int] = 2, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], X_ranges: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, X_names: Optional[List[str]] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None, i_iter: Optional[Union[str, int]] = '')¶
Plot a response surface in 3-dimensional space
- Parameters
X1_test (MatrixLike2d) – [description]
X2_test (MatrixLike2d) – [description]
Y_real (MatrixLike2d) – Response in a real scale
Y_real_lower (Optional[MatrixLike2d], optional) – Model predicted lower bound in a real scale, by default None
Y_real_upper (Optional[MatrixLike2d], optional) – Model predicted lower bound in a real scale, , by default None
Y_real_range (ArrayLike1d) – Ranges of the response, [lb, rb]
Y_name (Optional[str], optional) – Name of Y variable, by default None
n_dim (Optional[int], optional) – Dimensional of X, i.e., number of columns
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
X_ranges (Optional[MatrixLike2d], optional) – list of x ranges, by default None
X_name (Optional[List(str)], optional) – Names of X varibale shown as x,y,z-labels
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
i_iter (Optional[str], optional) – Iteration number to add to the figure name by default ‘’’
- nextorch.plotting.response_surface_exp(Exp: nextorch.bo.Experiment, Y_real_range: Optional[Union[list, nextorch.utils.Array, torch.Tensor]] = None, log_flag: Optional[bool] = False, x_indices: Optional[List[int]] = [0, 1], fixed_values: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], fixed_values_real: Optional[Union[list, nextorch.utils.Array, torch.Tensor, float]] = [], baseline: Optional[str] = 'left', show_confidence: Optional[bool] = False, mesh_size: Optional[int] = 41, save_fig: Optional[bool] = False)¶
Show a 3-dimensional response surface in a real scale Using the experiment object
- Parameters
Exp (Experiment) – Experiment object
Y_real_range (Optional[ArrayLike1d], optional) – Ranges of the response, [lb, rb] to show on the plot, by default None
log_flag (Optional[bool], optional) – flag to plot in a log scale
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
fixed_values (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a unit scale, by default []
fixed_values_real (Optional[Union[ArrayLike1d, float]], optional) – fixed values in other dimensions, in a real scale, by default []
baseline (Optional[str], optional) – the choice of baseline, must be left, right or center
mesh_size (Optional[int], optional) – mesh size, by default 41
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.sampling_2d(Xs: Union[list, nextorch.utils.Matrix, torch.Tensor, List[Union[list, nextorch.utils.Matrix, torch.Tensor]]], X_ranges: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, x_indices: Optional[List[int]] = [0, 1], X_names: Optional[List[str]] = None, design_names: Optional[Union[str, List[str]]] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None)¶
Plot sampling plan(s) in 2 dimensional space X must be 2 dimensional
- Parameters
Xs (Union[MatrixLike2d, List[MatrixLike2d]]) – The set of sampling plans, Can be a list of matrices or one matrix
X_ranges (Optional[MatrixLike2d], optional) – list of x ranges, by default None
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
X_name (Optional[str], optional) – Names of X varibale shown as x,y-labels
design_names (Optional[List[str]], optional) – Names of the designs, by default None
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
- nextorch.plotting.sampling_2d_exp(Exp: nextorch.bo.Experiment, x_indices: Optional[List[int]] = [0, 1], design_names: Optional[Union[str, List[str]]] = None, save_fig: Optional[bool] = False)¶
Plot sampling plan(s) in 2 dimensional space X must be 2 dimensional Using the experiment object
- Parameters
Exp (Experiment) – Experiment object
x_indices (Optional[List[int]], optional) – indices of two x variables, by default [0, 1]
design_names (Optional[List[str]], optional) – Names of the designs, by default None
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.sampling_3d(Xs: Union[list, nextorch.utils.Matrix, torch.Tensor, List[Union[list, nextorch.utils.Matrix, torch.Tensor]]], X_ranges: Optional[Union[list, nextorch.utils.Matrix, torch.Tensor]] = None, x_indices: Optional[List[int]] = [0, 1, 2], X_names: Optional[List[str]] = None, slice_axis: Optional[Union[str, int]] = None, slice_value: Optional[float] = None, slice_value_real: Optional[float] = None, design_names: Optional[Union[str, List[str]]] = None, save_fig: Optional[bool] = False, save_path: Optional[str] = None)¶
Plot sampling plan(s) in 3 dimensional space X must be 3 dimensional
- Parameters
Xs (Union[MatrixLike2d, List[MatrixLike2d]]) – The set of sampling plans in a unit scale, Can be a list of matrices or one matrix
X_ranges (Optional[MatrixLike2d], optional) – list of x ranges, by default None
x_indices (Optional[List[int]], optional) – indices of three x variables, by default [0, 1, 2]
X_name (Optional[List(str)], optional) – Names of X varibale shown as x,y,z-labels
slice_axis (Optional[Union[str, int]], optional) – axis where a 2d slice is made, by default None
slice_value (Optional[float], optional) – value on the axis where a 2d slide is made, in a unit scale, by default None
slice_value_real (Optional[float], optional) – value on the axis where a 2d slide is made, in a real scale, by default None
design_names (Optional[List[str]], optional) – Names of the designs, by default None
save_fig (Optional[bool], optional) – if true save the plot by default False
save_path (Optional[str], optional) – Path where the figure is being saved by default the current directory
- Raises
ValueError – if input axis is defined but the value is not given
ValueError – if input axis name is not x, y or z, or 0, 1, 2
- nextorch.plotting.sampling_3d_exp(Exp: nextorch.bo.Experiment, x_indices: Optional[List[int]] = [0, 1, 2], slice_axis: Optional[str] = None, slice_value: Optional[float] = None, slice_value_real: Optional[float] = None, design_names: Optional[Union[str, List[str]]] = None, save_fig: Optional[bool] = False)¶
Plot sampling plan(s) in 3 dimensional space X must be 3 dimensional Using the experiment object
- Parameters
Exp (Experiment) – Experiment object
x_indices (Optional[List[int]], optional) – indices of three x variables, by default [0, 1, 2]
slice_axis (Optional[str], optional) – axis where a 2d slice is made, by default None
slice_value (Optional[float], optional) – value on the axis where a 2d slide is made, by default None
slice_value_real (Optional[float], optional) – value on the axis where a 2d slide is made, in a real scale, by default None
design_names (Optional[List[str]], optional) – Names of the designs, by default None
save_fig (Optional[bool], optional) – if true save the plot by default False
- nextorch.plotting.set_axis_values(xi_range: Union[list, nextorch.utils.Array, torch.Tensor], n_sections: Optional[int] = 2, decimals: Optional[int] = 2) Union[list, nextorch.utils.Array, torch.Tensor] ¶
Divide xi_range into n_sections
- Parameters
- Returns
axis_values – axis values with rounding up Number of values is n_sections + 1
- Return type
ArrayLike1d