plot_profit#
- scikitplot.modelplotpy.plot_profit(plot_input, fixed_costs, variable_costs_per_unit, profit_per_unit, save_fig=True, save_fig_filename='', highlight_ntile=False, highlight_how='plot_text')#
Plotting profit curve
- Parameters:
plot_input (pandas dataframe) – The result from scope_modevalplot().
fixed_costs (int / float) – Specifying the fixed costs related to a selection based on the model. These costs are constant and do not vary with selection size (ntiles).
variable_costs_per_unit (int / float) – Specifying the variable costs per selected unit for a selection based on the model. These costs vary with selection size (ntiles).
profit_per_unit (int / float) – Specifying the profit per unit in case the selected unit converts / responds positively.
save_fig (bool, default True) – Save the plot.
save_fig_filename (str, default unspecified.) – Specify the path and filetype to save the plot. If nothing specified, the plot will be saved as jpeg to the current working directory.
highlight_ntile (int, default None) – Highlight the value of the response curve at a specified ntile value.
highlight_how (str, plot_text default) – Highlight_how specifies where information about the model performance is printed. It can be shown as text, on the plot or both.
- Returns:
It returns a matplotlib.axes._subplots.AxesSubplot object that can be transformed into the same plot with the .figure command.
The plot is by default written to disk (save_fig = True). The location and filetype of the file depend on the save_fig_filename parameter.
If the save_fig_filename parameter is empty (not specified), the plot will be written to the working directory as png.
Otherwise the location and file type is specified by the user.
- Raises:
TypeError – If
highlight_ntile
is not specified as an int.:ValueError – If the wrong
highlight_how
value is specified.: