|
53 | 53 | },
|
54 | 54 | {
|
55 | 55 | "cell_type": "code",
|
56 |
| - "execution_count": 3, |
| 56 | + "execution_count": 5, |
57 | 57 | "id": "17b38552-4ffe-4ac9-b9ba-2ee96faa0e8d",
|
58 | 58 | "metadata": {
|
59 | 59 | "tags": []
|
|
68 | 68 | },
|
69 | 69 | "metadata": {},
|
70 | 70 | "output_type": "display_data"
|
71 |
| - }, |
72 |
| - { |
73 |
| - "name": "stdout", |
74 |
| - "output_type": "stream", |
75 |
| - "text": [ |
76 |
| - " Accuracy Precision Recall F1 Score\n", |
77 |
| - "baseline 0.46987 0.468308 0.46987 0.463567\n" |
78 |
| - ] |
79 | 71 | }
|
80 | 72 | ],
|
81 | 73 | "source": [
|
|
86 | 78 | "cm, metrics_df = m.calculate_metrics(actual_classes, predicted_classes, class_paths)\n",
|
87 | 79 | "\n",
|
88 | 80 | "# Plot the confusion matrix\n",
|
89 |
| - "m.plot_confusion_matrix(cm, class_paths, 'Baseline')\n", |
90 |
| - "\n", |
91 |
| - "# Display the metrics DataFrame\n", |
92 |
| - "print(metrics_df)" |
| 81 | + "m.plot_confusion_matrix(cm, class_paths, 'Baseline')" |
93 | 82 | ]
|
94 | 83 | },
|
95 | 84 | {
|
96 | 85 | "cell_type": "code",
|
97 |
| - "execution_count": null, |
| 86 | + "execution_count": 4, |
98 | 87 | "id": "ac7d7db5-1ca0-493a-8683-34660e799658",
|
99 | 88 | "metadata": {},
|
| 89 | + "outputs": [ |
| 90 | + { |
| 91 | + "data": { |
| 92 | + "text/html": [ |
| 93 | + "<div>\n", |
| 94 | + "<style scoped>\n", |
| 95 | + " .dataframe tbody tr th:only-of-type {\n", |
| 96 | + " vertical-align: middle;\n", |
| 97 | + " }\n", |
| 98 | + "\n", |
| 99 | + " .dataframe tbody tr th {\n", |
| 100 | + " vertical-align: top;\n", |
| 101 | + " }\n", |
| 102 | + "\n", |
| 103 | + " .dataframe thead th {\n", |
| 104 | + " text-align: right;\n", |
| 105 | + " }\n", |
| 106 | + "</style>\n", |
| 107 | + "<table border=\"1\" class=\"dataframe\">\n", |
| 108 | + " <thead>\n", |
| 109 | + " <tr style=\"text-align: right;\">\n", |
| 110 | + " <th></th>\n", |
| 111 | + " <th>Accuracy</th>\n", |
| 112 | + " <th>Precision</th>\n", |
| 113 | + " <th>Recall</th>\n", |
| 114 | + " <th>F1 Score</th>\n", |
| 115 | + " </tr>\n", |
| 116 | + " </thead>\n", |
| 117 | + " <tbody>\n", |
| 118 | + " <tr>\n", |
| 119 | + " <th>baseline</th>\n", |
| 120 | + " <td>0.46987</td>\n", |
| 121 | + " <td>0.468308</td>\n", |
| 122 | + " <td>0.46987</td>\n", |
| 123 | + " <td>0.463567</td>\n", |
| 124 | + " </tr>\n", |
| 125 | + " </tbody>\n", |
| 126 | + "</table>\n", |
| 127 | + "</div>" |
| 128 | + ], |
| 129 | + "text/plain": [ |
| 130 | + " Accuracy Precision Recall F1 Score\n", |
| 131 | + "baseline 0.46987 0.468308 0.46987 0.463567" |
| 132 | + ] |
| 133 | + }, |
| 134 | + "execution_count": 4, |
| 135 | + "metadata": {}, |
| 136 | + "output_type": "execute_result" |
| 137 | + } |
| 138 | + ], |
| 139 | + "source": [ |
| 140 | + "metrics_df" |
| 141 | + ] |
| 142 | + }, |
| 143 | + { |
| 144 | + "cell_type": "code", |
| 145 | + "execution_count": 8, |
| 146 | + "id": "48a01f31-0afb-4cc5-9de3-3f0b4e4a3eba", |
| 147 | + "metadata": {}, |
100 | 148 | "outputs": [],
|
101 |
| - "source": [] |
| 149 | + "source": [ |
| 150 | + "metrics_df.to_csv('../NoteBooks/scores.csv', index_label='Model')" |
| 151 | + ] |
102 | 152 | }
|
103 | 153 | ],
|
104 | 154 | "metadata": {
|
|
0 commit comments