I am trying to use scikitplot.metrics.plot_calibration_curve
to plot calibration curves for my models and would like to change the line-type (eg. dashed, solid, dotted) in the resulting charts.
The simplest reproducible example I could make is below.
import scikitplot as skplt
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
# load the breast_cancer dataset and split it into train and test sets
X, y = load_breast_cancer(return_X_y=True)
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0)
rf = RandomForestClassifier()
lr = LogisticRegression()
rf_probas = rf.fit(X_train, y_train).predict_proba(X_test)
lr_probas = lr.fit(X_train, y_train).predict_proba(X_test)
clf_names = ['Random Forest', 'Logistic Regression']
probas_list = [rf_probas, lr_probas]
skplt.metrics.plot_calibration_curve(y_test,
probas_list,
clf_names)
Which gives exactly what I want:
But I would just like to be able to change the line-types, so that the chart can be printed in black and white.