class protopipe.benchmarks.ClassifierDiagnostic(model, feature_name_list, target_name, data_train, data_test, model_output_name='score', is_output_proba=False)[source]#

Bases: protopipe.benchmarks.plot.ModelDiagnostic

Class to plot several diagnostic plot for classification.

Assume that positives and negatives are respectively labeled as 1 and 0.

model: sklearn.base.BaseEstimator

Scikit model

feature_name_list: list

List of features

model_output_name: str

Name of output

is_output_proba: bool

If false, decision_function will be called, otherwise, predict_proba. In the last case we only consider the probability for signal event

Methods Summary

add_image_model_output(data, col_name)

Add model output column


Plot output distribution.

Methods Documentation

add_image_model_output(data, col_name)[source]#

Add model output column

plot_image_model_output_distribution(title='', cut=None, nbin=30, hist_kwargs_list=[{'edgecolor': 'blue', 'color': 'blue', 'label': 'Gamma training sample', 'alpha': 0.2, 'fill': True, 'ls': '-', 'lw': 2}, {'edgecolor': 'blue', 'color': 'blue', 'label': 'Gamma test sample', 'alpha': 1, 'fill': False, 'ls': '--', 'lw': 2}, {'edgecolor': 'red', 'color': 'red', 'label': 'Proton training sample', 'alpha': 0.2, 'fill': True, 'ls': '-', 'lw': 2}, {'edgecolor': 'red', 'color': 'red', 'label': 'Proton test sample', 'alpha': 1, 'fill': False, 'ls': '--', 'lw': 2}], error_kw_list=[{'ecolor': 'blue', 'lw': 2, 'capsize': 3, 'capthick': 2, 'alpha': 0.2}, {'ecolor': 'blue', 'lw': 2, 'capsize': 3, 'capthick': 2, 'alpha': 1}, {'ecolor': 'red', 'lw': 2, 'capsize': 3, 'capthick': 2, 'alpha': 0.2}, {'ecolor': 'red', 'lw': 2, 'capsize': 3, 'capthick': 2, 'alpha': 1}])[source]#

Plot output distribution. Need more output column