Learn R Programming

cellGeometry (version 0.5.7)

plot_tune: Plot tuning curves

Description

Produces a ggplot2 plot of R-squared/RMSE values generated by tune_deconv().

Usage

plot_tune(
  result,
  group = "subclass",
  xvar = colnames(result)[1],
  fix = NULL,
  metric = attr(result, "metric"),
  title = NULL
)

Value

ggplot2 scatter plot.

Arguments

result

Dataframe of tuning results generated by tune_deconv().

group

Character value specifying column in result to be grouped by colour; or NULL to average R-squared/RMSE values across the grid and show the generalised mean effect of varying the parameter specified by xvar.

xvar

Character value specifying column in result to vary along the x axis.

fix

Optional list specifying parameters to be fixed at specific values.

metric

Specifies tuning metric: either "RMSE", "Rsq" or "pearson".

title

Character value for the plot title.

Details

If group is set to "subclass", then the tuning parameter specified by xvar is varied on the x axis. Any other tuning parameters (i.e. if 2 or more have been tuned) are fixed to their best tuned values.

If group is set to a different column than "subclass", then the mean R-squared/RMSE values in result are averaged over subclasses. This makes it easier to compare the overall effect (mean R-squared/RMSE) of 2 tuned parameters which are specified by xvar and group. Any remaining parameters not shown are fixed to their best tuned values.

If group is NULL, the tuning parameter specified by xvar is varied on the x axis and R-squared/RMSE values are averaged over the whole grid to give the generalised mean effect of varying the xvar parameter.