param_jointplot¶
Apart from the heatmap, joint plot is also provided to display the joint sampling frequency of two parameters and the distribution of each parameter. Similar to param_heatmap, by default, this joint plot uses all configuration values on the two selected categorical parameters, you can also use argument configs to draw plot on the selected configurations.
Also, you can draw more flexible joint plots via providing parameters hue, configs, parameters, palette, shownan and kind.
To check more details for its available arguments, call:
import craceplot as cplot
help(cplot.param_jointplot)
Help on function param_jointplot in module craceplot.plots.parameters:
param_jointplot(data: 'CraceResults' = None, options: 'CplotOptions' = None, configs: "Union[Literal['all', 'final', 'elites'], list[int], None]" = 'all', parameters: 'Union[list[str], str, None]' = None, slice: 'bool' = True, _console: 'bool' = True, shownan: 'bool' = True, nbins: 'int' = 5, dpi: 'int' = 800, kind: "Literal['scatter', 'kde', 'hist', 'hex', 'reg', 'resid']" = 'hist', space: 'float' = 0.1, ratio: 'int' = 4, palette: 'str' = 'vlag', hue: 'str' = None, height: 'int' = 5)
Entrance to call pairplot in python console
:param data: object CraceResults that must be provided.
:param options: object CplotOptions that must be provided.
:param configs: Optional. Selected configurations for plotting, higher priority than option numConfigurations/selConfigurations.
| Union[Literal['all', 'final', 'elites'], list[int], None]='all'
:param parameters: A list of parameter names selected for plotting, higher priority than option multiParameters.
:param hue: A string of parameter name selected for plotting.
:param shownan: Boolean used to plot including/excluding missing values.
:param palette: A string of palatte name for plotting.
:param kind: A string from provided values for the type/shape of plots.
| Literal['scatter', 'kde', 'hist', 'hex', 'reg', 'resid']='hist'
Take ACOTSP for example:
import os
from pathlib import Path
cplot_home = cplot.where()
p = Path(os.path.join(cplot_home, 'inst', 'examples', 'acotsp'))
path_to_acotsp = os.path.relpath(p, Path.cwd())
results, options = cplot.run('-l', path_to_acotsp)
/opt/hostedtoolcache/Python/3.10.22/x64/lib/python3.10/site-packages/craceplot
#---------------------------------------------------------------------------------------------------
# Reading crace plot options...
# Arguments: ['-l', '../../../../../../../../opt/hostedtoolcache/Python/3.10.22/x64/lib/python3.10/site-packages/craceplot/inst/examples/acotsp']
#
# Loading crace plot options...
You must provide two continuous parameters using the parameters argument, and you can plot the joint plot by using code param_jointplot:
cplot.param_jointplot(data=results, options=options, parameters=['alpha', 'beta'])
The argument hue is the third parameter provided for plotting the distributions of the selected two parameters on it.
The argument kind is type for the joint plot and its avaliable values are in [‘scatter’, ‘kde’, ‘hist’, ‘hex’, ‘reg’, ‘resid’].
Among these values, [‘hex’, ‘reg’, ‘resid’] are not supported when argument hue is enabled.
cplot.param_jointplot(data=results, options=options, parameters=['alpha', 'beta'],
hue='q0',
kind='scatter',
shownan=False)