Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# Concatenate results from all models
all_models_dataframe = pd.concat([tf_pred_dataframe,
keys=['TF Model', 'TFLite', 'TFLite quantized'],
# Swap columns to hava side by side comparison
all_models_dataframe = all_models_dataframe.swaplevel(axis='columns')[tflite_pred_dataframe.columns]
# Highlight TFLite models predictions that are different from original model
def highlight_diff(data, color='yellow'):
attr = 'background-color: {}'.format(color)
other = data.xs('TF Model', axis='columns', level=-1)
return pd.DataFrame(np.where(, level=0), attr, ''),
index=data.index, columns=data.columns), axis=None)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.