You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/widgets/evaluate/confusionmatrix.md
+23-24Lines changed: 23 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,39 +12,38 @@ Shows proportions between the predicted and actual class.
12
12
- Selected Data: data subset selected from confusion matrix
13
13
- Data: data with the additional information on whether a data instance was selected
14
14
15
-
The [Confusion Matrix](https://en.wikipedia.org/wiki/Confusion_matrix) gives the number/proportion of instances between the predicted and actual class. The selection of the elements in the matrix feeds the corresponding instances into the output signal. This way, one can observe which specific instances were misclassified and how.
15
+
The [Confusion Matrix](https://en.wikipedia.org/wiki/Confusion_matrix) gives the number/proportion of instances between the predicted and actual class. Each row corresponds to a correct class, while columns represent the predicted classes. The rightmost column gives the number of instances from each class and the bottom row gives the number of instances classified into each class.
16
16
17
-
The widget usually gets the evaluation results from [Test & Score](../evaluate/testandscore.md); an example of the schema is shown below.
17
+
The selection of the elements in the matrix feeds the corresponding instances into the output signal. This way, one can observe which specific instances were misclassified and how.
18
+
19
+
The widget usually gets the evaluation results from [Test and Score](../evaluate/testandscore.md); an example of the schema is shown below.
18
20
19
21

20
22
21
-
1. When evaluation results contain data on multiple learning algorithms, we have to choose one in the *Learners* box.
22
-
The snapshot shows the confusion matrix for [Tree](../model/tree.md) and [Naive Bayesian](../model/naivebayes.md) models trained and tested on the *iris* data. The right-hand side of the widget contains the matrix for the naive Bayesian model (since this model is selected on the left). Each row corresponds to a correct class, while columns represent the predicted classes. For instance, four instances of *Iris-versicolor* were misclassified as *Iris-virginica*. The rightmost column gives the number of instances from each class (there are 50 irises of each of the three classes) and the bottom row gives the number of instances classified into each class (e.g., 48 instances were classified into virginica).
23
-
2. In *Show*, we select what data we would like to see in the matrix.
23
+
1.*Learners*: Choose a learning algorithm to display.
24
+
2.*Output*: define what is sent to the output, namely predicted classes (*Predictions*) or their probabilities (*Probabilities*).
25
+
3. The widget outputs every change if *Send Automatically* is ticked. If not, the user will need to click *Send Selected* to commit the changes.
26
+
4.*Show*: select what data to see in the matrix.
24
27
-**Number of instances** shows correctly and incorrectly classified instances numerically.
25
-
-**Proportions of predicted** shows how many instances classified as, say, *Iris-versicolor* are in which true class; in the table we can read the 0% of them are actually setosae, 88.5% of those classified as versicolor are versicolors, and 7.7% are virginicae.
26
-
-**Proportions of actual** shows the opposite relation: of all true versicolors, 92% were classified as versicolors and 8% as virginicae.
27
-

28
-
3. In *Select*, you can choose the desired output.
29
-
-**Correct**sends all correctly classified instances to the output by selecting the diagonal of the matrix.
30
-
-**Misclassified** selects the misclassified instances.
31
-
-**None** annuls the selection.
32
-
As mentioned before, one can also select individual cells of the table to select specific kinds of misclassified instances (e.g. the versicolors classified as virginicae).
33
-
4. When sending selected instances, the widget can add new attributes, such as predicted classes or their probabilities, if the corresponding options *Predictions* and/or *Probabilities* are checked.
34
-
5. The widget outputs every change if *Send Automatically* is ticked. If not, the user will need to click *Send Selected* to commit the changes.
35
-
6. Produce a report.
28
+
-**Proportions of predicted** shows how many instances classified as, say, *Iris-versicolor* are in which true class; in the table we can read the 0% of them are actually setosae, 95.9% of those classified as versicolor are versicolors, and 4.1% are virginicae.
29
+

30
+
-**Proportions of actual** shows the opposite relation: of all true versicolors, 94% were classified as versicolors and 6% as virginicae.
31
+

32
+
-**Sum of probabilities**sums the probabilities for each class. For example, there are 50 iris-setosas. This option sums probabilities for all *actual* versicolors to belong to iris-setosa (1.4), to iris-versicolor (41.4), and to iris-virginica (7.2).
33
+

34
+
5. Select the desired output:
35
+
-**Select Correct** sends all correctly classified instances to the output by selecting the diagonal of the matrix.
36
+
-**Select Misclassified** selects the misclassified instances.
37
+
-**Clear Selection** annuls the selection.
38
+
As mentioned before, one can also select individual cells of the table to select specific kinds of misclassified instances.
36
39
37
40
Example
38
41
-------
39
42
40
-
The following workflow demonstrates what this widget can be used for.
41
-
42
-

43
-
44
-
[Test & Score](../evaluate/testandscore.md) gets the data from [File](../data/file.md) and two learning algorithms from [Naive Bayes](../model/naivebayes.md) and [Tree](../model/tree.md). It performs cross-validation or some other train-and-test procedures to get class predictions by both algorithms for all (or some) data instances. The test results are fed into the **Confusion Matrix**, where we can observe how many instances were misclassified and in which way.
43
+
The following workflow demonstrates what this widget can be used for. We are using the *iris* dataset for demonstration.
45
44
46
-
In the output, we used [Data Table](../data/datatable.md) to show the instances we selected in the confusion matrix. If we, for instance, click *Misclassified*, the table will contain all instances which were misclassified by the selected method.
45
+

47
46
48
-
The [Scatter Plot](../visualize/scatterplot.md) gets two sets of data. From the [File](../data/file.md)widget it gets the complete data, while the confusion matrix sends only the selected data, misclassifications for instance. The scatter plot will show all the data, with bold symbols representing the selected data.
47
+
[Test and Score](../evaluate/testandscore.md) gets the data from [File](../data/file.md)and a learning algorithm, [Naive Bayes](../model/naivebayes.md). It performs cross-validation or some other train-and-test procedures to get class predictions for all (or some) data instances. The test results are fed into the **Confusion Matrix**, where we can observe how many instances were misclassified and in which way.
49
48
50
-

49
+
In the output, we used [Scatter Plot](../visualize/scatterplot.md), which gets two sets of data, the whole dataset from the File widget, and a subset from Confusion Matrix. Now, we wish to show where the misclassifications lie in the Scatter Plot. We click *Misclassified*, which selects all the off-diagonal (misclassified) instances from the confusion matrix. The scatter plot will show all the data in a graph, with bold symbols representing the selected (misclassified) data points.
0 commit comments