" # Print out the wrong data identified by the current group\n",
" print(\"Row {}, column {} is incorrectly identified as {}, the correct value should be {}\".format(int(i/8)+1,i%8+1,pred[i],labels[i]),'\\n')\n",
" print(\"Row {}, column {} is incorrectly identified as {}, the correct value should be {}\".format(int(i/8)+1, i%8+1, pred[i], labels[i]), '\\n')\n",
"if index:\n",
" print(\"All the figures in this group are predicted correctly!\")\n",
"print(pred,\"<--Predicted figures\") # Print the numbers recognized by each group of pictures\n",
"print(labels,\"<--The right number\") # Print the subscript corresponding to each group of pictures\n",
"print(pred,\"<--Predicted figures\") # Print the numbers recognized by each group of pictures\n",
"print(labels,\"<--The right number\") # Print the subscript corresponding to each group of pictures\n",
"plt.show()"
]
},
...
...
@@ -846,16 +850,16 @@
"source": [
"# define the pie drawing function of probability analysis\n",
"def plot_pie(prbs):\n",
" dict1={}\n",
" dict1 = {}\n",
" # Remove the negative number and build the dictionary dict1. The key is the number and the value is the probability value\n",
" for i in range(10):\n",
" if prbs[i]>0:\n",
" dict1[str(i)]=prbs[i]\n",
" if prbs[i] > 0:\n",
" dict1[str(i)] = prbs[i]\n",
"\n",
" label_list = dict1.keys() # Label of each part\n",
" size = dict1.values() # Size of each part\n",
" colors = [\"red\", \"green\",\"pink\",\"blue\",\"purple\",\"orange\",\"gray\"] # Building a round cake pigment Library\n",
" color = colors[:len(size)]# Color of each part\n",
" colors = [\"red\", \"green\", \"pink\", \"blue\", \"purple\", \"orange\", \"gray\"] # Building a round cake pigment Library\n",
" color = colors[:len(size)]# Color of each part\n",