ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > CEN - 372 Homework > задача:


2015-10. 50517 - Confusion Matrix

CEN - 372 Homework

Старт: 16.сен.2015 в 10:00:00
Финиш: 16.мая.2016 в 14:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 2015-10. 50517 - Confusion Matrix
• 2015-20. 50518 - Histogram Equaliz...
• 2015-30. 50519 - Image Filtering
• 2015-40. 50498 - K-Means
• 2015-50. 50659 - Covariance Matrix
• 2015-60. 50505 - kht Puzzle
• 50. 50796 - KNN

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Question by Ibrahim Mesecan.

Confusion Matrix

In artificial intelligence, especially in supervised learning, performance of an algorithm is measured using a specific table layout which is called Confusion matrix. On the rows of the table actual object classes are listed. And on the columns the predicted object classes are listed. For example the table below lists confusion matrix for positive and negative objects.

The table on the right tells that there are actually 8 positive and 6 negative objects. The algorithm has predicted 5 positives and 4 negatives correctly. But it has predicted 3 positives as negative and 2 negatives as positive.

Question: Write a program that is going to read actual and predicted classes of n objects. Then your program will show the confusion matrix.

Input specification
You will be given two integers in the beginning: the number of classes (k) and the number of queries (n). Then in the following k lines, you will be k strings (which are in alphabetical order): the object classes where each class label can have at most 20 chars (only 26 English letters). The in the following n lines you will be given two strings.

  • Actual object class
  • Detected class
where 1 ≤ n ≤ 5,000 and 1 ≤ k ≤ 60.

Output specification
Show k-by-k matrix.

Sample Input I
3 10
Apple
Orange
Pear
Pear Pear
Orange Orange
Apple Orange
Orange Orange
Pear Pear
Pear Pear
Orange Pear
Apple Apple
Orange Orange
Apple Pear
Sample Output I
1 1 1
0 3 1
0 0 3


Для отправки решений необходимо выполнить вход.

www.contester.ru