Preview:
def cm_report(df, model):
    num_label = {'ok': 1, 'nok' : 0}
    Y_test = df_test['class'].copy().map(num_label).astype('int')

    df.reset()
    predictions = model.predict(df, steps=len(df), verbose=0)
    pred_labels= np.where(predictions>0.5, 1, 0)

    target_names = ['nok : 0', 'ok : 1']
    print(classification_report(Y_test, pred_labels, target_names = target_names))
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter