Created
May 28, 2019 06:20
-
-
Save frogermcs/0e95c0bfc572eb78af7a24523bf237c1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Concatenation of argmax and max value for each row | |
def max_values_only(data): | |
argmax_col = np.argmax(data, axis=1).reshape(-1, 1) | |
max_col = np.max(data, axis=1).reshape(-1, 1) | |
return np.concatenate([argmax_col, max_col], axis=1) | |
# Build simplified prediction tables | |
tf_model_pred_simplified = max_values_only(tf_model_predictions) | |
tflite_model_pred_simplified = max_values_only(tflite_model_predictions) | |
tflite_q_model_pred_simplified = max_values_only(tflite_q_model_predictions) | |
# Build DataFrames and present example | |
columns_names = ["Label_id", "Confidence"] | |
tf_model_simple_dataframe = pd.DataFrame(tf_model_pred_simplified) | |
tf_model_simple_dataframe.columns = columns_names | |
tflite_model_simple_dataframe = pd.DataFrame(tflite_model_pred_simplified) | |
tflite_model_simple_dataframe.columns = columns_names | |
tflite_q_model_simple_dataframe = pd.DataFrame(tflite_q_model_pred_simplified) | |
tflite_q_model_simple_dataframe.columns = columns_names |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment