get函數在字典內的用法,當字典內不存在a時,使用classCount.get(votelabel,0)在字典內添加了‘a’,在字典內存在‘a’之後,使用
classCount[votelabel]=classCount.get(votelabel,0)+1使得‘a’的數目增加
#tile的作用
#>>> numpy.tile([0,0],(2,1))#在列方向上重複[0,0]1次,行2次
#array([[0, 0],
# [0, 0]])
shape函數的作用
dataSetSize= dataSet.shape[0]%使用shape[0] #讀取矩陣第一維度(列)的長度