plot_curve
- hybrid_learning.experimentation.fuzzy_exp.fuzzy_exp_vis.plot_curve(metrics_pd, x='recall', y='precision', ax=None, variables=None, constraints=None, model_key='maskrcnn_box', logic_types=('boolean', 'lukasiewicz', 'product', 'goedel'), formulas=None, add_diagonal=None, add_value_hints=True, add_markers=False, legend_outer=True, title='ROC {model_key} ({variable})', figsize=(10, 10), formula_name_col='formula_attrs', to_pretty_names=None, verbose=False, lims=((0, 1.0), (0, 1.0)), save_as=None)[source]
Plot a curve of
y
againstx
varying the value ofvariables[0]
givenconstraints
. For each entry inlogic_types
andformulas
, and for each value of entries invariables[1:]
, produce a new line.To just get a normal plot, call
plot_curve(x='x', y='y', variables=['x'], add_value_hints=False, add_diagonal=False, ...)
.- Parameters
x – column name of the x-values
y – column name of the y-values
variables – keys of variables in the DataFrame to vary over; different values for the first one are plotted into one curve, further variables will create new curves for different values
constraints (Optional[Dict[str, float]]) – mapping of keys of variables in the dataframe to a fixed value; used to filter the DataFrame
model_key (str) – shorthand for
constraints={'model_key': model_key}
logic_types (Sequence[str]) – filter the DataFrame for any of these values of the
"logic_type"
columnformulas (Optional[List[str]]) – if given, filter the DataFrame for any of these values of the
formula_name_col
columnformula_name_col (str) – see formulas
add_value_hints (bool) – whether to add small text fields with the values of
variable
at each sample pointadd_diagonal (Optional[bool]) – add a diagonal; set to
False
to disable; else set to'start_at_one'
(default for PR-curves) or'start_at_zero'
(default else)legend_outer (bool) – whether to put the legend of plots outside of the plot
title (str) – figure or axis title; may contain formatting placeholders
{model_key}
, and{variable}
(forvariables[0]
)to_pretty_names (Optional[Dict[str, str]]) – dictionary mapping values of
model_key
andmetrics
to pretty namesverbose (bool) – whether to also prettily display all values of the relevant columns of the DataFrame
lims (Tuple[Tuple[float, float], Tuple[float, float]]) – tuple of
((xmin, xmax), (ymin, ymax))
to set the xlim and ylim of the axessave_as (Optional[str]) – if given, either directory or file path where to save this plot
metrics_pd (DataFrame) –
add_markers (bool) –
- Returns
all plotted rows of the DataFrame