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
def compare_nearest_neighbors(self): | |
""" get nearest neighbor for every wrong labeled datapoint and compare feature values in one DataFrame """ | |
results = [] | |
for index, row in self.wrong_predictions.iterrows(): | |
query_data_point = row[:-2] | |
query_data = row[:] | |
data_points = self.X_predictions.iloc[:, :-2] |
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
predictions = model.predict(test_images) | |
predictions = np.argmax(predictions, axis=1) | |
conf_matrix = confusion_matrix(np.argmax(test_labels, axis=1), predictions) | |
# just for better presentation - but store original values | |
default_figsize = plt.rcParams['figure.figsize'] | |
default_dpi = plt.rcParams['figure.dpi'] | |
plt.rcParams['figure.figsize'] = [19, 12] | |
plt.rcParams['figure.dpi'] = 150 |
OlderNewer