output_confusion_matrix is changed to be a function.
This commit is contained in:
parent
edcbb1139a
commit
9baa0f8641
Binary file not shown.
@ -9,14 +9,6 @@ from sklearn.metrics import accuracy_score
|
|||||||
from sklearn.metrics import confusion_matrix
|
from sklearn.metrics import confusion_matrix
|
||||||
|
|
||||||
|
|
||||||
currDir = 'C:\\Users\\Aki\\source\\repos\\rug_VS\\dialect_identification\\dialect_identification'
|
|
||||||
sys.path.append(os.path.join(os.path.dirname(sys.path[0]), currDir))
|
|
||||||
|
|
||||||
regionLabels = ['Groningen_and_Drenthe', 'Oost_Overijsel-Gelderland', 'Limburg']
|
|
||||||
regionLabels2 = ['Groningen_and_Drenthe', 'Limburg']
|
|
||||||
dirOut = currDir + '\\result\\same-utterance_with_cities'
|
|
||||||
|
|
||||||
|
|
||||||
def plot_confusion_matrix(cm, classes,
|
def plot_confusion_matrix(cm, classes,
|
||||||
normalize=False,
|
normalize=False,
|
||||||
title='Confusion matrix',
|
title='Confusion matrix',
|
||||||
@ -56,6 +48,14 @@ def plot_confusion_matrix(cm, classes,
|
|||||||
plt.xlabel('Predicted label', fontsize=_fontsize-4)
|
plt.xlabel('Predicted label', fontsize=_fontsize-4)
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
currDir = 'C:\\Users\\Aki\\source\\repos\\rug_VS\\dialect_identification\\dialect_identification'
|
||||||
|
sys.path.append(os.path.join(os.path.dirname(sys.path[0]), currDir))
|
||||||
|
|
||||||
|
regionLabels = ['Groningen_and_Drenthe', 'Oost_Overijsel-Gelderland', 'Limburg']
|
||||||
|
regionLabels2 = ['Groningen_and_Drenthe', 'Limburg']
|
||||||
|
dirOut = currDir + '\\result\\same-utterance_with_cities'
|
||||||
|
|
||||||
pred = np.load(dirOut + '\\pred_per_pid_3regions.npy')
|
pred = np.load(dirOut + '\\pred_per_pid_3regions.npy')
|
||||||
|
|
||||||
#accuracy = accuracy_score(pred[:, 1], pred[:, 2], normalize=True, sample_weight=None)
|
#accuracy = accuracy_score(pred[:, 1], pred[:, 2], normalize=True, sample_weight=None)
|
||||||
|
Loading…
Reference in New Issue
Block a user