Author: Not specified Language: python
Description: (v10) Timestamp: 2018-05-21 03:22:51 +0000
View raw paste Parent paste by: Not specified - Child paste by: Not specified Reply
  1. def adaClassify(datToClass,classifierArr):
  2.     dataMatrix = np.mat(datToClass)#do stuff similar to last aggClassEst in adaBoostTrainDS
  3.     m = np.shape(dataMatrix)[0]
  4.     aggClassEst = np.mat(np.zeros((m,1)))
  5.     for i in range(len(classifierArr)):
  6.         classEst =stumpClassify(dataMatrix,classifierArr[i]['dim'],classifierArr[i]['thresh'],classifierArr[i]['ineq'])#call stump classify
  7.         aggClassEst += classifierArr[i]['alpha']*classEst
  8.         #print (aggClassEst)
  9.     return np.sign(aggClassEst)
View raw paste Parent paste by: Not specified - Child paste by: Not specified Reply