Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions ml/testing-debugging/testing-debugging-classification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,8 @@
},
"source": [
"from sklearn.metrics import classification_report\n",
"mnistPred = model.predict_classes(x = mnistData)\n",
"mnistPred = model.predict(x = mnistData)\n",
"mnistPred_classes=np.argmax(mnistPred,axis=1)\n"
"print(classification_report(mnistLabels, mnistPred))"
],
"execution_count": 0,
Expand Down Expand Up @@ -1047,7 +1048,8 @@
" \n",
" def testStd(self):\n",
" y = model.predict(mnistData)\n",
" yStd = np.std(y)\n",
" yClasses = np.argmax(y,axis=1)\n"
" yStd = np.std(yClasses)\n",
" yStdActual = np.std(mnistLabels)\n",
" deltaStd = 0.05\n",
" errorMsg = 'Std. dev. of predicted values ' + str(yStd) + \\\n",
Expand All @@ -1057,7 +1059,8 @@
"\n",
" def testMean(self):\n",
" y = model.predict(mnistData)\n",
" yMean = np.mean(y)\n",
" yClasses = np.argmax(y,axis=1)\n"
" yMean = np.mean(yClasses)\n",
" yMeanActual = np.mean(mnistLabels)\n",
" deltaMean = 0.05\n",
" errorMsg = 'Mean of predicted values ' + str(yMean) + \\\n",
Expand Down