Shortlink: goo.gl/wSuuS9
The github repository can be found at https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/data_generators/wikisum
Shortlink: goo.gl/wSuuS9
The github repository can be found at https://github.com/tensorflow/tensor2tensor/tree/master/tensor2tensor/data_generators/wikisum
import pandas as pd | |
import matplotlib.pyplot as plt | |
import seaborn as sns | |
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14): | |
"""Prints a confusion matrix, as returned by sklearn.metrics.confusion_matrix, as a heatmap. | |
Note that due to returning the created figure object, when this funciton is called in a | |
notebook the figure willl be printed twice. To prevent this, either append ; to your | |
function call, or modify the function by commenting out the return expression. |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS: