def loadGradientBoostingModel(GBModelName, isRegression=False):
 try:
  fo = open((GBModelName + 'MEANS'), 'rb')
 except IOError:
  print "Load Random Forest Model: Didn't find file"
  return
 try:
  MEAN = cPickle.load(fo)
  STD = cPickle.load(fo)
  if (not isRegression):
   classNames = cPickle.load(fo)
  mtWin = cPickle.load(fo)
  mtStep = cPickle.load(fo)
  stWin = cPickle.load(fo)
  stStep = cPickle.load(fo)
  computeBEAT = cPickle.load(fo)
 except:
  fo.close()
 fo.close()
 MEAN = numpy.array(MEAN)
 STD = numpy.array(STD)
 COEFF = []
 with open(GBModelName, 'rb') as fid:
  GB = cPickle.load(fid)
 if isRegression:
  return (GB, MEAN, STD, mtWin, mtStep, stWin, stStep, computeBEAT)
 else:
  return (GB, MEAN, STD, classNames, mtWin, mtStep, stWin, stStep, computeBEAT)

def loadGradientBoostingModel ( GBModelName , isRegression = False ) : try : fo = open ( ( GBModelName + 'MEANS' ) , 'rb' ) except IOError : print "Load Random Forest Model: Didn't find file" return try : MEAN = cPickle . load ( fo ) STD = cPickle . load ( fo ) if ( not isRegression ) : classNames = cPickle . load ( fo ) mtWin = cPickle . load ( fo ) mtStep = cPickle . load ( fo ) stWin = cPickle . load ( fo ) stStep = cPickle . load ( fo ) computeBEAT = cPickle . load ( fo ) except : fo . close ( ) fo . close ( ) MEAN = numpy . array ( MEAN ) STD = numpy . array ( STD ) COEFF = [ ] with open ( GBModelName , 'rb' ) as fid : GB = cPickle . load ( fid ) if isRegression : return ( GB , MEAN , STD , mtWin , mtStep , stWin , stStep , computeBEAT ) else : return ( GB , MEAN , STD , classNames , mtWin , mtStep , stWin , stStep , computeBEAT )
this function loads gradient boosting either for classification or training .